authenticate: support hot reloaded config (#984)

By implementinng OptionsUpdater interface.

Fixes #982
This commit is contained in:
Cuong Manh Le 2020-06-24 00:18:20 +07:00 committed by GitHub
parent eaa0c980d2
commit 17ba595ced
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 9 deletions

View file

@ -156,6 +156,7 @@ func TestIsAdmin(t *testing.T) {
opts := newTestOptions(t)
opts.Administrators = tc.admins
a, err := New(*opts)
assert.NoError(t, a.UpdateOptions(*opts))
require.NoError(t, err)
assert.True(t, a.isAdmin(tc.user) == tc.isAdmin)
})