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

Integrate PDP with OED as external authorization source #474

Merged

Conversation

jonkjetiloye
Copy link
Member

@jonkjetiloye jonkjetiloye commented Sep 7, 2023

Description

  • Added new OedAuthzClient for integration with the oed-authz API
  • Added new dependency to Altinn.ApiClients.Maskinporten v9.0.0
  • Added new OedAuthzMaskinportenClientDefinition and Configuration
  • Added new OedRoleAssignmentWrapper service
  • Added new SBL bridge API client and service for getting SSN from UserId and PartyId

Other relevant changes:

  • ContextHandler will now retrieve and evaluate policy for the App or Resource and evaluate the subjects of the rules. If any 'urn:altinn:rolecode' subjects are found Altinn roles will be retrieved. If any 'urn:oed:rolecode' subjects are found OED roles will be retrieved.

Additional PR made for studio-ops repo for both new (Maskinporten client config) and changes existing to configuration values (SBL bridge API path)

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

#343
- Added new OedAuthzClient for integration with the oed-authz API
- Added new dependency to Altinn.ApiClients.Maskinporten v9.0.0
- Added new OedAuthzMaskinportenClientDefinition and Configuration
- Added new OedRoleAssignmentWrapper service
- Added new SBL bridge API client and service for getting SSN from UserId and PartyId

Other relevant changes:
- ContextHandler will now retrieve and evaluate policy for the App or Resource and evaluate the subjects of the rules. If any 'urn:altinn:rolecode' subjects are found Altinn roles will be retrieved. If any 'urn:oed:rolecode' subjects are found OED roles will be retrieved.

Additional PR made for studio-ops repo for both new (Maskinporten client config) and changes existing to configuration values (SBL bridge API path)
Jon Kjetil Øye added 2 commits September 21, 2023 15:29
…e new helper on XacmlPolicy for getting attribute values by category.

- Changed some references from OED to Digitalt Dødsbo to match new naming
- Renamed "urn:oed:rolecode" attributeId to "urn:digitaltdodsbo:rolecode"
- Logic for extracting AttributeIds and Values reimplemented as a generic helper method on the XacmlPolicy object in ABAC project
jonkjetiloye pushed a commit that referenced this pull request Sep 25, 2023
#474

As part of the integration with OED/DD (Digitalt dødsbo) as a new external role provider, an easy way to analyse and extract all attributeIds and values from a XacmlPolicy is needed.
This will be used to evaluate whether or not the policy contains a subject attribute for an OED/DD role code, and since it's populated to the XacmlPolicy object it will be cached along side policy itself.

The logic can later be reused by the resource-registry which will need same logic for analysing the policy for building rolecode register and required validation logic when publishing a resource.
jonkjetiloye added a commit that referenced this pull request Sep 29, 2023
* ABAC XacmlPolicy attribute dictionary helper method
#474

As part of the integration with OED/DD (Digitalt dødsbo) as a new external role provider, an easy way to analyse and extract all attributeIds and values from a XacmlPolicy is needed.
This will be used to evaluate whether or not the policy contains a subject attribute for an OED/DD role code, and since it's populated to the XacmlPolicy object it will be cached along side policy itself.

The logic can later be reused by the resource-registry which will need same logic for analysing the policy for building rolecode register and required validation logic when publishing a resource.

* fixed inconsistent Collection -> ICollection datatype usage

* simplified complexity of dictionary builder

* Increment ABAC package version to 0.0.6

---------

Co-authored-by: Jon Kjetil Øye <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Oct 2, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

71.0% 71.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@jonkjetiloye jonkjetiloye merged commit b0839f1 into main Oct 3, 2023
7 of 9 checks passed
@jonkjetiloye jonkjetiloye deleted the feature/343-PDP_OED_NewExternalAuthorizationSource branch October 3, 2023 06:33
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