-
Notifications
You must be signed in to change notification settings - Fork 49
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
Added group member check #21
Conversation
So if I understand it correctly, your use-case is not using Kubernetes with ClusterRole/ClusterRoleBinding but a pre-configured group-based check as an alternative implementation of Authorizer. It would be mostly ok, but I don't like that it changes the API of I think the better approach would be to keep the Then, you would supply your configured authorizer in func NewServer(sessionStore sessions.Store, clientset kubernetes.Interface) *Server {
s := &Server{
log: internallog.NewDefaultLogger(config.LogLevel, config.LogFormat),
}
s.buildRoutes()
s.sessionStore = sessionStore
if config.EnableRBAC {
s.authorizer = rbac.NewRBACAuthorizer(clientset)
} else if config.GroupsMemberOf != "" {
s.authorizer = groupmemberof.NewAuthorizer(config.GroupsMemberOf)
}
return s
} That your authorizer would be just another implementation of the common Authorizer interface which is probably what we all would like. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not change the Authorizer interface
@@ -54,6 +54,7 @@ type Config struct { | |||
GroupClaimPrefix string `long:"group-claim-prefix" env:"GROUP_CLAIM_PREFIX" default:"oidc:" description:"prefix oidc group claims with this value"` | |||
SessionKey string `long:"session-key" env:"SESSION_KEY" description:"A session key used to encrypt browser sessions"` | |||
GroupsAttributeName string `long:"groups-attribute-name" env:"GROUPS_ATTRIBUTE_NAME" default:"groups" description:"Map the correct attribute that contain the user groups"` | |||
GroupsMemberOf string `long:"groups-member-of" env:"GROUPS_MEMBER_OF" description:"List of groups that the user must be member, at least one"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GroupsMemberOf string `long:"groups-member-of" env:"GROUPS_MEMBER_OF" description:"List of groups that the user must be member, at least one"` | |
GroupsMemberOf CommaSeparatedList `long:"groups-member-of" env:"GROUPS_MEMBER_OF" description:"List of groups that the user must be member, at least one"` |
That is okay for me. |
#18