Skip to content
Snippets Groups Projects
Commit 8d3f4507 authored by ale's avatar ale
Browse files

Always set the keystore shard in maybeUnlockKeystore()

parent 0a0ca7d5
No related branches found
No related tags found
No related merge requests found
...@@ -193,7 +193,6 @@ func (h *Server) maybeUnlockKeystore(ctx context.Context, username, password str ...@@ -193,7 +193,6 @@ func (h *Server) maybeUnlockKeystore(ctx context.Context, username, password str
return false, nil return false, nil
} }
var shard string
if len(h.keystoreGroups) > 0 { if len(h.keystoreGroups) > 0 {
if userinfo == nil { if userinfo == nil {
return false, nil return false, nil
...@@ -201,8 +200,13 @@ func (h *Server) maybeUnlockKeystore(ctx context.Context, username, password str ...@@ -201,8 +200,13 @@ func (h *Server) maybeUnlockKeystore(ctx context.Context, username, password str
if !inAnyGroups(userinfo.Groups, h.keystoreGroups) { if !inAnyGroups(userinfo.Groups, h.keystoreGroups) {
return false, nil return false, nil
} }
}
var shard string
if userinfo != nil {
shard = userinfo.Shard shard = userinfo.Shard
} }
// Add a 'grace time' of 30 minutes to the key ttl. // Add a 'grace time' of 30 minutes to the key ttl.
ttl := h.authSessionLifetime + 1800 ttl := h.authSessionLifetime + 1800
return true, h.keystore.Open(ctx, shard, username, password, ttl) return true, h.keystore.Open(ctx, shard, username, password, ttl)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment