Skip to content

Commit

Permalink
feat(sts): update the api
Browse files Browse the repository at this point in the history
#### sts:v1

The following keys were added:
- resources.v1.methods.oauthtoken (Total Keys: 7)
- schemas.GoogleIdentityStsV1ExchangeOauthTokenRequest (Total Keys: 9)
- schemas.GoogleIdentityStsV1ExchangeOauthTokenResponse (Total Keys: 8)
  • Loading branch information
yoshi-automation committed Dec 13, 2022
1 parent 310a96f commit e521902
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 5 deletions.
42 changes: 40 additions & 2 deletions docs/dyn/sts_v1.v1.html
Expand Up @@ -80,9 +80,12 @@ <h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#introspect">introspect(body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Gets information about a Google OAuth 2.0 access token issued by the Google Cloud [Security Token Service API](https://cloud.google.com/iam/docs/reference/sts/rest).</p>
<p class="toc_element">
<code><a href="#oauthtoken">oauthtoken(body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Exchanges a credential that represents the resource owner's authorization for a Google-generated [OAuth 2.0 access token] (https://www.rfc-editor.org/rfc/rfc6749#section-5) or [refreshes an accesstoken] (https://www.rfc-editor.org/rfc/rfc6749#section-6) following [the OAuth 2.0 authorization framework] (https://tools.ietf.org/html/rfc8693) The credential can be one of the following: - An authorization code issued by the workforce identity federation authorization endpoint - A [refresh token](https://www.rfc-editor.org/rfc/rfc6749#section-10.4) issued by this endpoint This endpoint is only meant to be called by the Google Cloud CLI. Also note that this API only accepts the authorization code issued for workforce pools.</p>
<p class="toc_element">
<code><a href="#token">token(body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within an identity pool, or it applies a Credential Access Boundary to a Google access token. Note that workforce pools do not support Credential Access Boundary at the moment. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.</p>
<p class="firstline">Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within an identity pool, or it applies a Credential Access Boundary to a Google access token. Note that workforce pools do not support Credential Access Boundaries. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="close">close()</code>
Expand Down Expand Up @@ -122,9 +125,44 @@ <h3>Method Details</h3>
}</pre>
</div>

<div class="method">
<code class="details" id="oauthtoken">oauthtoken(body=None, x__xgafv=None)</code>
<pre>Exchanges a credential that represents the resource owner&#x27;s authorization for a Google-generated [OAuth 2.0 access token] (https://www.rfc-editor.org/rfc/rfc6749#section-5) or [refreshes an accesstoken] (https://www.rfc-editor.org/rfc/rfc6749#section-6) following [the OAuth 2.0 authorization framework] (https://tools.ietf.org/html/rfc8693) The credential can be one of the following: - An authorization code issued by the workforce identity federation authorization endpoint - A [refresh token](https://www.rfc-editor.org/rfc/rfc6749#section-10.4) issued by this endpoint This endpoint is only meant to be called by the Google Cloud CLI. Also note that this API only accepts the authorization code issued for workforce pools.

Args:
body: object, The request body.
The object takes the form of:

{ # Request message for ExchangeOauthToken
&quot;clientId&quot;: &quot;A String&quot;, # Optional. The client identifier for the OAuth 2.0 client that requested the provided token. It is REQUIRED when the [client] (https://www.rfc-editor.org/rfc/rfc6749#section-1.1) is not authenticating with the authorization server, i.e. when authentication method is [client authentication] (https://www.rfc-editor.org/rfc/rfc6749#section-3.2.1).
&quot;code&quot;: &quot;A String&quot;, # Optional. The authorization code that was previously from workforce identity federation&#x27;s `authorize` endpoint. Required if the flow is authorization code flow, i.e. if grant_type is &#x27;authorization_code&#x27;
&quot;codeVerifier&quot;: &quot;A String&quot;, # Optional. The code verifier for the PKCE request, Google Cloud CLI originally generates it before the authorization request. PKCE is used to protect authorization code from interception attacks. See https://www.rfc-editor.org/rfc/rfc7636#section-1.1 and https://www.rfc-editor.org/rfc/rfc7636#section-3. It is required when the flow is authorization code flow, i.e. if grant_type is &#x27;authorization_code&#x27;
&quot;grantType&quot;: &quot;A String&quot;, # Required. The grant types are as follows: - &#x27;authorization_code&#x27; : an authorization code flow, i.e. exchange of authorization code for the Oauth access token - &#x27;refresh_token&#x27; : a refresh token flow, i.e. obtain a new access token by providing the refresh token. See https://www.rfc-editor.org/rfc/rfc6749#section-6
&quot;redirectUri&quot;: &quot;A String&quot;, # Optional. redirect_url is required when the flow is authorization code flow i.e. if grant_type is `authorization_code` See https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3
&quot;refreshToken&quot;: &quot;A String&quot;, # Optional. The Refresh token is the credential that is used to obtain a new access token when the current access token becomes invalid or expires. Required when using refresh token flow, i.e. if `grant_type` is &#x27;refresh_token&#x27; See https://www.rfc-editor.org/rfc/rfc6749#section-1.5 and https://www.rfc-editor.org/rfc/rfc6749#section-6
&quot;scope&quot;: &quot;A String&quot;, # Optional. An optional list of scopes that are requested for the token to be returned. See https://www.rfc-editor.org/rfc/rfc6749#section-3.3 Must be a list of space-delimited, case-sensitive strings. Note: Currently, the scopes in the request are not supported
}

x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format

Returns:
An object of the form:

{ # Response message for ExchangeOauthToken. see https://www.rfc-editor.org/rfc/rfc6749#section-5.1
&quot;access_token&quot;: &quot;A String&quot;, # An OAuth 2.0 security token, issued by Google, in response to the Oauth token exchange request for the authorization code and refresh token flows. The returned [access token](https://www.rfc-editor.org/rfc/rfc6749#section-4.1.4). Tokens can vary in size, depending, in part, on the size of mapped claims, up to a maximum of 12288 bytes (12 KB). Google reserves the right to change the token size and the maximum length at any time.
&quot;expires_in&quot;: 42, # The amount of time, in seconds, between the time when the access token was issued and the time when the access token will expires.
&quot;refresh_token&quot;: &quot;A String&quot;, # A refresh token, issued by Google, in response to the OAuth token exchange request for refresh token flow
&quot;scope&quot;: &quot;A String&quot;, # A list of scopes associated with the returned token.
&quot;token_type&quot;: &quot;A String&quot;, # The type of token. Field reserved for RFC compliance. See https://www.rfc-editor.org/rfc/rfc6749#section-5.1 Note: No token_type is returned for current implementation
}</pre>
</div>

<div class="method">
<code class="details" id="token">token(body=None, x__xgafv=None)</code>
<pre>Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within an identity pool, or it applies a Credential Access Boundary to a Google access token. Note that workforce pools do not support Credential Access Boundary at the moment. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.
<pre>Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within an identity pool, or it applies a Credential Access Boundary to a Google access token. Note that workforce pools do not support Credential Access Boundaries. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.

Args:
body: object, The request body.
Expand Down
82 changes: 80 additions & 2 deletions googleapiclient/discovery_cache/documents/sts.v1.json
Expand Up @@ -113,8 +113,23 @@
"$ref": "GoogleIdentityStsV1IntrospectTokenResponse"
}
},
"oauthtoken": {
"description": "Exchanges a credential that represents the resource owner's authorization for a Google-generated [OAuth 2.0 access token] (https://www.rfc-editor.org/rfc/rfc6749#section-5) or [refreshes an accesstoken] (https://www.rfc-editor.org/rfc/rfc6749#section-6) following [the OAuth 2.0 authorization framework] (https://tools.ietf.org/html/rfc8693) The credential can be one of the following: - An authorization code issued by the workforce identity federation authorization endpoint - A [refresh token](https://www.rfc-editor.org/rfc/rfc6749#section-10.4) issued by this endpoint This endpoint is only meant to be called by the Google Cloud CLI. Also note that this API only accepts the authorization code issued for workforce pools.",
"flatPath": "v1/oauthtoken",
"httpMethod": "POST",
"id": "sts.oauthtoken",
"parameterOrder": [],
"parameters": {},
"path": "v1/oauthtoken",
"request": {
"$ref": "GoogleIdentityStsV1ExchangeOauthTokenRequest"
},
"response": {
"$ref": "GoogleIdentityStsV1ExchangeOauthTokenResponse"
}
},
"token": {
"description": "Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within an identity pool, or it applies a Credential Access Boundary to a Google access token. Note that workforce pools do not support Credential Access Boundary at the moment. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.",
"description": "Exchanges a credential for a Google OAuth 2.0 access token. The token asserts an external identity within an identity pool, or it applies a Credential Access Boundary to a Google access token. Note that workforce pools do not support Credential Access Boundaries. When you call this method, do not send the `Authorization` HTTP header in the request. This method does not require the `Authorization` header, and using the header can cause the request to fail.",
"flatPath": "v1/token",
"httpMethod": "POST",
"id": "sts.token",
Expand All @@ -131,7 +146,7 @@
}
}
},
"revision": "20221112",
"revision": "20221204",
"rootUrl": "https://sts.googleapis.com/",
"schemas": {
"GoogleIamV1Binding": {
Expand Down Expand Up @@ -192,6 +207,69 @@
},
"type": "object"
},
"GoogleIdentityStsV1ExchangeOauthTokenRequest": {
"description": "Request message for ExchangeOauthToken",
"id": "GoogleIdentityStsV1ExchangeOauthTokenRequest",
"properties": {
"clientId": {
"description": "Optional. The client identifier for the OAuth 2.0 client that requested the provided token. It is REQUIRED when the [client] (https://www.rfc-editor.org/rfc/rfc6749#section-1.1) is not authenticating with the authorization server, i.e. when authentication method is [client authentication] (https://www.rfc-editor.org/rfc/rfc6749#section-3.2.1).",
"type": "string"
},
"code": {
"description": "Optional. The authorization code that was previously from workforce identity federation's `authorize` endpoint. Required if the flow is authorization code flow, i.e. if grant_type is 'authorization_code'",
"type": "string"
},
"codeVerifier": {
"description": "Optional. The code verifier for the PKCE request, Google Cloud CLI originally generates it before the authorization request. PKCE is used to protect authorization code from interception attacks. See https://www.rfc-editor.org/rfc/rfc7636#section-1.1 and https://www.rfc-editor.org/rfc/rfc7636#section-3. It is required when the flow is authorization code flow, i.e. if grant_type is 'authorization_code'",
"type": "string"
},
"grantType": {
"description": "Required. The grant types are as follows: - 'authorization_code' : an authorization code flow, i.e. exchange of authorization code for the Oauth access token - 'refresh_token' : a refresh token flow, i.e. obtain a new access token by providing the refresh token. See https://www.rfc-editor.org/rfc/rfc6749#section-6",
"type": "string"
},
"redirectUri": {
"description": "Optional. redirect_url is required when the flow is authorization code flow i.e. if grant_type is `authorization_code` See https://www.rfc-editor.org/rfc/rfc6749#section-4.1.3",
"type": "string"
},
"refreshToken": {
"description": "Optional. The Refresh token is the credential that is used to obtain a new access token when the current access token becomes invalid or expires. Required when using refresh token flow, i.e. if `grant_type` is 'refresh_token' See https://www.rfc-editor.org/rfc/rfc6749#section-1.5 and https://www.rfc-editor.org/rfc/rfc6749#section-6",
"type": "string"
},
"scope": {
"description": "Optional. An optional list of scopes that are requested for the token to be returned. See https://www.rfc-editor.org/rfc/rfc6749#section-3.3 Must be a list of space-delimited, case-sensitive strings. Note: Currently, the scopes in the request are not supported",
"type": "string"
}
},
"type": "object"
},
"GoogleIdentityStsV1ExchangeOauthTokenResponse": {
"description": "Response message for ExchangeOauthToken. see https://www.rfc-editor.org/rfc/rfc6749#section-5.1",
"id": "GoogleIdentityStsV1ExchangeOauthTokenResponse",
"properties": {
"access_token": {
"description": "An OAuth 2.0 security token, issued by Google, in response to the Oauth token exchange request for the authorization code and refresh token flows. The returned [access token](https://www.rfc-editor.org/rfc/rfc6749#section-4.1.4). Tokens can vary in size, depending, in part, on the size of mapped claims, up to a maximum of 12288 bytes (12 KB). Google reserves the right to change the token size and the maximum length at any time.",
"type": "string"
},
"expires_in": {
"description": "The amount of time, in seconds, between the time when the access token was issued and the time when the access token will expires.",
"format": "int32",
"type": "integer"
},
"refresh_token": {
"description": "A refresh token, issued by Google, in response to the OAuth token exchange request for refresh token flow",
"type": "string"
},
"scope": {
"description": "A list of scopes associated with the returned token.",
"type": "string"
},
"token_type": {
"description": "The type of token. Field reserved for RFC compliance. See https://www.rfc-editor.org/rfc/rfc6749#section-5.1 Note: No token_type is returned for current implementation",
"type": "string"
}
},
"type": "object"
},
"GoogleIdentityStsV1ExchangeTokenRequest": {
"description": "Request message for ExchangeToken.",
"id": "GoogleIdentityStsV1ExchangeTokenRequest",
Expand Down
2 changes: 1 addition & 1 deletion googleapiclient/discovery_cache/documents/sts.v1beta.json
Expand Up @@ -116,7 +116,7 @@
}
}
},
"revision": "20221112",
"revision": "20221204",
"rootUrl": "https://sts.googleapis.com/",
"schemas": {
"GoogleIamV1Binding": {
Expand Down

0 comments on commit e521902

Please sign in to comment.