Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle external ops subscription #1022

Merged
merged 12 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add quote roles to config role types
  • Loading branch information
caffeinated92 committed Jan 25, 2025
commit 2a604e53a89a28592ae00add7b55f07dc11e1b1e
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2549,6 +2549,8 @@ func GetRoleType() map[string]string {
RolePending: RolePending,
RolePendingExtDBOps: RolePendingExtDBOps,
RolePendingExtSysOps: RolePendingExtSysOps,
RoleQuoteExtDBOps: RoleQuoteExtDBOps,
RoleQuoteExtSysOps: RoleQuoteExtSysOps,
RoleUnsubscribed: RoleUnsubscribed,
RoleUnsubscribedExtDBOps: RoleUnsubscribedExtDBOps,
RoleUnsubscribedExtSysOps: RoleUnsubscribedExtSysOps,
Expand Down
4 changes: 2 additions & 2 deletions server/server_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,11 @@ func (repman *ReplicationManager) AcceptExternalOps(userform CloudUserForm, cl *

if userform.Roles == config.RoleExtDBOps {
if v, ok := auser.Roles[config.RoleQuoteExtDBOps]; !ok || !v {
return fmt.Errorf("User %s does not have '%s' role", user, config.RoleQuoteExtSysOps)
return fmt.Errorf("User %s does not have '%s' role", user, config.RoleQuoteExtDBOps)
}

extops = repman.CreateExtDBOpsForm(user)
auser.Roles[config.RoleQuoteExtSysOps] = false
auser.Roles[config.RoleQuoteExtDBOps] = false
cl.Conf.Cloud18ExternalDbOpsStatus = config.ExternalActive
} else if userform.Roles == config.RoleExtSysOps {
if v, ok := auser.Roles[config.RoleQuoteExtSysOps]; !ok || !v {
Expand Down