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

roles: refactor to support Resources #67

Merged
merged 2 commits into from
Oct 31, 2024
Merged

roles: refactor to support Resources #67

merged 2 commits into from
Oct 31, 2024

Conversation

jac
Copy link
Member

@jac jac commented Oct 30, 2024

To support roles at the resource level this refactors the sdk internals with a new roleInfo type. From which the data can be transformed by helper methods to be used by SAMS + integrations.

Previously roles were registered + exposed from the AllowedRoles function.
Registration has been split into an internal variable registeredRoles from which public functions such as List, ByService, ByResourceType, etc. derive different views of the data.

Test plan

CI

@jac jac requested a review from a team as a code owner October 30, 2024 16:59
@jac jac merged commit 8fc689f into main Oct 31, 2024
2 checks passed
@jac jac deleted the jac/core-393 branch October 31, 2024 15:18
return ParsedRole{}, false
}
// Display returns the display name of the resource type.
func (r ResourceType) Display() string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think the conventional name of this method is DisplayName 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants