diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 494eab58e4784..597043dfd0915 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -15146,6 +15146,10 @@ const docTemplate = `{ "description": "AccessToken is the token that authorizes and authenticates\nthe requests.", "type": "string" }, + "expires_in": { + "description": "ExpiresIn is the OAuth2 wire format \"expires_in\" field,\nwhich specifies how many seconds later the token expires,\nrelative to an unknown time base approximately around \"now\".\nIt is the application's responsibility to populate\n` + "`" + `Expiry` + "`" + ` from ` + "`" + `ExpiresIn` + "`" + ` when required.", + "type": "integer" + }, "expiry": { "description": "Expiry is the optional expiration time of the access token.\n\nIf zero, TokenSource implementations will reuse the same\ntoken forever and RefreshToken or equivalent\nmechanisms for that TokenSource will not be used.", "type": "string" diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 54377e00b291e..1ec7773cdd497 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -13815,6 +13815,10 @@ "description": "AccessToken is the token that authorizes and authenticates\nthe requests.", "type": "string" }, + "expires_in": { + "description": "ExpiresIn is the OAuth2 wire format \"expires_in\" field,\nwhich specifies how many seconds later the token expires,\nrelative to an unknown time base approximately around \"now\".\nIt is the application's responsibility to populate\n`Expiry` from `ExpiresIn` when required.", + "type": "integer" + }, "expiry": { "description": "Expiry is the optional expiration time of the access token.\n\nIf zero, TokenSource implementations will reuse the same\ntoken forever and RefreshToken or equivalent\nmechanisms for that TokenSource will not be used.", "type": "string" diff --git a/docs/reference/api/enterprise.md b/docs/reference/api/enterprise.md index 684329814edc1..7f689036b6522 100644 --- a/docs/reference/api/enterprise.md +++ b/docs/reference/api/enterprise.md @@ -1141,6 +1141,7 @@ grant_type: authorization_code ```json { "access_token": "string", + "expires_in": 0, "expiry": "string", "refresh_token": "string", "token_type": "string" diff --git a/docs/reference/api/schemas.md b/docs/reference/api/schemas.md index 43c6f59dbdfc7..c021e18953f60 100644 --- a/docs/reference/api/schemas.md +++ b/docs/reference/api/schemas.md @@ -8944,6 +8944,7 @@ _None_ ```json { "access_token": "string", + "expires_in": 0, "expiry": "string", "refresh_token": "string", "token_type": "string" @@ -8952,13 +8953,14 @@ _None_ ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------- | -| `access_token` | string | false | | Access token is the token that authorizes and authenticates the requests. | -| `expiry` | string | false | | Expiry is the optional expiration time of the access token. | +| Name | Type | Required | Restrictions | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `access_token` | string | false | | Access token is the token that authorizes and authenticates the requests. | +| `expires_in` | integer | false | | Expires in 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. | +| `expiry` | string | false | | Expiry is the optional expiration time of the access token. | | If zero, TokenSource implementations will reuse the same token forever and RefreshToken or equivalent mechanisms for that TokenSource will not be used. | -| `refresh_token` | string | false | | Refresh token is a token that's used by the application (as opposed to the user) to refresh the access token if it expires. | -| `token_type` | string | false | | Token type is the type of token. The Type method returns either this or "Bearer", the default. | +| `refresh_token` | string | false | | Refresh token is a token that's used by the application (as opposed to the user) to refresh the access token if it expires. | +| `token_type` | string | false | | Token type is the type of token. The Type method returns either this or "Bearer", the default. | ## serpent.Annotations diff --git a/go.mod b/go.mod index 2fc9ca924f4ed..36b1671fc8d1e 100644 --- a/go.mod +++ b/go.mod @@ -178,7 +178,7 @@ require ( golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa golang.org/x/mod v0.21.0 golang.org/x/net v0.29.0 - golang.org/x/oauth2 v0.22.0 + golang.org/x/oauth2 v0.23.0 golang.org/x/sync v0.8.0 golang.org/x/sys v0.25.0 golang.org/x/term v0.24.0 diff --git a/go.sum b/go.sum index 707543deba7d2..9f65d2f3b4ae8 100644 --- a/go.sum +++ b/go.sum @@ -1098,8 +1098,8 @@ golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=