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

Support catalogue restriction through nested claims #497

Open
nicolst opened this issue Sep 17, 2024 · 0 comments
Open

Support catalogue restriction through nested claims #497

nicolst opened this issue Sep 17, 2024 · 0 comments

Comments

@nicolst
Copy link
Contributor

nicolst commented Sep 17, 2024

Currently access to service catalogues can only be restricted based on root claims in the JWT. In some cases it would be useful to restrict access based on some nested property in the token.

E.g. we have a custom claim:

{
  "custom": {
    "custom2": {
      "someList": [ "a", "b" ]
    }
  }
}

And would like to restrict access to a catalogue based on the presence of an item in custom.someList (this could be a list of access groups a user is in, for example).

Of course, periods are valid characters in a map key, so some thought will have to be given to how this is handled. In addition, arbitrary amounts of nesting should be supported, and it should not break existing configurations of Onyxia.. Perhaps something similar to this could work:

"restrictions": [
  {
    "userAttribute": {
      "subAttribute": ["custom", "custom2"]
      "key": "someList",
      "matches": "b"
    }
  }
]

where subAttribute is an ordered list of attributes to traverse through in the JWT. Another way could be to use some nested object,

"restrictions": [
  {
    "nestedUserAttribute": {
      "key": "custom",
      "nestedUserAttribute": {
        "key": "custom2",
        "userAttribute": {
          "key": "someList",
          "matches": "b"
        }
      }
    }
  }
]

These are of course just suggestions off the top of my head, there are probably much better ways of solving it 😀

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

No branches or pull requests

1 participant