Skip to content

Commit 3e64809

Browse files
andiggopherbot
authored andcommittedAug 21, 2024·
x/oauth2: add Token.ExpiresIn
Fixes golang/go#61417 Change-Id: Ib8599f39b4839bf6eed021217350195ad36d1631 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/605955 Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parent 16a9973 commit 3e64809

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎token.go

+7
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ type Token struct {
4949
// mechanisms for that TokenSource will not be used.
5050
Expiry time.Time `json:"expiry,omitempty"`
5151

52+
// ExpiresIn is the OAuth2 wire format "expires_in" field,
53+
// which specifies how many seconds later the token expires,
54+
// relative to an unknown time base approximately around "now".
55+
// It is the application's responsibility to populate
56+
// `Expiry` from `ExpiresIn` when required.
57+
ExpiresIn int64 `json:"expires_in,omitempty"`
58+
5259
// raw optionally contains extra metadata from the server
5360
// when updating a token.
5461
raw interface{}

0 commit comments

Comments
 (0)
Please sign in to comment.