Class CloudShellCredentials
java.lang.Object
com.google.auth.Credentials
com.google.auth.oauth2.OAuth2Credentials
com.google.auth.oauth2.GoogleCredentials
com.google.auth.oauth2.CloudShellCredentials
- All Implemented Interfaces:
QuotaProjectIdProvider, Serializable
OAuth2 credentials representing the built-in service account for Google Cloud Shell.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class OAuth2Credentials
OAuth2Credentials.AsyncRefreshResult, OAuth2Credentials.CacheState, OAuth2Credentials.CredentialsChangedListener, OAuth2Credentials.FutureCallbackToMetadataCallbackAdapter, OAuth2Credentials.OAuthValue, OAuth2Credentials.RefreshTask, OAuth2Credentials.RefreshTaskListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final intprotected static final StringThe Cloud Shell back authorization channel uses serialized Javascript Protobuffers, preceded by the message length and a new line character.protected static final byte[]private static final intprivate static final longFields inherited from class GoogleCredentials
GDCH_SERVICE_ACCOUNT_FILE_TYPE, QUOTA_PROJECT_ID_HEADER_KEY, quotaProjectId, SERVICE_ACCOUNT_FILE_TYPE, USER_FILE_TYPEFields inherited from class OAuth2Credentials
clock, DEFAULT_EXPIRATION_MARGIN, DEFAULT_REFRESH_MARGIN, lock, refreshTaskFields inherited from class Credentials
GOOGLE_DEFAULT_UNIVERSE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate -
Method Summary
Modifier and TypeMethodDescriptionstatic CloudShellCredentialscreate(int authPort) booleanprotected intinthashCode()Method to refresh the access token according to the specific type of credentials.toString()Methods inherited from class GoogleCredentials
addQuotaProjectIdToRequestMetadata, create, create, createDelegated, createScoped, createScoped, createScoped, createScopedRequired, createWithCustomRetryStrategy, createWithQuotaProject, fromStream, fromStream, getAdditionalHeaders, getApplicationDefault, getApplicationDefault, getQuotaProjectId, getUniverseDomain, isDefaultUniverseDomain, isExplicitUniverseDomain, toStringHelperMethods inherited from class OAuth2Credentials
addChangeListener, getAccessToken, getAuthenticationType, getExpirationMargin, getFromServiceLoader, getRefreshMargin, getRequestMetadata, getRequestMetadata, getRequestMetadataInternal, hasRequestMetadata, hasRequestMetadataOnly, newInstance, refresh, refreshIfExpired, removeChangeListenerMethods inherited from class Credentials
blockingGetToCallback, getMetricsCredentialType, getRequestMetadata
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
ACCESS_TOKEN_INDEX
private static final int ACCESS_TOKEN_INDEX- See Also:
-
READ_TIMEOUT_MS
private static final int READ_TIMEOUT_MS- See Also:
-
GET_AUTH_TOKEN_REQUEST
The Cloud Shell back authorization channel uses serialized Javascript Protobuffers, preceded by the message length and a new line character. However, the request message has no content, so a token request consists of an empty JsPb, and its 2 character length prefix.- See Also:
-
GET_AUTH_TOKEN_REQUEST_BYTES
protected static final byte[] GET_AUTH_TOKEN_REQUEST_BYTES -
authPort
private final int authPort
-
-
Constructor Details
-
CloudShellCredentials
-
-
Method Details
-
create
-
getAuthPort
protected int getAuthPort() -
refreshAccessToken
Description copied from class:OAuth2CredentialsMethod to refresh the access token according to the specific type of credentials.Throws IllegalStateException if not overridden since direct use of OAuth2Credentials is only for temporary or non-refreshing access tokens.
- Overrides:
refreshAccessTokenin classOAuth2Credentials- Returns:
- never
- Throws:
IOException
-
hashCode
public int hashCode()- Overrides:
hashCodein classGoogleCredentials
-
toString
- Overrides:
toStringin classGoogleCredentials
-
equals
- Overrides:
equalsin classGoogleCredentials
-
toBuilder
- Overrides:
toBuilderin classGoogleCredentials
-
newBuilder
-