Skip to content

Commit

Permalink
ROX-14473: require user org_id to match ACS owner org_id (#751)
Browse files Browse the repository at this point in the history
Co-authored-by: dhaus67 <[email protected]>
  • Loading branch information
ivan-degtiarenko and dhaus67 authored Jan 24, 2023
1 parent 81ffd8b commit 29ba32c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions fleetshard/pkg/central/reconciler/init_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ var (
RoleName: "Admin",
}
},
func(providerId string, auth private.ManagedCentralAllOfSpecAuth) *storage.Group {
return &storage.Group{
Props: &storage.GroupProperties{
AuthProviderId: providerId,
Key: "rh_is_org_admin",
Value: "true",
Traits: &storage.Traits{
MutabilityMode: storage.Traits_ALLOW_MUTATE_FORCED,
},
},
RoleName: "Admin",
}
},
}
)

Expand Down Expand Up @@ -163,9 +176,17 @@ func createAuthProviderRequest(central private.ManagedCentral) *storage.AuthProv
},
ClaimMappings: map[string]string{
"realm_access.roles": "groups",
"org_id": "rh_org_id",
"is_org_admin": "rh_is_org_admin",
},
// TODO: for testing purposes only; remove once host is correctly specified in fleet-manager
ExtraUiEndpoints: []string{"localhost:8443"},
RequiredAttributes: []*storage.AuthProvider_RequiredAttribute{
{
AttributeKey: "rh_org_id",
AttributeValue: central.Spec.Auth.OwnerOrgId,
},
},
Traits: &storage.Traits{
MutabilityMode: storage.Traits_ALLOW_MUTATE_FORCED,
},
Expand Down

0 comments on commit 29ba32c

Please sign in to comment.