Skip to content

Commit

Permalink
x/oauth2: add Token.ExpiresIn
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
andig authored and gopherbot committed Aug 21, 2024
1 parent 16a9973 commit 3e64809
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions token.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ type Token struct {
// mechanisms for that TokenSource will not be used.
Expiry time.Time `json:"expiry,omitempty"`

// ExpiresIn is the OAuth2 wire format "expires_in" field,
// which specifies how many seconds later the token expires,
// relative to an unknown time base approximately around "now".
// It is the application's responsibility to populate
// `Expiry` from `ExpiresIn` when required.
ExpiresIn int64 `json:"expires_in,omitempty"`

// raw optionally contains extra metadata from the server
// when updating a token.
raw interface{}
Expand Down

0 comments on commit 3e64809

Please sign in to comment.