bugy / script-server

Web UI for your scripts with execution management
Other
1.52k stars 244 forks source link

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

Open momiji opened 2 days ago

momiji commented 2 days ago

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 only side effect is the identification is no more IpBasedIdentification, disabling auth by IP.