Class: Ksef::Credentials::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/ksef/credentials/token.rb

Overview

A long-lived KSeF integration token, minted in the KSeF portal after Profil Zaufany / qualified-seal login.

The raw token value is treated as opaque; it is encrypted with the KSeF public RSA key during the Sessions init flow.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Token

Returns a new instance of Token.

Raises:



13
14
15
16
17
# File 'lib/ksef/credentials/token.rb', line 13

def initialize(value)
  raise ConfigurationError, "Token value cannot be blank" if value.nil? || value.to_s.empty?

  @value = value.to_s
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11
12
13
# File 'lib/ksef/credentials/token.rb', line 11

def value
  @value
end

Instance Method Details

#to_sObject Also known as: inspect



23
24
25
# File 'lib/ksef/credentials/token.rb', line 23

def to_s
  "#<Ksef::Credentials::Token value=[REDACTED]>"
end

#typeObject



19
20
21
# File 'lib/ksef/credentials/token.rb', line 19

def type
  :token
end