Class: Ksef::Sessions::UpoPage
- Inherits:
-
Data
- Object
- Data
- Ksef::Sessions::UpoPage
- Defined in:
- lib/ksef/sessions/upo_page.rb
Overview
One page of a collective UPO (docs/REFERENCE.md §12, §14.2).
A collective UPO holds at most 10 000 invoice entries, which is why a session's
upo.pages is an array: a client that reads only the first page silently loses proof
of receipt for every invoice beyond it.
download_url is a pre-signed storage link, not an API route. Follow it as an
opaque URI, send no bearer token — sending one leaks the credential to third-party
storage — and verify the x-ms-meta-hash header against the bytes received. It is
regenerated on every status query and expires at #expires_at, so it must never be
logged or persisted as a durable reference.
Instance Attribute Summary collapse
-
#download_url ⇒ Object
readonly
Returns the value of attribute download_url.
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#reference_number ⇒ Object
readonly
Returns the value of attribute reference_number.
Class Method Summary collapse
Instance Method Summary collapse
- #expired?(now = Time.now) ⇒ Boolean
- #inspect ⇒ Object
-
#to_s ⇒ Object
The link is credential-bearing, so it stays out of any log line by default.
Instance Attribute Details
#download_url ⇒ Object (readonly)
Returns the value of attribute download_url
16 17 18 |
# File 'lib/ksef/sessions/upo_page.rb', line 16 def download_url @download_url end |
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at
16 17 18 |
# File 'lib/ksef/sessions/upo_page.rb', line 16 def expires_at @expires_at end |
#reference_number ⇒ Object (readonly)
Returns the value of attribute reference_number
16 17 18 |
# File 'lib/ksef/sessions/upo_page.rb', line 16 def reference_number @reference_number end |
Class Method Details
Instance Method Details
#expired?(now = Time.now) ⇒ Boolean
25 |
# File 'lib/ksef/sessions/upo_page.rb', line 25 def expired?(now = Time.now) = !expires_at.nil? && expires_at <= now |
#inspect ⇒ Object
30 31 32 33 |
# File 'lib/ksef/sessions/upo_page.rb', line 30 def inspect "#<data Ksef::Sessions::UpoPage reference_number=#{reference_number.inspect} " \ "download_url=[PRE-SIGNED] expires_at=#{expires_at.inspect}>" end |
#to_s ⇒ Object
The link is credential-bearing, so it stays out of any log line by default.
28 |
# File 'lib/ksef/sessions/upo_page.rb', line 28 def to_s = reference_number.to_s |