liberic 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +126 -0
- data/README.md +283 -146
- data/examples/est_2020.rb +40 -0
- data/lib/liberic/boot.rb +85 -10
- data/lib/liberic/certificate.rb +95 -16
- data/lib/liberic/config.rb +89 -20
- data/lib/liberic/core.rb +24 -0
- data/{rakelib/eric.rake → lib/liberic/eric_installer.rb} +38 -17
- data/lib/liberic/helpers/invocation.rb +46 -9
- data/lib/liberic/process.rb +233 -41
- data/lib/liberic/sdk/api.rb +28 -0
- data/lib/liberic/sdk/types.rb +49 -1
- data/lib/liberic/sdk.rb +12 -1
- data/lib/liberic/tasks.rb +27 -0
- data/lib/liberic/version.rb +1 -1
- data/lib/liberic.rb +5 -20
- metadata +29 -35
- data/.github/dependabot.yml +0 -6
- data/.github/workflows/release.yml +0 -39
- data/.gitignore +0 -10
- data/.rspec +0 -2
- data/.tool-versions +0 -1
- data/CODE_OF_CONDUCT.md +0 -13
- data/ERIC_SDK_UPGRADE_PROMPT.md +0 -16
- data/Gemfile +0 -6
- data/Rakefile +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -7
- data/examples/steuersatz.xml +0 -89
- data/examples/submit_ekst.rb +0 -13
- data/liberic.gemspec +0 -38
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8417513770b914a40de51d3c4bba71f75a855b43e5500cc341305b98de8a89e4
|
|
4
|
+
data.tar.gz: 8a8b32e4d571bf47ae14b00dedfeb12d8660a8e9c048851363c84ed60ef969b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eab285814f43e9366e5bd256dd0722c0e50fa572cc4e392c01f2c2cbb25c5fff34d528176fded41782ab975fb499bc1552df2e2623801aba6139c3b1bcfb07a7
|
|
7
|
+
data.tar.gz: f650ae3c0e51f899765a7f60165e44be12eda3aa0609706e57939b724bd856edd6591782386b165b54814fb043a73d34333521459d74aa44e761aa3661ad1414
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,132 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.5.0]
|
|
9
|
+
|
|
10
|
+
Fixes found while integrating Liberic with ERiC 43 in a Rails application
|
|
11
|
+
([#14](https://github.com/mpm/liberic-ruby/issues/14)). All changes are
|
|
12
|
+
backwards compatible.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `Process#execute` returns a `Liberic::Process::Result`: still a Hash with
|
|
17
|
+
`:result` and `:server_result`, plus `code`, `error` and `ok?` with ERiC's
|
|
18
|
+
return code.
|
|
19
|
+
- `Process#execute!` raises `Liberic::Process::ProcessingError` (with `code`,
|
|
20
|
+
`error` and `result`) unless ERiC returns `ERIC_OK`.
|
|
21
|
+
- `Liberic::Helpers::Invocation.call_with_result_buffer`, which returns the
|
|
22
|
+
return code together with the buffer content. `Invocation::Error` exposes
|
|
23
|
+
`code`, `error` and `buffer`, so `Process#check` failures carry ERiC's
|
|
24
|
+
schema error text.
|
|
25
|
+
- `require 'liberic/core'` and `Liberic.boot!(eric_home:, plugin_path:, log_path:)`
|
|
26
|
+
to load the gem without initializing ERiC and to initialize it explicitly,
|
|
27
|
+
including the `eric.log` directory. `require 'liberic'` still initializes
|
|
28
|
+
ERiC immediately.
|
|
29
|
+
- Config accessors `validation_hint_limit` (`validieren.hinweise_max`),
|
|
30
|
+
`network` (`transfer.netz`) and `test_date` (`test.datum`).
|
|
31
|
+
- `Liberic.config.log_file = true` keeps ERiC writing `eric.log` while
|
|
32
|
+
Liberic's log callback is registered. It defaults to `false`, which stops
|
|
33
|
+
`eric.log` once `Liberic.config` is used, as before.
|
|
34
|
+
- `require 'liberic/tasks'` provides `rake eric:install` to applications. The
|
|
35
|
+
install root defaults to the current directory and can be set with a task
|
|
36
|
+
argument or `ERIC_INSTALL_ROOT`.
|
|
37
|
+
- `Certificate#encryption_params` accepts a block and wipes the native PIN
|
|
38
|
+
copy afterwards; `release_handle!` wipes the copies of all params it issued.
|
|
39
|
+
- `Process#execute` action `:validate_with_hints` (`ERIC_VALIDIERE` with
|
|
40
|
+
`ERIC_PRUEFE_HINWEISE`) returns errors and hints in one call.
|
|
41
|
+
`Result#hints?` reports `ERIC_GLOBAL_HINWEISE`, which counts as `ok?`.
|
|
42
|
+
- `Process#execute(pdf: :memory)` receives PDFs through ERiC's `pdfCallback`
|
|
43
|
+
instead of a file; they are in `Result#pdfs`.
|
|
44
|
+
`SDK::API.generate_pdf_callback` and `DruckParameter#set_pdf_callback` bind
|
|
45
|
+
the callback.
|
|
46
|
+
- `Liberic::Certificate.from_bytes(pkcs12, pin)` opens a certificate from
|
|
47
|
+
memory (`EricZertifikatOeffnenAusBytes`) and wipes its native copies of the
|
|
48
|
+
container and the PIN afterwards.
|
|
49
|
+
- `Liberic::Process::TransferHandle` and the `:transfer_handle` option of
|
|
50
|
+
`Process#execute` for the calls of a Datenabholung.
|
|
51
|
+
- The README describes ERiC 43 behavior that applications run into: hints,
|
|
52
|
+
schema errors, characters outside the BMP, and the footer's limits.
|
|
53
|
+
- Specs for return codes, every Config accessor and the log callback against
|
|
54
|
+
the installed SDK. Specs that call `EricBearbeiteVorgang` use
|
|
55
|
+
`ERIC_HERSTELLER_ID` and are skipped without it.
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- `Liberic::EricInstaller` moved from `rakelib/eric.rake` to
|
|
60
|
+
`lib/liberic/eric_installer.rb` (not loaded by `require 'liberic'`) and
|
|
61
|
+
installs into the current directory by default.
|
|
62
|
+
- The installer requires rubyzip 3.4 or newer (older versions are vulnerable to
|
|
63
|
+
path traversal) and uses the rubyzip 3 extraction API. The development
|
|
64
|
+
dependency is now `rubyzip >= 3.4`.
|
|
65
|
+
- `require 'liberic/sdk'` no longer loads the ERiC library; `Liberic.boot!`
|
|
66
|
+
does.
|
|
67
|
+
- `EricInitialisiere` failures raise `Liberic::InitializationError` instead of
|
|
68
|
+
being ignored.
|
|
69
|
+
- `Process#execute` passes the print parameters only to actions that print
|
|
70
|
+
(ERiC documents NULL for the others) and passes `:footer` to ERiC in UTF-8.
|
|
71
|
+
- The `:draft` option of `Process#execute` defaults to `false` for
|
|
72
|
+
`:print_and_submit` and `:print_and_submit_auth`: ERiC prints sent filings
|
|
73
|
+
only as final documents and rejects a preview before sending.
|
|
74
|
+
- `examples/est_2020.rb` replaces `examples/submit_ekst.rb` and
|
|
75
|
+
`examples/steuersatz.xml` (ESt 2011 with the blocked test manufacturer ID
|
|
76
|
+
74931). It uses the SDK's example filing and `ERIC_HERSTELLER_ID`.
|
|
77
|
+
- Reorganized the README around requirements, installation and usage for
|
|
78
|
+
ERiC 43. Removed the unverified 2016 macOS library-rewriting workaround
|
|
79
|
+
and obsolete setup notes; clarified logging and the GitHub release workflow.
|
|
80
|
+
Development and release instructions moved to `CONTRIBUTING.md`.
|
|
81
|
+
- The gem packages only the library, the example, README, changelog and
|
|
82
|
+
license (no longer the repository's CI and container files). The gemspec
|
|
83
|
+
links to the changelog, API documentation and issue tracker.
|
|
84
|
+
- The release workflow also creates a GitHub release for each version tag,
|
|
85
|
+
with the version's changelog section as notes and the gem attached. It stops
|
|
86
|
+
before publishing if `CHANGELOG.md` has no section for the version.
|
|
87
|
+
- The Gemfile no longer pins Ruby 3.3.0. The gem still requires Ruby 3.3 or
|
|
88
|
+
newer and is tested on Ruby 3.3 and 4.0.
|
|
89
|
+
|
|
90
|
+
### Deprecated
|
|
91
|
+
|
|
92
|
+
- The `Process#execute` action `:print_and_submit_auth` is an alias of
|
|
93
|
+
`:print_and_submit` and warns (category `:deprecated`). ERiC uses the same
|
|
94
|
+
flags with and without authentication; `:encryption` decides.
|
|
95
|
+
- `Liberic.config.eric_home`, `log_path`, `data_path` and `online` refer to
|
|
96
|
+
settings that ERiC 43 removed. They raise
|
|
97
|
+
`Liberic::Config::UnsupportedSettingError` (a
|
|
98
|
+
`Liberic::Helpers::Invocation::Error`, as before) with the replacement
|
|
99
|
+
instead of ERiC's `ERIC_GLOBAL_EINSTELLUNG_NAME_UNGUELTIG`.
|
|
100
|
+
|
|
101
|
+
### Fixed
|
|
102
|
+
|
|
103
|
+
- Failed boot attempts no longer leave stale SDK home constants. Once the
|
|
104
|
+
native API has loaded, initialization retries must use the same SDK home.
|
|
105
|
+
- Certificates track encryption parameters weakly, so discarded structs and
|
|
106
|
+
their native PIN copies can be collected while the certificate stays open.
|
|
107
|
+
- `Process#execute` discarded ERiC's return code, so failures such as
|
|
108
|
+
`ERIC_IO_TESTHERSTELLERID_GESPERRT` looked like success.
|
|
109
|
+
- `Process#execute` passed a transfer handle when sending, although ERiC
|
|
110
|
+
requires NULL outside a Datenabholung.
|
|
111
|
+
- Strings passed to ERiC in structs (PDF file name, footer, PIN) could be freed
|
|
112
|
+
by the garbage collector before ERiC read them.
|
|
113
|
+
- The log callback registered by `Liberic.config` could be freed by the garbage
|
|
114
|
+
collector while ERiC still called it, which crashed the process.
|
|
115
|
+
- `PinFeatures#no_pin` was always `false`.
|
|
116
|
+
- Result buffers are released when the block raises.
|
|
117
|
+
- The documentation claimed PDFs are written to `data_path` without
|
|
118
|
+
`:filename`; ERiC 43 requires a file name whenever it prints.
|
|
119
|
+
- `Process#execute(action: :print_and_submit)` sent the filing without
|
|
120
|
+
creating a PDF: it passed `ERIC_SENDE` without `ERIC_DRUCKE`, and ERiC
|
|
121
|
+
43.5.4.0 ignores the print parameters then. It now passes
|
|
122
|
+
`ERIC_VALIDIERE | ERIC_SENDE | ERIC_DRUCKE`, as the ERiC developer handbook
|
|
123
|
+
requires for sending and printing.
|
|
124
|
+
- The README and the `Liberic.boot!` and `Config` documentation now state
|
|
125
|
+
that ERiC stops writing `eric.log` once `Liberic.config` is used, unless
|
|
126
|
+
`Liberic.config.log_file` is `true`.
|
|
127
|
+
- Liberic loads on Ruby 4.0 with Bundler. `logger` is no longer a default gem
|
|
128
|
+
since Ruby 4.0, so the gem now declares it as a dependency; `require 'liberic'`
|
|
129
|
+
previously failed with a `LoadError`.
|
|
130
|
+
- `bundle install` in a checkout of the repository works with Bundler 4,
|
|
131
|
+
which ships with Ruby 4.0. The gemspec no longer declares Bundler 2 as a
|
|
132
|
+
development dependency.
|
|
133
|
+
|
|
8
134
|
## [1.4.1]
|
|
9
135
|
|
|
10
136
|
### Changed
|