Class: AppStoreConnect::Authorization
- Inherits:
-
Object
- Object
- AppStoreConnect::Authorization
- Defined in:
- lib/app_store_connect/authorization.rb
Constant Summary collapse
- AUDIENCE =
'appstoreconnect-v1'- ALGORITHM =
'ES256'
Instance Attribute Summary collapse
-
#issuer_id ⇒ Object
readonly
Returns the value of attribute issuer_id.
-
#key_id ⇒ Object
readonly
Returns the value of attribute key_id.
-
#private_key ⇒ Object
readonly
Returns the value of attribute private_key.
Instance Method Summary collapse
- #header_fields ⇒ Object
-
#initialize(key_id:, issuer_id:, private_key:) ⇒ Authorization
constructor
A new instance of Authorization.
- #payload ⇒ Object
- #token ⇒ Object
Constructor Details
#initialize(key_id:, issuer_id:, private_key:) ⇒ Authorization
Returns a new instance of Authorization.
12 13 14 15 16 |
# File 'lib/app_store_connect/authorization.rb', line 12 def initialize(key_id:, issuer_id:, private_key:) @key_id = key_id @issuer_id = issuer_id @private_key = OpenSSL::PKey.read(private_key) end |
Instance Attribute Details
#issuer_id ⇒ Object (readonly)
Returns the value of attribute issuer_id.
10 11 12 |
# File 'lib/app_store_connect/authorization.rb', line 10 def issuer_id @issuer_id end |
#key_id ⇒ Object (readonly)
Returns the value of attribute key_id.
10 11 12 |
# File 'lib/app_store_connect/authorization.rb', line 10 def key_id @key_id end |
#private_key ⇒ Object (readonly)
Returns the value of attribute private_key.
10 11 12 |
# File 'lib/app_store_connect/authorization.rb', line 10 def private_key @private_key end |
Instance Method Details
#header_fields ⇒ Object
26 27 28 |
# File 'lib/app_store_connect/authorization.rb', line 26 def header_fields { kid: key_id } end |