Skip to content

Commit

Permalink
Mark identityClaims as required, old identity properties as optional (#…
Browse files Browse the repository at this point in the history
…395)

* Mark identityClaims as required, old identity properties as optional

* review changes

* made userid optional
  • Loading branch information
sbryzak authored Jan 17, 2024
1 parent 8d18c92 commit 1df0e63
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
6 changes: 3 additions & 3 deletions api/v1alpha1/masteruserrecord_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ type MasterUserRecordSpec struct {
// Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html

// UserID is the user ID from RHD Identity Provider token (“sub” claim)
UserID string `json:"userID"`
// +optional
UserID string `json:"userID,omitempty"`

// If set to true then the corresponding user should not be able to login (but the underlying UserAccounts still exists)
// "false" is assumed by default
Expand All @@ -83,8 +84,7 @@ type MasterUserRecordSpec struct {

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

type UserAccountEmbedded struct {
Expand Down
6 changes: 3 additions & 3 deletions api/v1alpha1/useraccount_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ type UserAccountSpec struct {

// UserID is the user ID from RHD Identity Provider token (“sub” claim)
// Is to be used to create Identity and UserIdentityMapping resources
UserID string `json:"userID"`
// +optional
UserID string `json:"userID,omitempty"`

// If set to true then the corresponding user should not be able to login
// "false" is assumed by default
Expand All @@ -47,8 +48,7 @@ type UserAccountSpec struct {

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

// UserAccountStatus defines the observed state of UserAccount
Expand Down
9 changes: 5 additions & 4 deletions api/v1alpha1/usersignup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,12 @@ type UserSignupSpec struct {
TargetCluster string `json:"targetCluster,omitempty"`

// The user's user ID, obtained from the identity provider from the 'sub' (subject) claim
Userid string `json:"userid"`
// +optional
Userid string `json:"userid,omitempty"`

// The user's username, obtained from the identity provider.
Username string `json:"username"`
// +optional
Username string `json:"username,omitempty"`

// The user's first name, obtained from the identity provider.
// +optional
Expand All @@ -199,8 +201,7 @@ type UserSignupSpec struct {
OriginalSub string `json:"originalSub,omitempty"`

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

// IdentityClaimsEmbedded is used to define a set of SSO claim values that we are interested in storing
Expand Down
10 changes: 3 additions & 7 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 1df0e63

Please sign in to comment.