Method: Google::Auth::ServiceAccountJwtHeaderCredentials#duplicate

Defined in:
lib/googleauth/service_account_jwt_header.rb

#duplicate(options = {}) ⇒ Object

Creates a duplicate of these credentials

Parameters:

  • options (Hash) (defaults to: {})

    Overrides for the credentials parameters. The following keys are recognized

    • private key the private key in string form
    • issuer the SA issuer
    • scope the scope(s) to access
    • project_id the project id to use during the authentication
    • quota_project_id the quota project id to use
    • universe_domain the universe domain of the credentials

89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/googleauth/service_account_jwt_header.rb', line 89

def duplicate options = {}
  options = deep_hash_normalize options

  options = {
    private_key: @private_key,
    issuer: @issuer,
    scope: @scope,
    project_id: project_id,
    quota_project_id: quota_project_id,
    universe_domain: universe_domain,
    logger: logger
  }.merge(options)

  self.class.new options
end