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

Add support of external users replication feature #317

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
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
25 changes: 25 additions & 0 deletions cluster-commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ const (
SRIAMItemSvcAcc = "service-account"
SRIAMItemSTSAcc = "sts-account"
SRIAMItemIAMUser = "iam-user"
SRIAMItemExternalUser = "external-user"
)

// SRSvcAccCreate - create operation
Expand Down Expand Up @@ -345,6 +346,27 @@ type SRSTSCredential struct {
APIVersion string `json:"apiVersion,omitempty"`
}

// OpenIDUserAccessInfo contains information to access and refresh the token
// that is used to access to UserInfo OpenID endpoint.
type OpenIDUserAccessInfo struct {
RefreshToken string `json:"refreshToken,omitempty"`
AccessToken string `json:"accessToken,omitempty"`
}

// OpenIDUser holds information to maintain an virtual user in OpenID
type OpenIDUser struct {
AccessInfo OpenIDUserAccessInfo `json:"accessInfo,omitempty"`
}

// SRExternalUser - represents an external user information to be replicated.
type SRExternalUser struct {
APIVersion string `json:"apiVersion,omitempty"`
Name string `json:"name"`
IsDeleteReq bool `json:"isDeleteReq"`

OpenIDUser *OpenIDUser `json:"openIDUser,omitempty"`
}

// SRIAMUser - represents a regular (IAM) user to be replicated. A nil UserReq
// implies that a user delete operation should be replicated on the peer cluster.
type SRIAMUser struct {
Expand Down Expand Up @@ -402,6 +424,9 @@ type SRIAMItem struct {
// Used when Type = SRIAMItemIAMUser
IAMUser *SRIAMUser `json:"iamUser"`

// Used when Type = SRIAMItemExternalUser
ExternalUser *SRExternalUser `json:"externalUser"`

// UpdatedAt - timestamp of last update
UpdatedAt time.Time `json:"updatedAt,omitempty"`
APIVersion string `json:"apiVersion,omitempty"`
Expand Down
Loading