assinafy 1.5.2 → 1.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37dc8933996b9192a9f12896d772d4d5f745169fcaf0bb13b06cd199e4650bcd
4
- data.tar.gz: 70fe0b92c876f387aeb3656f18b0e78d3cbc09d41dbefc73bba96bb6177b423b
3
+ metadata.gz: e3c0bc2e23ab5f9a95c43efb0b1e219f264f2ea6300d191e991850a907a046c3
4
+ data.tar.gz: c991ca2975741b5ca3a9686d01430f8b45221fe0f1e407ebebc53b237262d4e2
5
5
  SHA512:
6
- metadata.gz: 5bd2d4cfc525e22c84d4de1cc232f4666b769bcdd66e21d56397ad1c4a61bc1c482a7a9b183dcadfde1bd098e624ada2776f847e2c55fcf65e43d20f89437d34
7
- data.tar.gz: 4586c42fc917ef30c6e7eef7718310fd583ce2817acecdf2de5f3f972b405e8986c9a474aa5dbdd9f3c476b2651a700c641471c8154d710e85f2ba4c7c7ebbc1
6
+ metadata.gz: d3956278a581b59bf431a884053be9b0f618fc3b231803b276182e8e3481b26debcd125ff6ba626cdb84959b1f7994f28398110ba5de32fa9c2a6a1105e9b2be
7
+ data.tar.gz: f6e43c5cc8abc3b7f9d1f13364181f3948a164709c49a188a623a7b3ca5720c7a75a154d427c4f899bdf6c368536c89259418991d01de301765fc03140131156
data/CHANGELOG.md CHANGED
@@ -2,6 +2,67 @@
2
2
 
3
3
  All notable changes to the `assinafy` Ruby gem are documented here.
4
4
 
5
+ ## 1.7.0
6
+
7
+ - Require at least one signer on every assignment payload, not just `virtual` ones. The published
8
+ contract marks `signers` as required only for `virtual`, but the API prices per signer in both
9
+ modes and answers a signer-less body with
10
+ `400 "Pelo menos um signatários precisa ser informado."` `build_payload` also dropped the
11
+ `signers` key entirely when the list was empty, so a `collect` estimate could never be priced.
12
+ Both `create` and `estimate_cost` now raise `ValidationError` locally instead of failing upstream.
13
+
14
+ ## 1.6.0
15
+
16
+ ### Added
17
+
18
+ - **OAuth 2.1 support.** An application can now act in a user's workspace with that user's
19
+ permission, instead of authenticating as the workspace with an API key.
20
+
21
+ `Assinafy::OAuth` covers the browser half of the authorization-code flow:
22
+ `generate_code_verifier`, `code_challenge` (PKCE S256, matching the RFC 7636 Appendix B test
23
+ vector), `generate_state`, and `authorization_url`. The authorization server accepts only
24
+ `S256`, so the challenge is always derived for you.
25
+
26
+ `client.oauth` covers the server half: `exchange_code`, `refresh`, `token`, `revoke`,
27
+ `userinfo`, `protected_resource_metadata`, and `authorization_server_metadata`. These routes
28
+ answer with flat RFC 6749 / OIDC objects rather than this API's `{status, data, message}`
29
+ envelope, and the SDK returns them unchanged. `/oauth/token` and `/oauth/revoke` identify the
30
+ client through `client_id` in the body, so the SDK strips `X-Api-Key`/`Authorization` from
31
+ them — including on `authorization_server_metadata`, which reaches a different host.
32
+
33
+ Pass the issued access token as `Assinafy::Client.new(token: ...)`.
34
+
35
+ - `Assinafy::OAuthError` (a subclass of `Assinafy::ApiError`, so existing `rescue` clauses keep
36
+ working) exposes `error` and `error_description` separately, instead of flattening
37
+ `invalid_grant` and its explanation into one message. On a `403` it carries the
38
+ `WWW-Authenticate` challenge — which names the missing scope — in `context[:www_authenticate]`.
39
+
40
+ - `AssignmentResource::VERIFICATION_METHODS` and `NOTIFICATION_METHODS` publish the signer
41
+ verification and notification enums: `Email` and `Whatsapp` one-time codes, and
42
+ `DigitalCertificate` signing with the signer's own ICP-Brasil A1/A3 certificate.
43
+
44
+ ### Changed
45
+
46
+ - `AssignmentResource.build_payload` validates a signer's `verification_method`,
47
+ `notification_methods`, and `step` locally. The API's enums are closed and it reports an unknown
48
+ value as a `422` only after the request has been sent — and after any signers created for that
49
+ assignment already exist.
50
+
51
+ - `spec/fixtures/api_contract.json` tracks the current upstream contract (93 operations, 39
52
+ schemas), including the four OAuth operations.
53
+
54
+ ### Removed
55
+
56
+ - **Steep type checking.** `steep` is no longer a development dependency, so the CI and release
57
+ workflows that ran `bundle exec steep check` would fail on any machine that installs from the
58
+ current gemspec. Those steps, the `Steepfile`, and the `typecheck/` stubs that existed only to
59
+ satisfy the checker are removed.
60
+
61
+ `sig/assinafy.rbs` is unchanged and still ships in the gemspec's file list: consumers keep the
62
+ published RBS signatures. In place of Steep, `spec/rbs_signature_spec.rb` asserts that every
63
+ public resource, `Client`, and `Assinafy::OAuth` method has a declared signature, so a new
64
+ method can no longer ship without one.
65
+
5
66
  ## 1.5.2
6
67
 
7
68
  ### Fixed