Skip to content

Commit 65e0512

Browse files
yoshi-automationbusunkim96
authored andcommitted
Remove generate_identity_binding_access_token (via synth). (#8486)
1 parent a7f7e42 commit 65e0512

File tree

10 files changed

+8
-522
lines changed

10 files changed

+8
-522
lines changed

iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py

Lines changed: 0 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -557,128 +557,3 @@ def sign_jwt(
557557
return self._inner_api_calls["sign_jwt"](
558558
request, retry=retry, timeout=timeout, metadata=metadata
559559
)
560-
561-
def generate_identity_binding_access_token(
562-
self,
563-
name,
564-
scope,
565-
jwt,
566-
retry=google.api_core.gapic_v1.method.DEFAULT,
567-
timeout=google.api_core.gapic_v1.method.DEFAULT,
568-
metadata=None,
569-
):
570-
"""
571-
Exchange a JWT signed by third party identity provider to an OAuth 2.0
572-
access token
573-
574-
Example:
575-
>>> from google.cloud import iam_credentials_v1
576-
>>>
577-
>>> client = iam_credentials_v1.IAMCredentialsClient()
578-
>>>
579-
>>> name = client.service_account_path('[PROJECT]', '[SERVICE_ACCOUNT]')
580-
>>>
581-
>>> # TODO: Initialize `scope`:
582-
>>> scope = []
583-
>>>
584-
>>> # TODO: Initialize `jwt`:
585-
>>> jwt = ''
586-
>>>
587-
>>> response = client.generate_identity_binding_access_token(name, scope, jwt)
588-
589-
Args:
590-
name (str): The resource name of the service account for which the credentials are
591-
requested, in the following format:
592-
``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``.
593-
scope (list[str]): Code to identify the scopes to be included in the OAuth 2.0 access token.
594-
See https://developers.google.com/identity/protocols/googlescopes for more
595-
information.
596-
At least one value required.
597-
jwt (str): Required. Input token. Must be in JWT format according to RFC7523
598-
(https://tools.ietf.org/html/rfc7523) and must have 'kid' field in the
599-
header. Supported signing algorithms: RS256 (RS512, ES256, ES512 coming
600-
soon). Mandatory payload fields (along the lines of RFC 7523, section
601-
3):
602-
603-
- iss: issuer of the token. Must provide a discovery document at
604-
$iss/.well-known/openid-configuration . The document needs to be
605-
formatted according to section 4.2 of the OpenID Connect Discovery
606-
1.0 specification.
607-
- iat: Issue time in seconds since epoch. Must be in the past.
608-
- exp: Expiration time in seconds since epoch. Must be less than 48
609-
hours after iat. We recommend to create tokens that last shorter than
610-
6 hours to improve security unless business reasons mandate longer
611-
expiration times. Shorter token lifetimes are generally more secure
612-
since tokens that have been exfiltrated by attackers can be used for
613-
a shorter time. you can configure the maximum lifetime of the
614-
incoming token in the configuration of the mapper. The resulting
615-
Google token will expire within an hour or at "exp", whichever is
616-
earlier.
617-
- sub: JWT subject, identity asserted in the JWT.
618-
- aud: Configured in the mapper policy. By default the service account
619-
email.
620-
621-
Claims from the incoming token can be transferred into the output token
622-
accoding to the mapper configuration. The outgoing claim size is
623-
limited. Outgoing claims size must be less than 4kB serialized as JSON
624-
without whitespace.
625-
626-
Example header: { "alg": "RS256", "kid":
627-
"92a4265e14ab04d4d228a48d10d4ca31610936f8" } Example payload: { "iss":
628-
"https://accounts.google.com", "iat": 1517963104, "exp": 1517966704,
629-
"aud": "https://iamcredentials.googleapis.com/", "sub":
630-
"113475438248934895348", "my\_claims": { "additional\_claim": "value" }
631-
}
632-
retry (Optional[google.api_core.retry.Retry]): A retry object used
633-
to retry requests. If ``None`` is specified, requests will not
634-
be retried.
635-
timeout (Optional[float]): The amount of time, in seconds, to wait
636-
for the request to complete. Note that if ``retry`` is
637-
specified, the timeout applies to each individual attempt.
638-
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
639-
that is provided to the method.
640-
641-
Returns:
642-
A :class:`~google.cloud.iam_credentials_v1.types.GenerateIdentityBindingAccessTokenResponse` instance.
643-
644-
Raises:
645-
google.api_core.exceptions.GoogleAPICallError: If the request
646-
failed for any reason.
647-
google.api_core.exceptions.RetryError: If the request failed due
648-
to a retryable error and retry attempts failed.
649-
ValueError: If the parameters are invalid.
650-
"""
651-
# Wrap the transport method to add retry and timeout logic.
652-
if "generate_identity_binding_access_token" not in self._inner_api_calls:
653-
self._inner_api_calls[
654-
"generate_identity_binding_access_token"
655-
] = google.api_core.gapic_v1.method.wrap_method(
656-
self.transport.generate_identity_binding_access_token,
657-
default_retry=self._method_configs[
658-
"GenerateIdentityBindingAccessToken"
659-
].retry,
660-
default_timeout=self._method_configs[
661-
"GenerateIdentityBindingAccessToken"
662-
].timeout,
663-
client_info=self._client_info,
664-
)
665-
666-
request = common_pb2.GenerateIdentityBindingAccessTokenRequest(
667-
name=name, scope=scope, jwt=jwt
668-
)
669-
if metadata is None:
670-
metadata = []
671-
metadata = list(metadata)
672-
try:
673-
routing_header = [("name", name)]
674-
except AttributeError:
675-
pass
676-
else:
677-
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
678-
routing_header
679-
)
680-
metadata.append(routing_metadata)
681-
682-
return self._inner_api_calls["generate_identity_binding_access_token"](
683-
request, retry=retry, timeout=timeout, metadata=metadata
684-
)

iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client_config.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@
3737
"retry_codes_name": "idempotent",
3838
"retry_params_name": "default",
3939
},
40-
"GenerateIdentityBindingAccessToken": {
41-
"timeout_millis": 60000,
42-
"retry_codes_name": "idempotent",
43-
"retry_params_name": "default",
44-
},
4540
},
4641
}
4742
}

