Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit b252c79

Browse files
authored
Merge pull request #21 from Nike-Inc/add-delta-to-sts-auth-expiry
Add buffer to account for latency in STS auth
2 parents 1b30596 + 5457523 commit b252c79

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
)
2828

2929
// ClientHeader is the header version for all requests. It should be updated on version bumps
30-
const ClientHeader = "CerberusGoClient/1.0.1"
30+
const ClientHeader = "CerberusGoClient/1.0.2"
3131

3232
// AuthStatus is the status of a UserAuthResponse
3333
type AuthStatus string

auth/sts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (a *STSAuth) authenticate() error {
124124

125125
a.token = authResponse.Token
126126
a.headers.Set("X-Cerberus-Token", authResponse.Token)
127-
a.expiry = time.Now().Add(time.Duration(authResponse.Duration) * time.Second)
127+
a.expiry = time.Now().Add((time.Duration(authResponse.Duration) * time.Second) - expiryDelta)
128128
return nil
129129
}
130130

0 commit comments

Comments
 (0)