|
|
|
@ -74,18 +74,21 @@ class Credentials : public GrpcLibrary { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/// Options used to build SslCredentials.
|
|
|
|
|
///
|
|
|
|
|
/// pem_roots_cert is the buffer containing the PEM encoding of the server root
|
|
|
|
|
/// certificates. If this parameter is empty, the default roots will be used.
|
|
|
|
|
/// pem_private_key is the buffer containing the PEM encoding of the client's
|
|
|
|
|
/// private key. This parameter can be empty if the client does not have a
|
|
|
|
|
/// private key.
|
|
|
|
|
/// pem_cert_chain is the buffer containing the PEM encoding of the client's
|
|
|
|
|
/// certificate chain. This parameter can be empty if the client does not have
|
|
|
|
|
/// a certificate chain.
|
|
|
|
|
struct SslCredentialsOptions { |
|
|
|
|
/// The buffer containing the PEM encoding of the server root certificates. If
|
|
|
|
|
/// this parameter is empty, the default roots will be used. The default
|
|
|
|
|
/// roots can be overridden using the \a GRPC_DEFAULT_SSL_ROOTS_FILE_PATH
|
|
|
|
|
/// environment variable pointing to a file on the file system containing the
|
|
|
|
|
/// roots.
|
|
|
|
|
grpc::string pem_root_certs; |
|
|
|
|
|
|
|
|
|
/// The buffer containing the PEM encoding of the client's private key. This
|
|
|
|
|
/// parameter can be empty if the client does not have a private key.
|
|
|
|
|
grpc::string pem_private_key; |
|
|
|
|
|
|
|
|
|
/// The buffer containing the PEM encoding of the client's certificate chain.
|
|
|
|
|
/// This parameter can be empty if the client does not have a certificate
|
|
|
|
|
/// chain.
|
|
|
|
|
grpc::string pem_cert_chain; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -95,6 +98,11 @@ struct SslCredentialsOptions { |
|
|
|
|
// a channel. A lame channel will be created then and all rpcs will fail on it.
|
|
|
|
|
|
|
|
|
|
/// Builds credentials with reasonable defaults.
|
|
|
|
|
///
|
|
|
|
|
/// \warning Only use these credentials when connecting to a Google endpoint.
|
|
|
|
|
/// Using these credentials to connect to any other service may result in this
|
|
|
|
|
/// service being able to impersonate your client for requests to Google
|
|
|
|
|
/// services.
|
|
|
|
|
std::shared_ptr<Credentials> GoogleDefaultCredentials(); |
|
|
|
|
|
|
|
|
|
/// Builds SSL Credentials given SSL specific options
|
|
|
|
@ -102,6 +110,11 @@ std::shared_ptr<Credentials> SslCredentials( |
|
|
|
|
const SslCredentialsOptions& options); |
|
|
|
|
|
|
|
|
|
/// Builds credentials for use when running in GCE
|
|
|
|
|
///
|
|
|
|
|
/// \warning Only use these credentials when connecting to a Google endpoint.
|
|
|
|
|
/// Using these credentials to connect to any other service may result in this
|
|
|
|
|
/// service being able to impersonate your client for requests to Google
|
|
|
|
|
/// services.
|
|
|
|
|
std::shared_ptr<Credentials> ComputeEngineCredentials(); |
|
|
|
|
|
|
|
|
|
/// Builds service account credentials.
|
|
|
|
@ -110,6 +123,11 @@ std::shared_ptr<Credentials> ComputeEngineCredentials(); |
|
|
|
|
/// token_lifetime_seconds is the lifetime in seconds of each token acquired
|
|
|
|
|
/// through this service account credentials. It should be positive and should
|
|
|
|
|
/// not exceed grpc_max_auth_token_lifetime or will be cropped to this value.
|
|
|
|
|
///
|
|
|
|
|
/// \warning Only use these credentials when connecting to a Google endpoint.
|
|
|
|
|
/// Using these credentials to connect to any other service may result in this
|
|
|
|
|
/// service being able to impersonate your client for requests to Google
|
|
|
|
|
/// services.
|
|
|
|
|
std::shared_ptr<Credentials> ServiceAccountCredentials( |
|
|
|
|
const grpc::string& json_key, const grpc::string& scope, |
|
|
|
|
long token_lifetime_seconds); |
|
|
|
@ -125,16 +143,31 @@ std::shared_ptr<Credentials> ServiceAccountJWTAccessCredentials( |
|
|
|
|
/// Builds refresh token credentials.
|
|
|
|
|
/// json_refresh_token is the JSON string containing the refresh token along
|
|
|
|
|
/// with a client_id and client_secret.
|
|
|
|
|
///
|
|
|
|
|
/// \warning Only use these credentials when connecting to a Google endpoint.
|
|
|
|
|
/// Using these credentials to connect to any other service may result in this
|
|
|
|
|
/// service being able to impersonate your client for requests to Google
|
|
|
|
|
/// services.
|
|
|
|
|
std::shared_ptr<Credentials> RefreshTokenCredentials( |
|
|
|
|
const grpc::string& json_refresh_token); |
|
|
|
|
|
|
|
|
|
/// Builds access token credentials.
|
|
|
|
|
/// access_token is an oauth2 access token that was fetched using an out of band
|
|
|
|
|
/// mechanism.
|
|
|
|
|
///
|
|
|
|
|
/// \warning Only use these credentials when connecting to a Google endpoint.
|
|
|
|
|
/// Using these credentials to connect to any other service may result in this
|
|
|
|
|
/// service being able to impersonate your client for requests to Google
|
|
|
|
|
/// services.
|
|
|
|
|
std::shared_ptr<Credentials> AccessTokenCredentials( |
|
|
|
|
const grpc::string& access_token); |
|
|
|
|
|
|
|
|
|
/// Builds IAM credentials.
|
|
|
|
|
///
|
|
|
|
|
/// \warning Only use these credentials when connecting to a Google endpoint.
|
|
|
|
|
/// Using these credentials to connect to any other service may result in this
|
|
|
|
|
/// service being able to impersonate your client for requests to Google
|
|
|
|
|
/// services.
|
|
|
|
|
std::shared_ptr<Credentials> IAMCredentials( |
|
|
|
|
const grpc::string& authorization_token, |
|
|
|
|
const grpc::string& authority_selector); |
|
|
|
|