-
Notifications
You must be signed in to change notification settings - Fork 95
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
feat: load and parse account management resources #1235
Conversation
561dde1
to
8ac61c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO validation should be improved.
@UnseenWizzard I've improved the PR, pls take another look |
// Load loads account management resources from YAML configuration files | ||
// located within the specified root directory path. It parses the YAML files, extracts policies, | ||
// groups, and users data, and organizes them into a AMResources struct, which is then returned. | ||
func Load(fs afero.Fs, rootPath string) (*AMResources, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd mark this as excluded from the gocognit check.
I've quickly tried if it would actually become nicer to read if we split out the parts into loadPolicies
, loadGroups
, .. methods. But with error handling still needed there's not much of a difference at all, actually it becomes messier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes the "complexity" is absolutely manageable
Signed-off-by: Bernd Warmuth <[email protected]>
…from disk Signed-off-by: Bernd Warmuth <[email protected]>
…aded AM resources Signed-off-by: Bernd Warmuth <[email protected]>
Signed-off-by: Bernd Warmuth <[email protected]>
Signed-off-by: Bernd Warmuth <[email protected]>
i decided that this is no error but just gives back empty resources. Signed-off-by: Bernd Warmuth <[email protected]>
095e81e
to
97ba2ad
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
What this PR does / Why we need it:
This PR introduces the capability to read account management resources from files living inside of monaco project folders. The PR contains a function responsible for loading raw resources into a first in-memory representation as well as a function validating the references between users groups and policies.
Special notes for your reviewer:
Does this PR introduce a user-facing change?