Class SecureSessionAgent
mTLS configuration is queried from the MDS MTLS Autoconfiguration endpoint. See https://google.aip.dev/auth/4115 for details.
This is an experimental utility.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Stringprivate static final String(package private) static final Stringprivate static final String(package private) static final String(package private) static final String(package private) static final Stringprivate HttpTransportFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SecureSessionAgentcreate()This method makes a network call to MDS to get theSecureSessionAgentConfigwhich contains the plaintext and mtls address to reach the S2A (Secure Session Agent).private SecureSessionAgentConfigQueries the MDS mTLS Autoconfiguration endpoint and returns theSecureSessionAgentConfig.static SecureSessionAgent.Builder
-
Field Details
-
S2A_PLAINTEXT_ADDRESS_JSON_KEY
- See Also:
-
S2A_MTLS_ADDRESS_JSON_KEY
- See Also:
-
S2A_CONFIG_ENDPOINT_POSTFIX
- See Also:
-
METADATA_FLAVOR
- See Also:
-
GOOGLE
- See Also:
-
RETRYABLE_STATUS_CODES
-
PARSE_ERROR_S2A
- See Also:
-
MDS_MTLS_ENDPOINT
-
transportFactory
-
-
Constructor Details
-
SecureSessionAgent
SecureSessionAgent(SecureSessionAgent.Builder builder)
-
-
Method Details
-
getConfig
This method makes a network call to MDS to get theSecureSessionAgentConfigwhich contains the plaintext and mtls address to reach the S2A (Secure Session Agent).- Returns:
- a SecureSessionAgentConfig.
-
create
- Returns:
- default instance of SecureSessionAgent
-
newBuilder
-
getSecureSessionAgentConfigFromMDS
Queries the MDS mTLS Autoconfiguration endpoint and returns theSecureSessionAgentConfig.Returns
SecureSessionAgentConfig. If S2A is not running, or if any error occurs when making the request to MDS / processing the response,SecureSessionAgentConfigwill be populated with empty addresses.Users are expected to try to fetch the mTLS-S2A address first (via
). If it is empty or they have some problem loading the mTLS-MDS credentials, they should then fallback to fetching the plaintext-S2A address (viainvalid reference
getMtlsS2AAddress). If the plaintext-S2A address is empty it means that an error occurred when talking to the MDS / processing the response or that S2A is not running in the environment; in either case this indicates S2A shouldn't be used.invalid reference
getPlaintextS2AAddress- Returns:
- the
SecureSessionAgentConfig.
-