parakey-client 0.1.0 → 0.1.1
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 +9 -1
- data/README.md +1 -1
- data/lib/parakey/access_events/normalize.rb +1 -1
- data/lib/parakey/access_grants/create.rb +6 -6
- data/lib/parakey/access_grants/delete.rb +1 -1
- data/lib/parakey/members/destroy.rb +2 -2
- data/lib/parakey/operation.rb +3 -4
- data/lib/parakey/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d3b8a25c8c0200e3463ba9feead8e0061eec2917a0aa7fe70f8ac55130c26cfb
|
|
4
|
+
data.tar.gz: 473fc2c957fc64295f35f8976ab18a8205d9be6c5cc9565449a3cd7c4e443209
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c9a1c9f8a1e69306a4e4e1bb848c44ee07d445abd695b063c7a6da5d162c692bfb675fa30f9c18c03bc2c336f42bb02dc0759df85f631a17c350f48c83e763de
|
|
7
|
+
data.tar.gz: e3975e297fc86299bda4fffc1ed4df4569710824ce4e91e8500fc0f7f54876d7db8bc9c2314a1e142eb688f10ddd975828347da1f9169be43768fc8f62cae7ee
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.1.1] - 2026-11-11
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- `Parakey::ArgumentError` messages are sentences the host can show as they are ("Access ID is required.") in
|
|
10
|
+
place of `key: reason` pairs.
|
|
11
|
+
|
|
5
12
|
## [0.1.0] - 2026-11-10
|
|
6
13
|
|
|
7
14
|
First release as `parakey-client`, extracted from the Parakey integration Guestit runs in production. The specs are
|
|
@@ -24,5 +31,6 @@ identifiers — this repo is public).
|
|
|
24
31
|
- Members: `Index` with wire filters and `Destroy` by email.
|
|
25
32
|
- `AccessEvents::Normalize` for event-log items and webhook deliveries.
|
|
26
33
|
|
|
27
|
-
[Unreleased]: https://github.com/guestitab/parakey-client/compare/v0.1.
|
|
34
|
+
[Unreleased]: https://github.com/guestitab/parakey-client/compare/v0.1.1...staging
|
|
35
|
+
[0.1.1]: https://github.com/guestitab/parakey-client/compare/v0.1.0...v0.1.1
|
|
28
36
|
[0.1.0]: https://github.com/guestitab/parakey-client/releases/tag/v0.1.0
|
data/README.md
CHANGED
|
@@ -85,7 +85,7 @@ Lists page 1-based with `page` and `limit` on the wire; the operations take `ski
|
|
|
85
85
|
|
|
86
86
|
| Class | Raised when |
|
|
87
87
|
| --- | --- |
|
|
88
|
-
| `Parakey::ArgumentError` | The arguments are unusable. Raised before any request. |
|
|
88
|
+
| `Parakey::ArgumentError` | The arguments are unusable. Raised before any request, with a message the host can show as it is. |
|
|
89
89
|
| `Parakey::ApiError` | Parakey answered with an error status. `#status` holds the HTTP status. |
|
|
90
90
|
| `Parakey::Error` | The parent of the two above, also raised when no access token is configured. |
|
|
91
91
|
|
|
@@ -11,7 +11,7 @@ module Parakey
|
|
|
11
11
|
|
|
12
12
|
# @rbs (item: ::Hash[::Symbol, untyped]) -> Dry::Monads::Result[::Hash[::Symbol, untyped]]
|
|
13
13
|
def call(item:)
|
|
14
|
-
argument! item
|
|
14
|
+
argument! 'Event item is required.' if item.blank?
|
|
15
15
|
|
|
16
16
|
Success(attributes(item))
|
|
17
17
|
end
|
|
@@ -8,9 +8,9 @@ module Parakey
|
|
|
8
8
|
|
|
9
9
|
# @rbs (attributes: ::Hash[::Symbol, untyped]) -> Dry::Monads::Result[::Hash[::Symbol, untyped]]
|
|
10
10
|
def call(attributes:)
|
|
11
|
-
argument!
|
|
12
|
-
argument! kind
|
|
13
|
-
argument!
|
|
11
|
+
argument! 'Access ID is required.' if attributes[:access_id].blank?
|
|
12
|
+
argument! 'Grant kind is invalid.' unless KINDS.include?(attributes[:kind])
|
|
13
|
+
argument! 'Recipient email is required.' if attributes[:recipient_email].blank?
|
|
14
14
|
|
|
15
15
|
validate_validity_window!(attributes)
|
|
16
16
|
|
|
@@ -26,10 +26,10 @@ module Parakey
|
|
|
26
26
|
# @rbs (::Hash[::Symbol, untyped] attributes) -> void
|
|
27
27
|
def validate_validity_window!(attributes)
|
|
28
28
|
if attributes[:kind] == KIND_TIME_CONTROLLED
|
|
29
|
-
argument!
|
|
30
|
-
argument!
|
|
29
|
+
argument! 'Start date and end date are both required.' if attributes[:start_date].blank? || attributes[:end_date].blank?
|
|
30
|
+
argument! 'End date must be after start date.' if attributes[:start_date].in_time_zone >= attributes[:end_date].in_time_zone
|
|
31
31
|
elsif attributes[:start_date].present? || attributes[:end_date].present?
|
|
32
|
-
argument!
|
|
32
|
+
argument! 'A validity window is only supported for time-controlled grants.'
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
@@ -7,7 +7,7 @@ module Parakey
|
|
|
7
7
|
|
|
8
8
|
# @rbs (attributes: ::Hash[::Symbol, untyped]) -> Dry::Monads::Result[bool]
|
|
9
9
|
def call(attributes:)
|
|
10
|
-
argument!
|
|
10
|
+
argument! 'External ID is required.' if attributes[:external_id].blank?
|
|
11
11
|
|
|
12
12
|
path = "access-keys/#{ERB::Util.url_encode(attributes[:external_id])}"
|
|
13
13
|
Parakey.request(:delete, path, accepted_statuses: [404])
|
|
@@ -7,8 +7,8 @@ module Parakey
|
|
|
7
7
|
|
|
8
8
|
# @rbs (email: ::String?) -> Dry::Monads::Result[bool]
|
|
9
9
|
def call(email:)
|
|
10
|
-
argument!
|
|
11
|
-
argument!
|
|
10
|
+
argument! 'Email is required.' if email.blank?
|
|
11
|
+
argument! 'Domain ID is required.' if Parakey.config.domain_id.blank?
|
|
12
12
|
|
|
13
13
|
filter = {
|
|
14
14
|
domainId: Parakey.config.domain_id,
|
data/lib/parakey/operation.rb
CHANGED
|
@@ -25,15 +25,14 @@ module Parakey
|
|
|
25
25
|
|
|
26
26
|
private
|
|
27
27
|
|
|
28
|
-
def argument!(
|
|
29
|
-
|
|
30
|
-
raise Parakey::ArgumentError, "#{key}: #{reason}"
|
|
28
|
+
def argument!(message)
|
|
29
|
+
raise Parakey::ArgumentError, message
|
|
31
30
|
end
|
|
32
31
|
|
|
33
32
|
# Lists page 1-based by page and limit on the wire; the operations take an item offset.
|
|
34
33
|
# @rbs (::Integer skip, ::Integer take) -> ::Hash[::Symbol, untyped]
|
|
35
34
|
def page_params(skip, take)
|
|
36
|
-
argument!
|
|
35
|
+
argument! 'Take must be a positive number.' unless take.to_i.positive?
|
|
37
36
|
|
|
38
37
|
{
|
|
39
38
|
domainId: Parakey.config.domain_id,
|
data/lib/parakey/version.rb
CHANGED