Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e521902

Browse files
committedDec 13, 2022
feat(sts): update the api
#### sts:v1 The following keys were added: - resources.v1.methods.oauthtoken (Total Keys: 7) - schemas.GoogleIdentityStsV1ExchangeOauthTokenRequest (Total Keys: 9) - schemas.GoogleIdentityStsV1ExchangeOauthTokenResponse (Total Keys: 8)
1 parent 310a96f commit e521902

File tree

3 files changed

+121
-5
lines changed

3 files changed

+121
-5
lines changed
 

‎docs/dyn/sts_v1.v1.html

+40-2
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,12 @@ <h2>Instance Methods</h2>
8080
<p class="toc_element">
8181
<code><a href="#introspect">introspect(body=None, x__xgafv=None)</a></code></p>
8282
<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>
83+
<p class="toc_element">
84+
<code><a href="#oauthtoken">oauthtoken(body=None, x__xgafv=None)</a></code></p>
85+
<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>
8386
<p class="toc_element">
8487
<code><a href="#token">token(body=None, x__xgafv=None)</a></code></p>
85-
<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>
88+
<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>
8689
<h3>Method Details</h3>
8790
<div class="method">
8891
<code class="details" id="close">close()</code>
@@ -122,9 +125,44 @@ <h3>Method Details</h3>
122125
}</pre>
123126
</div>
124127

128+
<div class="method">
129+
<code class="details" id="oauthtoken">oauthtoken(body=None, x__xgafv=None)</code>
130+
<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.
131+
132+
Args:
133+
body: object, The request body.
134+
The object takes the form of:
135+
136+
{ # Request message for ExchangeOauthToken
137+
&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).
138+
&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;
139+
&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;
140+
&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
141+
&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
142+
&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
143+
&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
144+
}
145+
146+
x__xgafv: string, V1 error format.
147+
Allowed values
148+
1 - v1 error format
149+
2 - v2 error format
150+
151+
Returns:
152+
An object of the form:
153+
154+
{ # Response message for ExchangeOauthToken. see https://www.rfc-editor.org/rfc/rfc6749#section-5.1
155+
&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.
156+
&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.
157+
&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
158+
&quot;scope&quot;: &quot;A String&quot;, # A list of scopes associated with the returned token.
159+
&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
160+
}</pre>
161+
</div>
162+
125163
<div class="method">
126164
<code class="details" id="token">token(body=None, x__xgafv=None)</code>
127-
<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.
165+
<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.
128166

129167
Args:
130168
body: object, The request body.

‎googleapiclient/discovery_cache/documents/sts.v1.json

+80-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,23 @@
113113
"$ref": "GoogleIdentityStsV1IntrospectTokenResponse"
114114
}
115115
},
116+
"oauthtoken": {
117+
"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.",
118+
"flatPath": "v1/oauthtoken",
119+
"httpMethod": "POST",
120+
"id": "sts.oauthtoken",
121+
"parameterOrder": [],
122+
"parameters": {},
123+
"path": "v1/oauthtoken",
124+
"request": {
125+
"$ref": "GoogleIdentityStsV1ExchangeOauthTokenRequest"
126+
},
127+
"response": {
128+
"$ref": "GoogleIdentityStsV1ExchangeOauthTokenResponse"
129+
}
130+
},
116131
"token": {
117-
"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.",
132+
"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.",
118133
"flatPath": "v1/token",
119134
"httpMethod": "POST",
120135
"id": "sts.token",
@@ -131,7 +146,7 @@
131146
}
132147
}
133148
},
134-
"revision": "20221112",
149+
"revision": "20221204",
135150
"rootUrl": "https://sts.googleapis.com/",
136151
"schemas": {
137152
"GoogleIamV1Binding": {
@@ -192,6 +207,69 @@
192207
},
193208
"type": "object"
194209
},
210+
"GoogleIdentityStsV1ExchangeOauthTokenRequest": {
211+
"description": "Request message for ExchangeOauthToken",
212+
"id": "GoogleIdentityStsV1ExchangeOauthTokenRequest",
213+
"properties": {
214+
"clientId": {
215+
"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).",
216+
"type": "string"
217+
},
218+
"code": {
219+
"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'",
220+
"type": "string"
221+
},
222+
"codeVerifier": {
223+
"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'",
224+
"type": "string"
225+
},
226+
"grantType": {
227+
"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",
228+
"type": "string"
229+
},
230+
"redirectUri": {
231+
"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",
232+
"type": "string"
233+
},
234+
"refreshToken": {
235+
"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",
236+
"type": "string"
237+
},
238+
"scope": {
239+
"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",
240+
"type": "string"
241+
}
242+
},
243+
"type": "object"
244+
},
245+
"GoogleIdentityStsV1ExchangeOauthTokenResponse": {
246+
"description": "Response message for ExchangeOauthToken. see https://www.rfc-editor.org/rfc/rfc6749#section-5.1",
247+
"id": "GoogleIdentityStsV1ExchangeOauthTokenResponse",
248+
"properties": {
249+
"access_token": {
250+
"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.",
251+
"type": "string"
252+
},
253+
"expires_in": {
254+
"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.",
255+
"format": "int32",
256+
"type": "integer"
257+
},
258+
"refresh_token": {
259+
"description": "A refresh token, issued by Google, in response to the OAuth token exchange request for refresh token flow",
260+
"type": "string"
261+
},
262+
"scope": {
263+
"description": "A list of scopes associated with the returned token.",
264+
"type": "string"
265+
},
266+
"token_type": {
267+
"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",
268+
"type": "string"
269+
}
270+
},
271+
"type": "object"
272+
},
195273
"GoogleIdentityStsV1ExchangeTokenRequest": {
196274
"description": "Request message for ExchangeToken.",
197275
"id": "GoogleIdentityStsV1ExchangeTokenRequest",

‎googleapiclient/discovery_cache/documents/sts.v1beta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
}
117117
}
118118
},
119-
"revision": "20221112",
119+
"revision": "20221204",
120120
"rootUrl": "https://sts.googleapis.com/",
121121
"schemas": {
122122
"GoogleIamV1Binding": {

0 commit comments

Comments
 (0)
Please sign in to comment.