authenticate: support reloading IDP settings (#1273)

* identity: add name method to provider

* authenticate: support dynamically loading the provider
This commit is contained in:
Caleb Doxsey 2020-08-13 12:14:30 -06:00 committed by GitHub
parent 332324fa2d
commit 045c10edc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 146 additions and 69 deletions

View file

@ -124,7 +124,7 @@ func TestNew(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
_, err := New(tt.opts)
_, err := New(&config.Config{Options: tt.opts})
if (err != nil) != tt.wantErr {
t.Errorf("New() error = %v, wantErr %v", err, tt.wantErr)
return
@ -151,7 +151,7 @@ func TestIsAdmin(t *testing.T) {
t.Parallel()
opts := newTestOptions(t)
opts.Administrators = tc.admins
a, err := New(opts)
a, err := New(&config.Config{Options: opts})
a.OnConfigChange(&config.Config{Options: opts})
require.NoError(t, err)
assert.True(t, a.isAdmin(tc.user) == tc.isAdmin)