Class: OCI::Auth::Signers::InstancePrincipalsDelegationTokenSigner
- Inherits:
-
InstancePrincipalsSecurityTokenSigner
- Object
- BaseSigner
- SecurityTokenSigner
- X509FederationClientBasedSecurityTokenSigner
- InstancePrincipalsSecurityTokenSigner
- OCI::Auth::Signers::InstancePrincipalsDelegationTokenSigner
- Defined in:
- lib/oci/auth/signers/instance_principals_delegation_token_signer.rb
Overview
InstancePrincipalsDelegationTokenSigner extends the functionality of InstancePrincipalsSecurityTokenSigner. A delegation token allows the instance to assume the privileges of the user for which the token was created.
Constant Summary collapse
- HEADERS_TO_SIGN =
%i[date (request-target) host opc-obo-token].freeze
Constants inherited from InstancePrincipalsSecurityTokenSigner
OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner::GET_REGION_INFO_URL, OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner::GET_REGION_URL, OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner::INTERMEDIATE_CERTIFICATE_URL, OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner::LEAF_CERTIFICATE_PRIVATE_KEY_URL, OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner::LEAF_CERTIFICATE_URL, OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner::METADATA_URL_BASE
Constants inherited from BaseSigner
BaseSigner::BODY_HEADERS, BaseSigner::GENERIC_HEADERS, BaseSigner::SIGNATURE_VERSION, BaseSigner::SIGNING_STRATEGY_ENUM
Instance Attribute Summary
Attributes inherited from InstancePrincipalsSecurityTokenSigner
Instance Method Summary collapse
-
#initialize(delegation_token, federation_endpoint: nil, federation_client_cert_bundle: nil, signing_strategy: OCI::BaseSigner::STANDARD, body_headers_to_sign: OCI::BaseSigner::BODY_HEADERS, additional_auth_params: {}) ⇒ InstancePrincipalsDelegationTokenSigner
constructor
Creates a new InstancePrincipalsDelegationTokenSigner.
-
#sign(method, uri, headers, body, operation_signing_strategy = :standard) ⇒ Object
Add opc-obo-token to request header.
Methods inherited from X509FederationClientBasedSecurityTokenSigner
Constructor Details
#initialize(delegation_token, federation_endpoint: nil, federation_client_cert_bundle: nil, signing_strategy: OCI::BaseSigner::STANDARD, body_headers_to_sign: OCI::BaseSigner::BODY_HEADERS, additional_auth_params: {}) ⇒ InstancePrincipalsDelegationTokenSigner
Creates a new InstancePrincipalsDelegationTokenSigner
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/oci/auth/signers/instance_principals_delegation_token_signer.rb', line 37 def initialize(delegation_token, federation_endpoint: nil, federation_client_cert_bundle: nil, signing_strategy: OCI::BaseSigner::STANDARD, body_headers_to_sign: OCI::BaseSigner::BODY_HEADERS, additional_auth_params: {}) raise 'Delegation Token not exist' if delegation_token.nil? @delegation_token = delegation_token super(federation_endpoint: federation_endpoint, federation_client_cert_bundle: federation_client_cert_bundle, signing_strategy: signing_strategy, headers_to_sign_in_all_requests: HEADERS_TO_SIGN, body_headers_to_sign: body_headers_to_sign, additional_auth_params: additional_auth_params) end |
Instance Method Details
#sign(method, uri, headers, body, operation_signing_strategy = :standard) ⇒ Object
Add opc-obo-token to request header
55 56 57 58 |
# File 'lib/oci/auth/signers/instance_principals_delegation_token_signer.rb', line 55 def sign(method, uri, headers, body, operation_signing_strategy = :standard) headers[:'opc-obo-token'] = @delegation_token super(method, uri, headers, body, operation_signing_strategy) end |