mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
[backport 3.4]: server/auth: enable tokenProvider if recoved store enables auth
this is a manual backport of #13172
This commit is contained in:
parent
c50b7260cc
commit
23e79dbf19
@ -159,6 +159,11 @@ func (t *tokenSimple) invalidateUser(username string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *tokenSimple) enable() {
|
func (t *tokenSimple) enable() {
|
||||||
|
t.simpleTokensMu.Lock()
|
||||||
|
defer t.simpleTokensMu.Unlock()
|
||||||
|
if t.simpleTokenKeeper != nil { // already enabled
|
||||||
|
return
|
||||||
|
}
|
||||||
if t.simpleTokenTTL <= 0 {
|
if t.simpleTokenTTL <= 0 {
|
||||||
t.simpleTokenTTL = simpleTokenTTLDefault
|
t.simpleTokenTTL = simpleTokenTTLDefault
|
||||||
}
|
}
|
||||||
|
@ -400,6 +400,9 @@ func (as *authStore) Recover(be backend.Backend) {
|
|||||||
|
|
||||||
as.enabledMu.Lock()
|
as.enabledMu.Lock()
|
||||||
as.enabled = enabled
|
as.enabled = enabled
|
||||||
|
if enabled {
|
||||||
|
as.tokenProvider.enable()
|
||||||
|
}
|
||||||
as.enabledMu.Unlock()
|
as.enabledMu.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user