authorize: remove admin (#1833)

* authorize: remove admin

* regen rego

* add note to upgrading
This commit is contained in:
Caleb Doxsey 2021-02-01 15:22:02 -07:00 committed by GitHub
parent a5a3ab55fc
commit b7f0242090
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 204 additions and 381 deletions

View file

@ -26,8 +26,6 @@ import (
type authenticateState struct {
redirectURL *url.URL
// administrators keeps track of administrator users.
administrators map[string]struct{}
// sharedEncoder is the encoder to use to serialize data to be consumed
// by other services
sharedEncoder encoding.MarshalUnmarshaler
@ -55,8 +53,7 @@ type authenticateState struct {
func newAuthenticateState() *authenticateState {
return &authenticateState{
administrators: map[string]struct{}{},
jwk: new(jose.JSONWebKeySet),
jwk: new(jose.JSONWebKeySet),
}
}
@ -71,11 +68,6 @@ func newAuthenticateStateFromConfig(cfg *config.Config) (*authenticateState, err
state.redirectURL, _ = urlutil.DeepCopy(cfg.Options.AuthenticateURL)
state.redirectURL.Path = cfg.Options.AuthenticateCallbackPath
state.administrators = make(map[string]struct{}, len(cfg.Options.Administrators))
for _, admin := range cfg.Options.Administrators {
state.administrators[admin] = struct{}{}
}
// shared state encoder setup
state.sharedEncoder, err = jws.NewHS256Signer([]byte(cfg.Options.SharedKey))
if err != nil {