-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't call LeaseExtend on login renewal paths when period is provided #3803
Conversation
if err != nil { | ||
return nil, err | ||
// If a period is provided, set that as part of resp.Auth.Period and return a | ||
// response immediately. Let expiration manager handle renewal from thereon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/thereon/there on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but please add tests
vault/expiration_test.go
Outdated
TTL: 5 * time.Second, | ||
Renewable: true, | ||
}, | ||
// Period: 5 * time.Second, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused what this test is supposed to be doing -- it has period in the name but this is commented out.
vault/expiration_test.go
Outdated
|
||
// Wait 3 seconds | ||
// time.Sleep(3 * time.Second) | ||
out, err := exp.RenewToken(&logical.Request{}, "auth/foo/login", root.ID, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this supposed to be doing?
vault/expiration_test.go
Outdated
fmt.Println(out.Auth) | ||
|
||
// time.Sleep(3 * time.Second) | ||
out, err = exp.RenewToken(&logical.Request{}, "auth/foo/login", root.ID, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. There's no sleep, I'm not sure what having this twice in a row is supposed to be doing.
vault/expiration_test.go
Outdated
t.Fatalf("err: %v", err) | ||
} | ||
|
||
fmt.Println(out.Auth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally we don't print out values on success
No description provided.