Class: Ksef::Auth::Initiation

Inherits:
Data
  • Object
show all
Defined in:
lib/ksef/auth/initiation.rb

Overview

The 202 Accepted from POST /auth/xades-signature — the contract's AuthenticationInitResponse.

The token here is the short-lived authentication token, not an access token. It authorises exactly two follow-up calls: checking the operation's status, and redeeming it for the real pair. Confusing the two is the obvious mistake in this flow (docs/REFERENCE.md §4.2).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authentication_token ⇒ Object (readonly)

Returns the value of attribute authentication_token

Returns:

  • (Object) —

    the current value of authentication_token



11
12
13
# File 'lib/ksef/auth/initiation.rb', line 11

def authentication_token
  @authentication_token
end

#reference_number ⇒ Object (readonly)

Returns the value of attribute reference_number

Returns:

  • (Object) —

    the current value of reference_number



11
12
13
# File 'lib/ksef/auth/initiation.rb', line 11

def reference_number
  @reference_number
end

Class Method Details

.from(payload) ⇒ Object



12
13
14
15
16
17
# File 'lib/ksef/auth/initiation.rb', line 12

def self.from(payload)
  new(
    reference_number: payload["referenceNumber"],
    authentication_token: TokenInfo.from(payload["authenticationToken"])
  )
end

Instance Method Details

#token ⇒ Object



19
# File 'lib/ksef/auth/initiation.rb', line 19

def token = authentication_token&.token