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

DaplaUserInfoMapper replace TeamsMapper #17

Merged
merged 4 commits into from
Jun 14, 2024

Conversation

kschulst
Copy link
Contributor

@kschulst kschulst commented Jun 11, 2024

Support for retrieving user, group and team info from Dapla Team API. Replaces the TeamsMapper.

Produces JSON claims, such as:

{
    "teams" : [ {
      "uniform_name" : "dapla-felles",
      "section_code" : "724",
      "autonomy_level" : "SELF_MANAGED",
      "source_data_classification" : [ ],
      "groups" : [ ]
    }, {
      "uniform_name" : "mus-ost",
      "section_code" : "399",
      "autonomy_level" : "SELF_MANAGED",
      "source_data_classification" : [ "PII", "CONSENT_BASED" ],
      "groups" : [ "developers" ]
    }, {
      "uniform_name" : "play-foeniks-a",
      "section_code" : "724",
      "autonomy_level" : "SELF_MANAGED",
      "source_data_classification" : [ ],
      "groups" : [ "developers", "data-admins", "consumers", "editors" ]
    } ],
    "section_code" : "399"
}

or (flat/non-nested)

{
  "teams" : [ "dapla-felles", "mus-ost", "play-foeniks-a" ],
  "groups" : [ "mus-ost-developers", "play-foeniks-a-developers", "play-foeniks-a-data-admins", "play-foeniks-a-consumers", "play-foeniks-a-editors" ]
}

Team and user properties to include are configurable. In addition, groups can be filtered by matching against a configurable regex, e.g. if you only want to include certain dapla groups such as developers. In that case, it is also configurable whether you want to only have teams with relevant groups or if all teams should be included.

Screenshot from the Keycloak Admin GUI:
image

This PR also adds a localstack setup that uses docker-compose to provide a local Keycloak instance that can be used for local development. It is very handy, essential even, to test the protocol mapper against a real Keycloak server.

@github-actions github-actions bot added the enhancement New feature or request label Jun 11, 2024
@kschulst kschulst requested review from johnksv, a team and nicolst June 13, 2024 22:05
@kschulst kschulst merged commit 5fdc931 into main Jun 14, 2024
2 checks passed
@kschulst kschulst deleted the feat/fetch-dapla-user-info-from-team-api branch June 14, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant