Class: AppStoreConnectApi::Authorization

Inherits:
Object
  • Object
show all
Defined in:
lib/app_store_connect_api/authorization.rb

Constant Summary collapse

ALGORITHM =
'ES256'

Instance Method Summary collapse

Constructor Details

#initialize(issuer_id, key_id, private_key) ⇒ Authorization

Returns a new instance of Authorization.



7
8
9
10
11
# File 'lib/app_store_connect_api/authorization.rb', line 7

def initialize(issuer_id, key_id, private_key)
  @issuer_id = issuer_id
  @key_id = key_id
  @private_key = private_key
end

Instance Method Details

#tokenObject



13
14
15
# File 'lib/app_store_connect_api/authorization.rb', line 13

def token
  JWT.encode payload, private_key, ALGORITHM, header_fields
end