Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sbryzak committed Sep 7, 2023
1 parent e89c2c1 commit ed29c3b
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 21 deletions.
4 changes: 4 additions & 0 deletions api/v1alpha1/masteruserrecord_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ type MasterUserRecordSpec struct {
// temporarily marked as optional until the migration took place (CRT-1321)
// +optional
TierName string `json:"tierName,omitempty"`

// PropagatedClaims contains a selection of claim values from the SSO Identity Provider which are intended to
// be "propagated" down the resource dependency chain
PropagatedClaims PropagatedClaims `json:"propagatedClaims,omitempty"`
}

type UserAccountEmbedded struct {
Expand Down
4 changes: 4 additions & 0 deletions api/v1alpha1/useraccount_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ type UserAccountSpec struct {
// a new IdP provider client, and contains the user's "original-sub" claim
// +optional
OriginalSub string `json:"originalSub,omitempty"`

// PropagatedClaims contains a selection of claim values from the SSO Identity Provider which are intended to
// be "propagated" down the resource dependency chain
PropagatedClaims PropagatedClaims `json:"propagatedClaims,omitempty"`
}

// UserAccountStatus defines the observed state of UserAccount
Expand Down
21 changes: 15 additions & 6 deletions api/v1alpha1/usersignup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,21 @@ type UserSignupSpec struct {
OriginalSub string `json:"originalSub,omitempty"`

// IdentityClaims contains as-is claim values extracted from the user's access token
IdentityClaims IdentityClaimsEmbedded `json:"identitytokenClaims,omitempty"`
IdentityClaims IdentityClaimsEmbedded `json:"identityClaims,omitempty"`
}

// IdentityClaimsEmbedded is used to define a set of SSO claim values that we are interested in storing
// +k8s:openapi-gen=true
type IdentityClaimsEmbedded struct {

// PropagatedClaims
PropagatedClaims PropagatedClaims `json:",inline"`

// Sub contains the value of the 'sub' claim
Sub string `json:"sub,omitempty"`

// UserID contains the value of the 'user_id' claim
UserID string `json:"userID,omitempty"`

// AccountID contains the value of the 'account_id' claim
AccountID string `json:"accountID,omitempty"`
// Email contains the user's email address
Email string `json:"email,omitempty"`

// GivenName contains the value of the 'given_name' claim
// +optional
Expand All @@ -223,6 +224,14 @@ type IdentityClaimsEmbedded struct {
// Company contains the value of the 'company' claim
// +optional
Company string `json:"company,omitempty"`
}

type PropagatedClaims struct {
// UserID contains the value of the 'user_id' claim
UserID string `json:"userID,omitempty"`

// AccountID contains the value of the 'account_id' claim
AccountID string `json:"accountID,omitempty"`

// OriginalSub is an optional property temporarily introduced for the purpose of migrating the users to
// a new IdP provider client, and contains the user's "original-sub" claim
Expand Down
18 changes: 18 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 38 additions & 15 deletions api/v1alpha1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ed29c3b

Please sign in to comment.