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

FEATURE: add groups_header_name to also manage groups in header mode #753

Open
momiji opened this issue Jul 2, 2024 · 0 comments
Open

Comments

@momiji
Copy link

momiji commented Jul 2, 2024

The idea is to have a groups_header_name with space separated list of groups.

Proposal

I've made a fork for version 1.18.0 I'm currently using.
https://github.com/bugy/script-server/compare/1.18.0...momiji:script-server:1.18.0-with-groups?expand=1

If you feel this is interesting, I can provide the same for master branch so it can be added.
The only remaining thing do if so would be to have a way to specify a separator, or simply split on space and , and ;... and trim all results. This might work for near 100% of usage.

How it is done

It is needed to get groups from request headers, which is only available to the authenticator, and then cache them like it is done with the auth_ldap.

The way it is done is by:

  • the authorizer is giving groups, so we need to have groups_provider updated
  • groups_provider is using the authenticator for groups, so we need to have an authenticator
  • the authenticator is set in TornadoAuth, and the way it gets the username is not customizable, so I added a way to override it with a new base method get_current_user()
  • the overrided get_current_user() is caching the groups for the authorizer

The only side effect is the identification is no more IpBasedIdentification, disabling auth by IP.

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