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 +4 -4
- data/CHANGELOG.md +61 -0
- data/README.en.md +815 -0
- data/README.md +608 -480
- data/docs/API_REFERENCE.md +64 -7
- data/lib/assinafy/client.rb +15 -2
- data/lib/assinafy/errors.rb +56 -0
- data/lib/assinafy/oauth.rb +245 -0
- data/lib/assinafy/resources/account_resource.rb +5 -5
- data/lib/assinafy/resources/assignment_resource.rb +68 -9
- data/lib/assinafy/resources/document_resource.rb +9 -9
- data/lib/assinafy/resources/oauth_resource.rb +370 -0
- data/lib/assinafy/resources/user_resource.rb +5 -5
- data/lib/assinafy/version.rb +1 -1
- data/lib/assinafy.rb +2 -0
- data/sig/assinafy.rbs +70 -0
- metadata +7 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e3c0bc2e23ab5f9a95c43efb0b1e219f264f2ea6300d191e991850a907a046c3
|
|
4
|
+
data.tar.gz: c991ca2975741b5ca3a9686d01430f8b45221fe0f1e407ebebc53b237262d4e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|