iam/google/cloud/iam_credentials_v1/gapic/transports/iam_credentials_grpc_transport.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,3 @@ def sign_jwt(self):
154154
deserialized response object.
155155
"""
156156
return self._stubs["iam_credentials_stub"].SignJwt
157-
158-
@property
159-
def generate_identity_binding_access_token(self):
160-
"""Return the gRPC stub for :meth:`IAMCredentialsClient.generate_identity_binding_access_token`.
161-
162-
Exchange a JWT signed by third party identity provider to an OAuth 2.0
163-
access token
164-
165-
Returns:
166-
Callable: A callable which accepts the appropriate
167-
deserialized request object and returns a
168-
deserialized response object.
169-
"""
170-
return self._stubs["iam_credentials_stub"].GenerateIdentityBindingAccessToken

iam/google/cloud/iam_credentials_v1/proto/common.proto

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -152,72 +152,3 @@ message GenerateIdTokenResponse {
152152
// The OpenId Connect ID token.
153153
string token = 1;
154154
}
155-
156-
message GenerateIdentityBindingAccessTokenRequest {
157-
// The resource name of the service account for which the credentials
158-
// are requested, in the following format:
159-
// `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
160-
string name = 1;
161-
162-
// Code to identify the scopes to be included in the OAuth 2.0 access token.
163-
// See https://developers.google.com/identity/protocols/googlescopes for more
164-
// information.
165-
// At least one value required.
166-
repeated string scope = 2;
167-
168-
// Required. Input token.
169-
// Must be in JWT format according to
170-
// RFC7523 (https://tools.ietf.org/html/rfc7523)
171-
// and must have 'kid' field in the header.
172-
// Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon).
173-
// Mandatory payload fields (along the lines of RFC 7523, section 3):
174-
// - iss: issuer of the token. Must provide a discovery document at
175-
// $iss/.well-known/openid-configuration . The document needs to be
176-
// formatted according to section 4.2 of the OpenID Connect Discovery
177-
// 1.0 specification.
178-
// - iat: Issue time in seconds since epoch. Must be in the past.
179-
// - exp: Expiration time in seconds since epoch. Must be less than 48 hours
180-
// after iat. We recommend to create tokens that last shorter than 6
181-
// hours to improve security unless business reasons mandate longer
182-
// expiration times. Shorter token lifetimes are generally more secure
183-
// since tokens that have been exfiltrated by attackers can be used for
184-
// a shorter time. you can configure the maximum lifetime of the
185-
// incoming token in the configuration of the mapper.
186-
// The resulting Google token will expire within an hour or at "exp",
187-
// whichever is earlier.
188-
// - sub: JWT subject, identity asserted in the JWT.
189-
// - aud: Configured in the mapper policy. By default the service account
190-
// email.
191-
//
192-
// Claims from the incoming token can be transferred into the output token
193-
// accoding to the mapper configuration. The outgoing claim size is limited.
194-
// Outgoing claims size must be less than 4kB serialized as JSON without
195-
// whitespace.
196-
//
197-
// Example header:
198-
// {
199-
// "alg": "RS256",
200-
// "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8"
201-
// }
202-
// Example payload:
203-
// {
204-
// "iss": "https://accounts.google.com",
205-
// "iat": 1517963104,
206-
// "exp": 1517966704,
207-
// "aud": "https://iamcredentials.googleapis.com/",
208-
// "sub": "113475438248934895348",
209-
// "my_claims": {
210-
// "additional_claim": "value"
211-
// }
212-
// }
213-
string jwt = 3;
214-
}
215-
216-
message GenerateIdentityBindingAccessTokenResponse {
217-
// The OAuth 2.0 access token.
218-
string access_token = 1;
219-
220-
// Token expiration time.
221-
// The expiration time is always set.
222-
google.protobuf.Timestamp expire_time = 2;
223-
}

0 commit comments

Comments
 (0)