Skip to content

v3.0.0

Choose a tag to compare

@tobischo tobischo released this 02 Nov 16:49

Major release adding EBICS 3.0 (H005) and EBICS 2.4 (H003) support, alongside a
rewrite of request building into builders/factories/handlers.

Breaking changes

  • [BREAKING] Default key size for Epics::Client.setup raised from 2048 to 4096 bits
  • [BREAKING] Removed internal accessors that were never intended as public API:
    Client#a, #e, #x, #bank_x, #bank_e, #keys=, #x_509_certificate,
    #x_509_certificate_hash, #x_509_certificates_content, #header_request, and the
    constants Epics::Key, Epics::Signer, Epics::X509Certificate,
    Epics::HeaderRequest, Epics::XMLSIG
  • [BREAKING] Client#keys is now recomputed per call; mutating it no longer injects keys
  • [BREAKING] On H005, Client#HAA and Client#order_types return an array of service
    hashes (service_name, scope, service_option, container, msg_name) instead of
    an array of order-type strings
  • [BREAKING] Removed Epics::Builders::MutableBuilder#add_receipt_code, which emitted
    ReceiptCode inside mutable where the schema does not allow it. ReceiptCode
    belongs to TransferReceipt, which TransferReceiptBuilder already builds
  • [BREAKING] XEK, YCT and ZSR raise Epics::VersionSupportError on H003/H004
    instead of NotImplementedError, matching every other version mismatch
  • [BREAKING] order_id: is validated against the EBICS OrderIDType range (A000 to
    ZZZZ). Values below A000 rendered as e.g. 0002, which violates the
    [A-Z][A-Z0-9]{3} pattern; they now raise ArgumentError. The protocol form
    (order_id: 'A000') is accepted alongside the integer
  • [BREAKING] Passing only one date-range bound (e.g. client.STA(from)) silently
    omitted the range and fetched the bank's full retention window. Both bounds are
    mandatory within DateRange, so this now raises ArgumentError
  • [BREAKING] Upload order data is now normalized once, on the way in, so the bytes
    hashed for the electronic signature are the bytes transmitted. Until 3.0 the digest
    was taken over the normalized document while the raw one was sent, which only
    verifies against banks that normalize before checking the ES
  • [BREAKING] Removed Epics::Services::CryptService#sign, which had no callers and
    disagreed with #encrypt on how an A005 signature is formed

Fixes

  • [FIX] Loading a key file with the wrong passphrase raised OpenSSL::PKey::PKeyError
    about one time in 256, when the decrypted garbage happened to be padded correctly.
    Decryption now verifies it produced a PEM, so a wrong passphrase always raises
    OpenSSL::Cipher::CipherError
  • [FIX] An unreadable certificate in an HPB response raised a bare
    OpenSSL::X509::CertificateError. It now raises Epics::InvalidCertificateError
    naming the HPB response as the source and keeping the OpenSSL message
  • [FIX] Response#signature_valid? and #public_digest_valid? raised NoMethodError
    when the key they need was not loaded; they now raise Epics::MissingKeyError naming
    it. #digest_valid? no longer needs a key at all — it is a plain SHA-256 over the
    authenticated nodes
  • [FIX] Removed the container_flag: order parameter, which emitted a ContainerFlag
    element that exists in no EBICS schema. The container is expressed by Container
    with a containerType attribute, which container_type: already emits
  • [ENHANCEMENT] Added the H005-only order types XEK (account statements as PDF),
    ZSR (payment status reports) and YCT (multi-currency credit transfer). Their BTF
    mappings existed in the V3 factory but had no order class or client method
  • [ENHANCEMENT] XEK, ZSR, Z01, Z52, Z53 and Z54 accept scope:,
    service_option:, msg_name_version: and container_type:. Defaults are unchanged;
    Swiss market practice requires a Scope and only ZSR sent one, so a bank-specific
    value can now be supplied without patching the gem
  • [ENHANCEMENT] C54 accepts scope:, msg_name_version: and container_type:, the
    same options as C52 and C53; C53 gained container_type:. The three camt
    retrievals now differ only in service name and message type
  • [FIX] save_keys discarded any key-file entry it could not map to one of the five
    keyring slots, so a host_id that no longer matched the stored prefix destroyed the
    bank's public keys on save. Unrecognised entries are now carried through unchanged,
    and a warning names each one instead of the failure being swallowed
  • [FIX] XCT sent the wrong order type: CD1 on H003/H004 and the DTAZV service on
    H005, filing credit transfers as direct debits. It now sends XCT on H003/H004.
    EBICS 3.0 defines no counterpart for XCT, so on H005 it raises
    Epics::VersionSupportError rather than guessing a BTF service
  • [FIX] The electronic signature over order data is again formed with line separators
    removed, matching 2.x. The refactor had signed the raw document, changing the ES for
    every upload
  • [FIX] H005 DataDigest carried an RSA-PSS signature (256 bytes, non-reproducible)
    instead of the SHA-256 hash of the order data
  • [FIX] Response#business_error? treated every 01-prefixed return code as
    informational, reporting 011001 (negative acknowledgement) and 011101 (segment
    number not reached) as success. It now uses an explicit allow-list
  • [FIX] Time and DateTime passed as date-range bounds rendered an xs:dateTime
    with a local offset into an xs:date element; they are now coerced to a date
  • [FIX] C52 requested no container on H005 while Client#C52 always unzips the
    response, raising Zip::Error. C52 and C53 now default to a ZIP container and
    both accept container_type: to override it
  • [FIX] Epics::Client.setup forwarded its block to .new, which yields before the
    keys are generated, so the block saw an empty keyring and anything touching it —
    ini_letter, save_keys, INI, HIA — failed. It now yields once the client is
    usable
  • [FIX] Epics::VersionSupportError was raised as raise Error, version, 'below',
    where the third argument is the backtrace, so the direction was dropped and the
    stack trace destroyed. 2.x-only order types on H005 now report "Support for versions
    below 3.0" and keep their trace
  • [FIX] A download spanning several segments returned only its first segment, so zipped
    downloads such as C52 and C53 raised Zip::Error and plain ones such as STA came
    back cut off without an error. The remaining segments are now requested in the transfer
    phase and the order data is decrypted once all segments are joined. A segmented response
    without a readable NumSegments raises Epics::InvalidResponseError
  • [FIX] Truncated order data was inflated as far as it went and returned. It now raises
    Epics::InvalidOrderDataError, with the Zlib or OpenSSL error as its cause, and a
    negative receipt is sent instead of a positive one, so the bank does not consider a
    broken download as delivered
  • [FIX] H005 uploads were sent without SignatureFlag in BTUOrderParams, although they
    carry the user's ES (electronic signature), so banks treated them as orders
    to be authorised outside EBICS and some rejected them with EBICS_INVALID_ORDER_TYPE.
    SignatureFlag is now set by default, matching OZHNN on H004. Pass request_eds: true
    to spool the order into the EDS (distributed electronic signature, German VEU)
    when signatures are still missing, or signature_flag: false to omit the flag