4747import com .google .errorprone .annotations .CanIgnoreReturnValue ;
4848import java .io .IOException ;
4949
50+
5051public final class ClientSideCredentialAccessBoundaryFactory {
5152 private final GoogleCredentials sourceCredential ;
5253 private final transient HttpTransportFactory transportFactory ;
5354 private final String tokenExchangeEndpoint ;
54- private String acceessBoundarySessionKey ;
55- private AccessToken intermediaryAccessToken ;
55+ private String accessBoundarySessionKey ;
56+ private AccessToken intermediateAccessToken ;
5657
5758 private ClientSideCredentialAccessBoundaryFactory (Builder builder ) {
5859 this .transportFactory = builder .transportFactory ;
@@ -76,6 +77,7 @@ private void fetchCredentials() throws IOException {
7677 StsTokenExchangeRequest .newBuilder (
7778 sourceAccessToken .getTokenValue (), OAuth2Utils .TOKEN_TYPE_ACCESS_TOKEN )
7879 .setRequestTokenType (OAuth2Utils .TOKEN_TYPE_ACCESS_BOUNDARY_INTERMEDIARY_TOKEN )
80+
7981 .build ();
8082
8183 StsRequestHandler handler =
@@ -84,16 +86,16 @@ private void fetchCredentials() throws IOException {
8486 .build ();
8587
8688 StsTokenExchangeResponse response = handler .exchangeToken ();
87- this .acceessBoundarySessionKey = response .getAccessBoundarySessionKey ();
88- this .intermediaryAccessToken = response .getAccessToken ();
89+ this .accessBoundarySessionKey = response .getAccessBoundarySessionKey ();
90+ this .intermediateAccessToken = response .getAccessToken ();
8991
9092 // The STS endpoint will only return the expiration time for the intermediary token
9193 // if the original access token represents a service account.
9294 // The intermediary token's expiration time will always match the source credential expiration.
9395 // When no expires_in is returned, we can copy the source credential's expiration time.
9496 if (response .getAccessToken ().getExpirationTime () == null ) {
9597 if (sourceAccessToken .getExpirationTime () != null ) {
96- this .intermediaryAccessToken =
98+ this .intermediateAccessToken =
9799 new AccessToken (
98100 response .getAccessToken ().getTokenValue (), sourceAccessToken .getExpirationTime ());
99101 }
0 commit comments