feat(api-key): add custom_grants support for multi-NRN grants#276
Merged
feat(api-key): add custom_grants support for multi-NRN grants#276
Conversation
e9a119e to
a80ef22
Compare
Add custom_grants variable for explicit NRN per grant entry. Make nrn optional for custom type when using custom_grants. Add preconditions: nrn required for predefined types, nrn must not be set when custom_grants is used, custom_role_slugs and custom_grants are mutually exclusive, specification_slug required for scope/service notification types.
a80ef22 to
64ab255
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
api_keymodule previously only supported a single NRN for all grants, which didn't reflect how nullplatform actually works — a single API key can have permissions across multiple accounts or resources at different NRN levels.This PR introduces
custom_grantsto support that pattern, while keeping the existingcustom_role_slugs+nrnflow intact for the simple case.custom_grantsvariable: explicit list of{ nrn, role_slug }pairsnrnoptional whencustom_grantsis used (NRN is defined per grant)agent,scope_notification,service_notification) still requirenrnUsage
Simple case (unchanged):
Multi-NRN grants:
Validations added
type = "custom"withoutcustom_namecustom_name is requiredtype = "custom"without roles or grantscustom_role_slugs or custom_grants must have at least 1 entrynrnnrn is required for predefined typescustom_grants+nrnset togetherwhen using custom_grants, do not set nrnTest plan
customwithcustom_role_slugs+nrn— no changes, plan shows no diffcustom_grantswithoutnrn— API key created with grants per NRN