aho-sdk 0.1.0 → 0.1.2
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 +17 -1
- data/README.md +1 -1
- data/lib/aho_sdk/account.rb +46 -26
- data/lib/aho_sdk/holder.rb +9 -9
- data/lib/aho_sdk/http_client.rb +1 -1
- data/lib/aho_sdk/issuer.rb +54 -93
- data/lib/aho_sdk/schemas.rb +8 -8
- data/lib/aho_sdk/system.rb +3 -3
- data/lib/aho_sdk/{public.rb → unauthenticated.rb} +7 -7
- data/lib/aho_sdk/verifier.rb +77 -16
- data/lib/aho_sdk/version.rb +1 -1
- data/lib/aho_sdk.rb +18 -19
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c840f57484d2a450464f827bde3830fef0a36bdbebbf6a670d1dff76b9b4916f
|
|
4
|
+
data.tar.gz: 3b5c236645da59df64fc67eb3837407131f32fc68a4e6964925777a4a3bb9d11
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 275e285971035dfafa7e284fe7fc3b0e0b96281dfa0465e93d451fd9d6f68a6ab5b11e16b77b430bfd2b4afb6df67deddd79ceb22972f1cfff5eb349eb2db544
|
|
7
|
+
data.tar.gz: f55b0e4a0cdb133e5642c20759b3373727eec4b0a139d9deccb86784044c64e8ba9856df29a1dfcf2e23aa7fd50d93f4d032d48eb24108bf83c88b13fcb5dc47
|
data/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,23 @@ 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.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [0.1.
|
|
8
|
+
## [0.1.2] - 2026-05-05
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **Breaking:** Batch credential operations moved from separate resources to `credentials` resource
|
|
13
|
+
- `client.revoke_batch.create` → `client.credentials.revoke_batch`
|
|
14
|
+
- `client.suspend_batch.create` → `client.credentials.suspend_batch`
|
|
15
|
+
- `client.reinstate_batch.create` → `client.credentials.reinstate_batch`
|
|
16
|
+
|
|
17
|
+
## [0.1.1] - 2026-05-05
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- API base URL updated to `https://api.aho.com` (subdomain routing)
|
|
22
|
+
- API paths simplified from `/api/v1/*` to `/v1/*`
|
|
23
|
+
|
|
24
|
+
## [0.1.0] - 2026-04-17
|
|
9
25
|
|
|
10
26
|
### Added
|
|
11
27
|
|
data/README.md
CHANGED
|
@@ -49,7 +49,7 @@ The SDK provides the following clients:
|
|
|
49
49
|
| `AhoSdk::Verifier` | Create presentation requests and verify credentials | Verifier API Key |
|
|
50
50
|
| `AhoSdk::Issuer` | Issue and manage verifiable credentials | Issuer API Key |
|
|
51
51
|
| `AhoSdk::Schemas` | Browse and retrieve credential schemas | Schemas API Key |
|
|
52
|
-
| `AhoSdk::
|
|
52
|
+
| `AhoSdk::Unauthenticated` | Public endpoints (no authentication required) | None (public) |
|
|
53
53
|
|
|
54
54
|
## Usage Examples
|
|
55
55
|
|
data/lib/aho_sdk/account.rb
CHANGED
|
@@ -12,18 +12,20 @@ module AhoSdk
|
|
|
12
12
|
# @example
|
|
13
13
|
# client = AhoSdk::Account.new(api_key: ENV["AHO_ACCOUNT_API_KEY"])
|
|
14
14
|
# client.api_keys.list
|
|
15
|
+
# client.regenerate.list
|
|
15
16
|
# client.domains.list
|
|
16
17
|
# client.signing_keys.list
|
|
17
18
|
# client.webhooks.list
|
|
18
19
|
#
|
|
19
20
|
class Account
|
|
20
21
|
# @param api_key [String] API key for authentication
|
|
21
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
22
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
22
23
|
# @param timeout [Integer] Request timeout in seconds (default: 30)
|
|
23
24
|
# @param logger [Logger] Optional logger for debugging
|
|
24
|
-
def initialize(api_key:, base_url: "https://aho.com", timeout: 30, logger: nil)
|
|
25
|
+
def initialize(api_key:, base_url: "https://api.aho.com", timeout: 30, logger: nil)
|
|
25
26
|
@client = HttpClient.new(api_key: api_key, base_url: base_url, timeout: timeout, logger: logger)
|
|
26
27
|
@api_keys = ApiKeysResource.new(@client)
|
|
28
|
+
@regenerate = RegenerateResource.new(@client)
|
|
27
29
|
@domains = DomainsResource.new(@client)
|
|
28
30
|
@signing_keys = SigningKeysResource.new(@client)
|
|
29
31
|
@webhooks = WebhooksResource.new(@client)
|
|
@@ -31,6 +33,8 @@ module AhoSdk
|
|
|
31
33
|
|
|
32
34
|
# @return [ApiKeysResource]
|
|
33
35
|
attr_reader :api_keys
|
|
36
|
+
# @return [RegenerateResource]
|
|
37
|
+
attr_reader :regenerate
|
|
34
38
|
# @return [DomainsResource]
|
|
35
39
|
attr_reader :domains
|
|
36
40
|
# @return [SigningKeysResource]
|
|
@@ -51,21 +55,37 @@ module AhoSdk
|
|
|
51
55
|
#
|
|
52
56
|
# @return [Hash]
|
|
53
57
|
def list
|
|
54
|
-
@client.get("/
|
|
58
|
+
@client.get("/v1/account/api_keys")
|
|
55
59
|
end
|
|
56
60
|
|
|
57
|
-
#
|
|
61
|
+
# Get API key details
|
|
58
62
|
#
|
|
59
63
|
# @return [Hash]
|
|
60
|
-
def
|
|
61
|
-
@client.
|
|
64
|
+
def get(hashid:)
|
|
65
|
+
@client.get("/v1/account/api_keys/#{hashid}")
|
|
62
66
|
end
|
|
63
67
|
|
|
64
|
-
#
|
|
68
|
+
# Update API key
|
|
65
69
|
#
|
|
66
70
|
# @return [Hash]
|
|
67
|
-
def
|
|
68
|
-
@client.
|
|
71
|
+
def update(hashid:, body:, idempotency_key: nil)
|
|
72
|
+
@client.patch("/v1/account/api_keys/#{hashid}", body: body, idempotency_key: idempotency_key)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Regenerate resource operations
|
|
77
|
+
# @api private
|
|
78
|
+
class RegenerateResource
|
|
79
|
+
# @api private
|
|
80
|
+
def initialize(client)
|
|
81
|
+
@client = client
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Regenerate API key
|
|
85
|
+
#
|
|
86
|
+
# @return [Hash]
|
|
87
|
+
def create(hashid:, idempotency_key: nil)
|
|
88
|
+
@client.post("/v1/account/api_keys/#{hashid}/regenerate", idempotency_key: idempotency_key)
|
|
69
89
|
end
|
|
70
90
|
end
|
|
71
91
|
|
|
@@ -81,7 +101,7 @@ module AhoSdk
|
|
|
81
101
|
#
|
|
82
102
|
# @return [Hash]
|
|
83
103
|
def create(body: nil, idempotency_key: nil)
|
|
84
|
-
@client.post("/
|
|
104
|
+
@client.post("/v1/account/domains", body: body, idempotency_key: idempotency_key)
|
|
85
105
|
end
|
|
86
106
|
|
|
87
107
|
# List domains
|
|
@@ -89,7 +109,7 @@ module AhoSdk
|
|
|
89
109
|
# @return [Hash]
|
|
90
110
|
def list(txt_status: nil, fully_verified: nil, primary: nil, page: nil, per_page: nil)
|
|
91
111
|
fetch_page = ->(p) {
|
|
92
|
-
response = @client.get("/
|
|
112
|
+
response = @client.get("/v1/account/domains", params: { txt_status: txt_status, fully_verified: fully_verified, primary: primary, page: p, per_page: per_page })
|
|
93
113
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
94
114
|
}
|
|
95
115
|
fetch_page.call(page)
|
|
@@ -99,21 +119,21 @@ module AhoSdk
|
|
|
99
119
|
#
|
|
100
120
|
# @return [Hash]
|
|
101
121
|
def get(id:)
|
|
102
|
-
@client.get("/
|
|
122
|
+
@client.get("/v1/account/domains/#{id}")
|
|
103
123
|
end
|
|
104
124
|
|
|
105
125
|
# Delete a domain
|
|
106
126
|
#
|
|
107
127
|
# @return [Hash]
|
|
108
128
|
def delete(id:)
|
|
109
|
-
@client.delete("/
|
|
129
|
+
@client.delete("/v1/account/domains/#{id}")
|
|
110
130
|
end
|
|
111
131
|
|
|
112
132
|
# Verify domain
|
|
113
133
|
#
|
|
114
134
|
# @return [Hash]
|
|
115
135
|
def verify(id:, idempotency_key: nil)
|
|
116
|
-
@client.post("/
|
|
136
|
+
@client.post("/v1/account/domains/#{id}/verify", idempotency_key: idempotency_key)
|
|
117
137
|
end
|
|
118
138
|
end
|
|
119
139
|
|
|
@@ -129,7 +149,7 @@ module AhoSdk
|
|
|
129
149
|
#
|
|
130
150
|
# @return [Hash]
|
|
131
151
|
def create(body: nil, idempotency_key: nil)
|
|
132
|
-
@client.post("/
|
|
152
|
+
@client.post("/v1/account/signing_keys", body: body, idempotency_key: idempotency_key)
|
|
133
153
|
end
|
|
134
154
|
|
|
135
155
|
# List signing keys
|
|
@@ -137,7 +157,7 @@ module AhoSdk
|
|
|
137
157
|
# @return [Hash]
|
|
138
158
|
def list(status: nil, algorithm: nil, usable: nil, page: nil, per_page: nil)
|
|
139
159
|
fetch_page = ->(p) {
|
|
140
|
-
response = @client.get("/
|
|
160
|
+
response = @client.get("/v1/account/signing_keys", params: { status: status, algorithm: algorithm, usable: usable, page: p, per_page: per_page })
|
|
141
161
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
142
162
|
}
|
|
143
163
|
fetch_page.call(page)
|
|
@@ -147,28 +167,28 @@ module AhoSdk
|
|
|
147
167
|
#
|
|
148
168
|
# @return [Hash]
|
|
149
169
|
def get(id:)
|
|
150
|
-
@client.get("/
|
|
170
|
+
@client.get("/v1/account/signing_keys/#{id}")
|
|
151
171
|
end
|
|
152
172
|
|
|
153
173
|
# Rotate a signing key
|
|
154
174
|
#
|
|
155
175
|
# @return [Hash]
|
|
156
176
|
def rotate(id:, body: nil, idempotency_key: nil)
|
|
157
|
-
@client.post("/
|
|
177
|
+
@client.post("/v1/account/signing_keys/#{id}/rotate", body: body, idempotency_key: idempotency_key)
|
|
158
178
|
end
|
|
159
179
|
|
|
160
180
|
# Revoke a signing key
|
|
161
181
|
#
|
|
162
182
|
# @return [Hash]
|
|
163
183
|
def revoke(id:, idempotency_key: nil)
|
|
164
|
-
@client.post("/
|
|
184
|
+
@client.post("/v1/account/signing_keys/#{id}/revoke", idempotency_key: idempotency_key)
|
|
165
185
|
end
|
|
166
186
|
|
|
167
187
|
# Download X.509 certificate
|
|
168
188
|
#
|
|
169
189
|
# @return [Hash]
|
|
170
190
|
def certificate(id:, domain: nil)
|
|
171
|
-
@client.get("/
|
|
191
|
+
@client.get("/v1/account/signing_keys/#{id}/certificate", params: { domain: domain })
|
|
172
192
|
end
|
|
173
193
|
end
|
|
174
194
|
|
|
@@ -184,42 +204,42 @@ module AhoSdk
|
|
|
184
204
|
#
|
|
185
205
|
# @return [Hash]
|
|
186
206
|
def list
|
|
187
|
-
@client.get("/
|
|
207
|
+
@client.get("/v1/account/webhooks")
|
|
188
208
|
end
|
|
189
209
|
|
|
190
210
|
# Create webhook
|
|
191
211
|
#
|
|
192
212
|
# @return [Hash]
|
|
193
213
|
def create(body: nil, idempotency_key: nil)
|
|
194
|
-
@client.post("/
|
|
214
|
+
@client.post("/v1/account/webhooks", body: body, idempotency_key: idempotency_key)
|
|
195
215
|
end
|
|
196
216
|
|
|
197
217
|
# Get webhook details
|
|
198
218
|
#
|
|
199
219
|
# @return [Hash]
|
|
200
220
|
def get
|
|
201
|
-
@client.get("/
|
|
221
|
+
@client.get("/v1/account/webhooks/primary")
|
|
202
222
|
end
|
|
203
223
|
|
|
204
224
|
# Update webhook
|
|
205
225
|
#
|
|
206
226
|
# @return [Hash]
|
|
207
227
|
def update(body: nil, idempotency_key: nil)
|
|
208
|
-
@client.patch("/
|
|
228
|
+
@client.patch("/v1/account/webhooks/primary", body: body, idempotency_key: idempotency_key)
|
|
209
229
|
end
|
|
210
230
|
|
|
211
231
|
# Delete webhook
|
|
212
232
|
#
|
|
213
233
|
# @return [Hash]
|
|
214
234
|
def delete
|
|
215
|
-
@client.delete("/
|
|
235
|
+
@client.delete("/v1/account/webhooks/primary")
|
|
216
236
|
end
|
|
217
237
|
|
|
218
238
|
# Test webhook
|
|
219
239
|
#
|
|
220
240
|
# @return [Hash]
|
|
221
241
|
def test(idempotency_key: nil)
|
|
222
|
-
@client.post("/
|
|
242
|
+
@client.post("/v1/account/webhooks/primary/test", idempotency_key: idempotency_key)
|
|
223
243
|
end
|
|
224
244
|
end
|
|
225
245
|
end
|
data/lib/aho_sdk/holder.rb
CHANGED
|
@@ -16,10 +16,10 @@ module AhoSdk
|
|
|
16
16
|
#
|
|
17
17
|
class Holder
|
|
18
18
|
# @param api_key [String] API key for authentication
|
|
19
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
19
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
20
20
|
# @param timeout [Integer] Request timeout in seconds (default: 30)
|
|
21
21
|
# @param logger [Logger] Optional logger for debugging
|
|
22
|
-
def initialize(api_key:, base_url: "https://aho.com", timeout: 30, logger: nil)
|
|
22
|
+
def initialize(api_key:, base_url: "https://api.aho.com", timeout: 30, logger: nil)
|
|
23
23
|
@client = HttpClient.new(api_key: api_key, base_url: base_url, timeout: timeout, logger: logger)
|
|
24
24
|
@credentials = CredentialsResource.new(@client)
|
|
25
25
|
@presentations = PresentationsResource.new(@client)
|
|
@@ -44,17 +44,17 @@ module AhoSdk
|
|
|
44
44
|
# @return [Hash]
|
|
45
45
|
def list(page: nil, per_page: nil, status: nil, sort: nil, direction: nil)
|
|
46
46
|
fetch_page = ->(p) {
|
|
47
|
-
response = @client.get("/
|
|
47
|
+
response = @client.get("/v1/holder/credentials", params: { page: p, per_page: per_page, status: status, sort: sort, direction: direction })
|
|
48
48
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
49
49
|
}
|
|
50
50
|
fetch_page.call(page)
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
# Get credential details
|
|
53
|
+
# Get holder credential details
|
|
54
54
|
#
|
|
55
55
|
# @return [Hash]
|
|
56
56
|
def get(uuid:)
|
|
57
|
-
@client.get("/
|
|
57
|
+
@client.get("/v1/holder/credentials/#{uuid}")
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
|
|
@@ -71,7 +71,7 @@ module AhoSdk
|
|
|
71
71
|
# @return [Hash]
|
|
72
72
|
def list(page: nil, per_page: nil, status: nil, credential_uuid: nil, sort: nil, direction: nil)
|
|
73
73
|
fetch_page = ->(p) {
|
|
74
|
-
response = @client.get("/
|
|
74
|
+
response = @client.get("/v1/holder/presentations", params: { page: p, per_page: per_page, status: status, credential_uuid: credential_uuid, sort: sort, direction: direction })
|
|
75
75
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
76
76
|
}
|
|
77
77
|
fetch_page.call(page)
|
|
@@ -81,21 +81,21 @@ module AhoSdk
|
|
|
81
81
|
#
|
|
82
82
|
# @return [Hash]
|
|
83
83
|
def create(body: nil, idempotency_key: nil)
|
|
84
|
-
@client.post("/
|
|
84
|
+
@client.post("/v1/holder/presentations", body: body, idempotency_key: idempotency_key)
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
# Get presentation details
|
|
88
88
|
#
|
|
89
89
|
# @return [Hash]
|
|
90
90
|
def get(uuid:)
|
|
91
|
-
@client.get("/
|
|
91
|
+
@client.get("/v1/holder/presentations/#{uuid}")
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
# Revoke a presentation
|
|
95
95
|
#
|
|
96
96
|
# @return [Hash]
|
|
97
97
|
def delete(uuid:)
|
|
98
|
-
@client.delete("/
|
|
98
|
+
@client.delete("/v1/holder/presentations/#{uuid}")
|
|
99
99
|
end
|
|
100
100
|
end
|
|
101
101
|
end
|
data/lib/aho_sdk/http_client.rb
CHANGED
|
@@ -23,7 +23,7 @@ module AhoSdk
|
|
|
23
23
|
# @param max_retries [Integer] Maximum number of retries on rate limit (default: 3)
|
|
24
24
|
# @param retry_delay [Float] Base delay in seconds for exponential backoff (default: 1.0)
|
|
25
25
|
# @param logger [Logger, nil] Optional logger for debugging
|
|
26
|
-
def initialize(api_key:, base_url: "https://aho.com", timeout: DEFAULT_TIMEOUT, max_retries: DEFAULT_MAX_RETRIES, retry_delay: DEFAULT_RETRY_DELAY, logger: nil)
|
|
26
|
+
def initialize(api_key:, base_url: "https://api.aho.com", timeout: DEFAULT_TIMEOUT, max_retries: DEFAULT_MAX_RETRIES, retry_delay: DEFAULT_RETRY_DELAY, logger: nil)
|
|
27
27
|
@api_key = api_key
|
|
28
28
|
@base_url = base_url.chomp("/")
|
|
29
29
|
@timeout = timeout
|
data/lib/aho_sdk/issuer.rb
CHANGED
|
@@ -13,9 +13,6 @@ module AhoSdk
|
|
|
13
13
|
# client = AhoSdk::Issuer.new(api_key: ENV["AHO_ISSUER_API_KEY"])
|
|
14
14
|
# client.automations.list
|
|
15
15
|
# client.credentials.list
|
|
16
|
-
# client.revoke_batch.list
|
|
17
|
-
# client.suspend_batch.list
|
|
18
|
-
# client.reinstate_batch.list
|
|
19
16
|
# client.data_source_mappings.list
|
|
20
17
|
# client.data_sources.list
|
|
21
18
|
# client.offers.list
|
|
@@ -24,16 +21,13 @@ module AhoSdk
|
|
|
24
21
|
#
|
|
25
22
|
class Issuer
|
|
26
23
|
# @param api_key [String] API key for authentication
|
|
27
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
24
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
28
25
|
# @param timeout [Integer] Request timeout in seconds (default: 30)
|
|
29
26
|
# @param logger [Logger] Optional logger for debugging
|
|
30
|
-
def initialize(api_key:, base_url: "https://aho.com", timeout: 30, logger: nil)
|
|
27
|
+
def initialize(api_key:, base_url: "https://api.aho.com", timeout: 30, logger: nil)
|
|
31
28
|
@client = HttpClient.new(api_key: api_key, base_url: base_url, timeout: timeout, logger: logger)
|
|
32
29
|
@automations = AutomationsResource.new(@client)
|
|
33
30
|
@credentials = CredentialsResource.new(@client)
|
|
34
|
-
@revoke_batch = RevokeBatchResource.new(@client)
|
|
35
|
-
@suspend_batch = SuspendBatchResource.new(@client)
|
|
36
|
-
@reinstate_batch = ReinstateBatchResource.new(@client)
|
|
37
31
|
@data_source_mappings = DataSourceMappingsResource.new(@client)
|
|
38
32
|
@data_sources = DataSourcesResource.new(@client)
|
|
39
33
|
@offers = OffersResource.new(@client)
|
|
@@ -45,12 +39,6 @@ module AhoSdk
|
|
|
45
39
|
attr_reader :automations
|
|
46
40
|
# @return [CredentialsResource]
|
|
47
41
|
attr_reader :credentials
|
|
48
|
-
# @return [RevokeBatchResource]
|
|
49
|
-
attr_reader :revoke_batch
|
|
50
|
-
# @return [SuspendBatchResource]
|
|
51
|
-
attr_reader :suspend_batch
|
|
52
|
-
# @return [ReinstateBatchResource]
|
|
53
|
-
attr_reader :reinstate_batch
|
|
54
42
|
# @return [DataSourceMappingsResource]
|
|
55
43
|
attr_reader :data_source_mappings
|
|
56
44
|
# @return [DataSourcesResource]
|
|
@@ -75,28 +63,28 @@ module AhoSdk
|
|
|
75
63
|
#
|
|
76
64
|
# @return [Hash]
|
|
77
65
|
def get_webhook(automation_id:)
|
|
78
|
-
@client.get("/
|
|
66
|
+
@client.get("/v1/issuer/automations/#{automation_id}/webhook")
|
|
79
67
|
end
|
|
80
68
|
|
|
81
69
|
# Generate webhook token
|
|
82
70
|
#
|
|
83
71
|
# @return [Hash]
|
|
84
72
|
def create_webhook(automation_id:, idempotency_key: nil)
|
|
85
|
-
@client.post("/
|
|
73
|
+
@client.post("/v1/issuer/automations/#{automation_id}/webhook", idempotency_key: idempotency_key)
|
|
86
74
|
end
|
|
87
75
|
|
|
88
76
|
# Revoke webhook token
|
|
89
77
|
#
|
|
90
78
|
# @return [Hash]
|
|
91
79
|
def delete_webhook(automation_id:)
|
|
92
|
-
@client.delete("/
|
|
80
|
+
@client.delete("/v1/issuer/automations/#{automation_id}/webhook")
|
|
93
81
|
end
|
|
94
82
|
|
|
95
83
|
# Create an automation
|
|
96
84
|
#
|
|
97
85
|
# @return [Hash]
|
|
98
86
|
def create(body: nil, idempotency_key: nil)
|
|
99
|
-
@client.post("/
|
|
87
|
+
@client.post("/v1/issuer/automations", body: body, idempotency_key: idempotency_key)
|
|
100
88
|
end
|
|
101
89
|
|
|
102
90
|
# List automations
|
|
@@ -104,7 +92,7 @@ module AhoSdk
|
|
|
104
92
|
# @return [Hash]
|
|
105
93
|
def list(status: nil, trigger_mode: nil, page: nil, per_page: nil)
|
|
106
94
|
fetch_page = ->(p) {
|
|
107
|
-
response = @client.get("/
|
|
95
|
+
response = @client.get("/v1/issuer/automations", params: { status: status, trigger_mode: trigger_mode, page: p, per_page: per_page })
|
|
108
96
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
109
97
|
}
|
|
110
98
|
fetch_page.call(page)
|
|
@@ -114,42 +102,42 @@ module AhoSdk
|
|
|
114
102
|
#
|
|
115
103
|
# @return [Hash]
|
|
116
104
|
def get(id:)
|
|
117
|
-
@client.get("/
|
|
105
|
+
@client.get("/v1/issuer/automations/#{id}")
|
|
118
106
|
end
|
|
119
107
|
|
|
120
108
|
# Update an automation
|
|
121
109
|
#
|
|
122
110
|
# @return [Hash]
|
|
123
111
|
def update(id:, body: nil, idempotency_key: nil)
|
|
124
|
-
@client.patch("/
|
|
112
|
+
@client.patch("/v1/issuer/automations/#{id}", body: body, idempotency_key: idempotency_key)
|
|
125
113
|
end
|
|
126
114
|
|
|
127
115
|
# Delete an automation
|
|
128
116
|
#
|
|
129
117
|
# @return [Hash]
|
|
130
118
|
def delete(id:)
|
|
131
|
-
@client.delete("/
|
|
119
|
+
@client.delete("/v1/issuer/automations/#{id}")
|
|
132
120
|
end
|
|
133
121
|
|
|
134
122
|
# Trigger an automation
|
|
135
123
|
#
|
|
136
124
|
# @return [Hash]
|
|
137
125
|
def trigger(id:, idempotency_key: nil)
|
|
138
|
-
@client.post("/
|
|
126
|
+
@client.post("/v1/issuer/automations/#{id}/trigger", idempotency_key: idempotency_key)
|
|
139
127
|
end
|
|
140
128
|
|
|
141
129
|
# Pause an automation
|
|
142
130
|
#
|
|
143
131
|
# @return [Hash]
|
|
144
132
|
def pause(id:, idempotency_key: nil)
|
|
145
|
-
@client.post("/
|
|
133
|
+
@client.post("/v1/issuer/automations/#{id}/pause", idempotency_key: idempotency_key)
|
|
146
134
|
end
|
|
147
135
|
|
|
148
136
|
# Resume an automation
|
|
149
137
|
#
|
|
150
138
|
# @return [Hash]
|
|
151
139
|
def resume(id:, idempotency_key: nil)
|
|
152
|
-
@client.post("/
|
|
140
|
+
@client.post("/v1/issuer/automations/#{id}/resume", idempotency_key: idempotency_key)
|
|
153
141
|
end
|
|
154
142
|
end
|
|
155
143
|
|
|
@@ -165,7 +153,7 @@ module AhoSdk
|
|
|
165
153
|
#
|
|
166
154
|
# @return [Hash]
|
|
167
155
|
def create(body: nil, idempotency_key: nil)
|
|
168
|
-
@client.post("/
|
|
156
|
+
@client.post("/v1/issuer/credentials", body: body, idempotency_key: idempotency_key)
|
|
169
157
|
end
|
|
170
158
|
|
|
171
159
|
# List credentials
|
|
@@ -173,100 +161,73 @@ module AhoSdk
|
|
|
173
161
|
# @return [Hash]
|
|
174
162
|
def list(status: nil, schema: nil, subject_identifier: nil, issued_after: nil, issued_before: nil, expires_after: nil, expires_before: nil, sort: "issued_at", direction: "desc", page: 1, per_page: 25)
|
|
175
163
|
fetch_page = ->(p) {
|
|
176
|
-
response = @client.get("/
|
|
164
|
+
response = @client.get("/v1/issuer/credentials", params: { status: status, schema: schema, subject_identifier: subject_identifier, issued_after: issued_after, issued_before: issued_before, expires_after: expires_after, expires_before: expires_before, sort: sort, direction: direction, page: p, per_page: per_page })
|
|
177
165
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
178
166
|
}
|
|
179
167
|
fetch_page.call(page)
|
|
180
168
|
end
|
|
181
169
|
|
|
182
|
-
# Get credential details
|
|
170
|
+
# Get issued credential details
|
|
183
171
|
#
|
|
184
172
|
# @return [Hash]
|
|
185
173
|
def get(uuid:)
|
|
186
|
-
@client.get("/
|
|
174
|
+
@client.get("/v1/issuer/credentials/#{uuid}")
|
|
187
175
|
end
|
|
188
176
|
|
|
189
177
|
# Revoke a credential
|
|
190
178
|
#
|
|
191
179
|
# @return [Hash]
|
|
192
180
|
def revoke(uuid:, body: nil, idempotency_key: nil)
|
|
193
|
-
@client.post("/
|
|
181
|
+
@client.post("/v1/issuer/credentials/#{uuid}/revoke", body: body, idempotency_key: idempotency_key)
|
|
194
182
|
end
|
|
195
183
|
|
|
196
184
|
# Suspend a credential
|
|
197
185
|
#
|
|
198
186
|
# @return [Hash]
|
|
199
187
|
def suspend(uuid:, idempotency_key: nil)
|
|
200
|
-
@client.post("/
|
|
188
|
+
@client.post("/v1/issuer/credentials/#{uuid}/suspend", idempotency_key: idempotency_key)
|
|
201
189
|
end
|
|
202
190
|
|
|
203
191
|
# Reinstate a suspended credential
|
|
204
192
|
#
|
|
205
193
|
# @return [Hash]
|
|
206
194
|
def reinstate(uuid:, idempotency_key: nil)
|
|
207
|
-
@client.post("/
|
|
195
|
+
@client.post("/v1/issuer/credentials/#{uuid}/reinstate", idempotency_key: idempotency_key)
|
|
208
196
|
end
|
|
209
197
|
|
|
210
198
|
# Get credential status
|
|
211
199
|
#
|
|
212
200
|
# @return [Hash]
|
|
213
201
|
def status(uuid:)
|
|
214
|
-
@client.get("/
|
|
202
|
+
@client.get("/v1/issuer/credentials/#{uuid}/status")
|
|
215
203
|
end
|
|
216
204
|
|
|
217
205
|
# Get credential history
|
|
218
206
|
#
|
|
219
207
|
# @return [Hash]
|
|
220
208
|
def history(uuid:)
|
|
221
|
-
@client.get("/
|
|
222
|
-
end
|
|
223
|
-
end
|
|
224
|
-
|
|
225
|
-
# Revoke_batch resource operations
|
|
226
|
-
# @api private
|
|
227
|
-
class RevokeBatchResource
|
|
228
|
-
# @api private
|
|
229
|
-
def initialize(client)
|
|
230
|
-
@client = client
|
|
209
|
+
@client.get("/v1/issuer/credentials/#{uuid}/history")
|
|
231
210
|
end
|
|
232
211
|
|
|
233
212
|
# Revoke multiple credentials
|
|
234
213
|
#
|
|
235
214
|
# @return [Hash]
|
|
236
|
-
def
|
|
237
|
-
@client.post("/
|
|
238
|
-
end
|
|
239
|
-
end
|
|
240
|
-
|
|
241
|
-
# Suspend_batch resource operations
|
|
242
|
-
# @api private
|
|
243
|
-
class SuspendBatchResource
|
|
244
|
-
# @api private
|
|
245
|
-
def initialize(client)
|
|
246
|
-
@client = client
|
|
215
|
+
def revoke_batch(body: nil, idempotency_key: nil)
|
|
216
|
+
@client.post("/v1/issuer/credentials/revoke_batch", body: body, idempotency_key: idempotency_key)
|
|
247
217
|
end
|
|
248
218
|
|
|
249
219
|
# Suspend multiple credentials
|
|
250
220
|
#
|
|
251
221
|
# @return [Hash]
|
|
252
|
-
def
|
|
253
|
-
@client.post("/
|
|
254
|
-
end
|
|
255
|
-
end
|
|
256
|
-
|
|
257
|
-
# Reinstate_batch resource operations
|
|
258
|
-
# @api private
|
|
259
|
-
class ReinstateBatchResource
|
|
260
|
-
# @api private
|
|
261
|
-
def initialize(client)
|
|
262
|
-
@client = client
|
|
222
|
+
def suspend_batch(body: nil, idempotency_key: nil)
|
|
223
|
+
@client.post("/v1/issuer/credentials/suspend_batch", body: body, idempotency_key: idempotency_key)
|
|
263
224
|
end
|
|
264
225
|
|
|
265
226
|
# Reinstate multiple credentials
|
|
266
227
|
#
|
|
267
228
|
# @return [Hash]
|
|
268
|
-
def
|
|
269
|
-
@client.post("/
|
|
229
|
+
def reinstate_batch(body: nil, idempotency_key: nil)
|
|
230
|
+
@client.post("/v1/issuer/credentials/reinstate_batch", body: body, idempotency_key: idempotency_key)
|
|
270
231
|
end
|
|
271
232
|
end
|
|
272
233
|
|
|
@@ -282,7 +243,7 @@ module AhoSdk
|
|
|
282
243
|
#
|
|
283
244
|
# @return [Hash]
|
|
284
245
|
def create(body: nil, idempotency_key: nil)
|
|
285
|
-
@client.post("/
|
|
246
|
+
@client.post("/v1/issuer/data_source_mappings", body: body, idempotency_key: idempotency_key)
|
|
286
247
|
end
|
|
287
248
|
|
|
288
249
|
# List data source mappings
|
|
@@ -290,7 +251,7 @@ module AhoSdk
|
|
|
290
251
|
# @return [Hash]
|
|
291
252
|
def list(data_source: nil, credential_schema: nil, page: nil, per_page: nil)
|
|
292
253
|
fetch_page = ->(p) {
|
|
293
|
-
response = @client.get("/
|
|
254
|
+
response = @client.get("/v1/issuer/data_source_mappings", params: { data_source: data_source, credential_schema: credential_schema, page: p, per_page: per_page })
|
|
294
255
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
295
256
|
}
|
|
296
257
|
fetch_page.call(page)
|
|
@@ -300,21 +261,21 @@ module AhoSdk
|
|
|
300
261
|
#
|
|
301
262
|
# @return [Hash]
|
|
302
263
|
def get(id:)
|
|
303
|
-
@client.get("/
|
|
264
|
+
@client.get("/v1/issuer/data_source_mappings/#{id}")
|
|
304
265
|
end
|
|
305
266
|
|
|
306
267
|
# Update a mapping
|
|
307
268
|
#
|
|
308
269
|
# @return [Hash]
|
|
309
270
|
def update(id:, body: nil, idempotency_key: nil)
|
|
310
|
-
@client.patch("/
|
|
271
|
+
@client.patch("/v1/issuer/data_source_mappings/#{id}", body: body, idempotency_key: idempotency_key)
|
|
311
272
|
end
|
|
312
273
|
|
|
313
274
|
# Delete a mapping
|
|
314
275
|
#
|
|
315
276
|
# @return [Hash]
|
|
316
277
|
def delete(id:)
|
|
317
|
-
@client.delete("/
|
|
278
|
+
@client.delete("/v1/issuer/data_source_mappings/#{id}")
|
|
318
279
|
end
|
|
319
280
|
end
|
|
320
281
|
|
|
@@ -330,7 +291,7 @@ module AhoSdk
|
|
|
330
291
|
#
|
|
331
292
|
# @return [Hash]
|
|
332
293
|
def create(body: nil, idempotency_key: nil)
|
|
333
|
-
@client.post("/
|
|
294
|
+
@client.post("/v1/issuer/data_sources", body: body, idempotency_key: idempotency_key)
|
|
334
295
|
end
|
|
335
296
|
|
|
336
297
|
# List data sources
|
|
@@ -338,7 +299,7 @@ module AhoSdk
|
|
|
338
299
|
# @return [Hash]
|
|
339
300
|
def list(status: nil, source_type: nil, page: nil, per_page: nil)
|
|
340
301
|
fetch_page = ->(p) {
|
|
341
|
-
response = @client.get("/
|
|
302
|
+
response = @client.get("/v1/issuer/data_sources", params: { status: status, source_type: source_type, page: p, per_page: per_page })
|
|
342
303
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
343
304
|
}
|
|
344
305
|
fetch_page.call(page)
|
|
@@ -348,28 +309,28 @@ module AhoSdk
|
|
|
348
309
|
#
|
|
349
310
|
# @return [Hash]
|
|
350
311
|
def get(id:)
|
|
351
|
-
@client.get("/
|
|
312
|
+
@client.get("/v1/issuer/data_sources/#{id}")
|
|
352
313
|
end
|
|
353
314
|
|
|
354
315
|
# Update a data source
|
|
355
316
|
#
|
|
356
317
|
# @return [Hash]
|
|
357
318
|
def update(id:, body: nil, idempotency_key: nil)
|
|
358
|
-
@client.patch("/
|
|
319
|
+
@client.patch("/v1/issuer/data_sources/#{id}", body: body, idempotency_key: idempotency_key)
|
|
359
320
|
end
|
|
360
321
|
|
|
361
322
|
# Delete a data source
|
|
362
323
|
#
|
|
363
324
|
# @return [Hash]
|
|
364
325
|
def delete(id:)
|
|
365
|
-
@client.delete("/
|
|
326
|
+
@client.delete("/v1/issuer/data_sources/#{id}")
|
|
366
327
|
end
|
|
367
328
|
|
|
368
329
|
# Test data source connection
|
|
369
330
|
#
|
|
370
331
|
# @return [Hash]
|
|
371
332
|
def test(id:, idempotency_key: nil)
|
|
372
|
-
@client.post("/
|
|
333
|
+
@client.post("/v1/issuer/data_sources/#{id}/test", idempotency_key: idempotency_key)
|
|
373
334
|
end
|
|
374
335
|
end
|
|
375
336
|
|
|
@@ -386,7 +347,7 @@ module AhoSdk
|
|
|
386
347
|
# @return [Hash]
|
|
387
348
|
def list(page: nil, per_page: nil, status: nil, created_after: nil, created_before: nil, expires_after: nil, expires_before: nil, schema: nil, subject_identifier: nil, sort: nil, direction: nil)
|
|
388
349
|
fetch_page = ->(p) {
|
|
389
|
-
response = @client.get("/
|
|
350
|
+
response = @client.get("/v1/issuer/offers", params: { page: p, per_page: per_page, status: status, created_after: created_after, created_before: created_before, expires_after: expires_after, expires_before: expires_before, schema: schema, subject_identifier: subject_identifier, sort: sort, direction: direction })
|
|
390
351
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
391
352
|
}
|
|
392
353
|
fetch_page.call(page)
|
|
@@ -396,21 +357,21 @@ module AhoSdk
|
|
|
396
357
|
#
|
|
397
358
|
# @return [Hash]
|
|
398
359
|
def create(body: nil, idempotency_key: nil)
|
|
399
|
-
@client.post("/
|
|
360
|
+
@client.post("/v1/issuer/offers", body: body, idempotency_key: idempotency_key)
|
|
400
361
|
end
|
|
401
362
|
|
|
402
363
|
# Get credential offer details
|
|
403
364
|
#
|
|
404
365
|
# @return [Hash]
|
|
405
366
|
def get(uuid:)
|
|
406
|
-
@client.get("/
|
|
367
|
+
@client.get("/v1/issuer/offers/#{uuid}")
|
|
407
368
|
end
|
|
408
369
|
|
|
409
370
|
# Revoke a credential offer
|
|
410
371
|
#
|
|
411
372
|
# @return [Hash]
|
|
412
373
|
def revoke(uuid:, idempotency_key: nil)
|
|
413
|
-
@client.post("/
|
|
374
|
+
@client.post("/v1/issuer/offers/#{uuid}/revoke", idempotency_key: idempotency_key)
|
|
414
375
|
end
|
|
415
376
|
end
|
|
416
377
|
|
|
@@ -426,15 +387,15 @@ module AhoSdk
|
|
|
426
387
|
#
|
|
427
388
|
# @return [Hash]
|
|
428
389
|
def create(body: nil, idempotency_key: nil)
|
|
429
|
-
@client.post("/
|
|
390
|
+
@client.post("/v1/issuer/schemas", body: body, idempotency_key: idempotency_key)
|
|
430
391
|
end
|
|
431
392
|
|
|
432
|
-
# List credential schemas
|
|
393
|
+
# List issuer credential schemas
|
|
433
394
|
#
|
|
434
395
|
# @return [Hash]
|
|
435
|
-
def list(status: nil, page:
|
|
396
|
+
def list(status: nil, page: nil, per_page: nil)
|
|
436
397
|
fetch_page = ->(p) {
|
|
437
|
-
response = @client.get("/
|
|
398
|
+
response = @client.get("/v1/issuer/schemas", params: { status: status, page: p, per_page: per_page })
|
|
438
399
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
439
400
|
}
|
|
440
401
|
fetch_page.call(page)
|
|
@@ -444,35 +405,35 @@ module AhoSdk
|
|
|
444
405
|
#
|
|
445
406
|
# @return [Hash]
|
|
446
407
|
def get(id:)
|
|
447
|
-
@client.get("/
|
|
408
|
+
@client.get("/v1/issuer/schemas/#{id}")
|
|
448
409
|
end
|
|
449
410
|
|
|
450
411
|
# Update a draft credential schema
|
|
451
412
|
#
|
|
452
413
|
# @return [Hash]
|
|
453
414
|
def update(id:, body: nil, idempotency_key: nil)
|
|
454
|
-
@client.patch("/
|
|
415
|
+
@client.patch("/v1/issuer/schemas/#{id}", body: body, idempotency_key: idempotency_key)
|
|
455
416
|
end
|
|
456
417
|
|
|
457
418
|
# Delete a draft credential schema
|
|
458
419
|
#
|
|
459
420
|
# @return [Hash]
|
|
460
421
|
def delete(id:)
|
|
461
|
-
@client.delete("/
|
|
422
|
+
@client.delete("/v1/issuer/schemas/#{id}")
|
|
462
423
|
end
|
|
463
424
|
|
|
464
425
|
# Activate a draft credential schema
|
|
465
426
|
#
|
|
466
427
|
# @return [Hash]
|
|
467
428
|
def activate(id:, idempotency_key: nil)
|
|
468
|
-
@client.post("/
|
|
429
|
+
@client.post("/v1/issuer/schemas/#{id}/activate", idempotency_key: idempotency_key)
|
|
469
430
|
end
|
|
470
431
|
|
|
471
432
|
# Archive an active credential schema
|
|
472
433
|
#
|
|
473
434
|
# @return [Hash]
|
|
474
435
|
def archive(id:, idempotency_key: nil)
|
|
475
|
-
@client.post("/
|
|
436
|
+
@client.post("/v1/issuer/schemas/#{id}/archive", idempotency_key: idempotency_key)
|
|
476
437
|
end
|
|
477
438
|
end
|
|
478
439
|
|
|
@@ -488,14 +449,14 @@ module AhoSdk
|
|
|
488
449
|
#
|
|
489
450
|
# @return [Hash]
|
|
490
451
|
def get(uuid:)
|
|
491
|
-
@client.get("/
|
|
452
|
+
@client.get("/v1/issuer/verify/#{uuid}")
|
|
492
453
|
end
|
|
493
454
|
|
|
494
455
|
# Verify a credential
|
|
495
456
|
#
|
|
496
457
|
# @return [Hash]
|
|
497
458
|
def create(body: nil, idempotency_key: nil)
|
|
498
|
-
@client.post("/
|
|
459
|
+
@client.post("/v1/issuer/verify", body: body, idempotency_key: idempotency_key)
|
|
499
460
|
end
|
|
500
461
|
end
|
|
501
462
|
end
|
data/lib/aho_sdk/schemas.rb
CHANGED
|
@@ -15,10 +15,10 @@ module AhoSdk
|
|
|
15
15
|
#
|
|
16
16
|
class Schemas
|
|
17
17
|
# @param api_key [String] API key for authentication
|
|
18
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
18
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
19
19
|
# @param timeout [Integer] Request timeout in seconds (default: 30)
|
|
20
20
|
# @param logger [Logger] Optional logger for debugging
|
|
21
|
-
def initialize(api_key:, base_url: "https://aho.com", timeout: 30, logger: nil)
|
|
21
|
+
def initialize(api_key:, base_url: "https://api.aho.com", timeout: 30, logger: nil)
|
|
22
22
|
@client = HttpClient.new(api_key: api_key, base_url: base_url, timeout: timeout, logger: logger)
|
|
23
23
|
@render_templates = RenderTemplatesResource.new(@client)
|
|
24
24
|
end
|
|
@@ -40,7 +40,7 @@ module AhoSdk
|
|
|
40
40
|
# @return [Hash]
|
|
41
41
|
def list(schema_id:)
|
|
42
42
|
fetch_page = ->(p) {
|
|
43
|
-
response = @client.get("/
|
|
43
|
+
response = @client.get("/v1/schemas/#{schema_id}/render_templates")
|
|
44
44
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
45
45
|
}
|
|
46
46
|
fetch_page.call(1)
|
|
@@ -50,35 +50,35 @@ module AhoSdk
|
|
|
50
50
|
#
|
|
51
51
|
# @return [Hash]
|
|
52
52
|
def create(schema_id:, body: nil, idempotency_key: nil)
|
|
53
|
-
@client.post("/
|
|
53
|
+
@client.post("/v1/schemas/#{schema_id}/render_templates", body: body, idempotency_key: idempotency_key)
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
# Get render template
|
|
57
57
|
#
|
|
58
58
|
# @return [Hash]
|
|
59
59
|
def get(schema_id:, id:)
|
|
60
|
-
@client.get("/
|
|
60
|
+
@client.get("/v1/schemas/#{schema_id}/render_templates/#{id}")
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
# Update render template
|
|
64
64
|
#
|
|
65
65
|
# @return [Hash]
|
|
66
66
|
def update(schema_id:, id:, body: nil, idempotency_key: nil)
|
|
67
|
-
@client.patch("/
|
|
67
|
+
@client.patch("/v1/schemas/#{schema_id}/render_templates/#{id}", body: body, idempotency_key: idempotency_key)
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
# Delete render template
|
|
71
71
|
#
|
|
72
72
|
# @return [Hash]
|
|
73
73
|
def delete(schema_id:, id:)
|
|
74
|
-
@client.delete("/
|
|
74
|
+
@client.delete("/v1/schemas/#{schema_id}/render_templates/#{id}")
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
# Validate template
|
|
78
78
|
#
|
|
79
79
|
# @return [Hash]
|
|
80
80
|
def validate(schema_id:, body: nil, idempotency_key: nil)
|
|
81
|
-
@client.post("/
|
|
81
|
+
@client.post("/v1/schemas/#{schema_id}/render_templates/validate", body: body, idempotency_key: idempotency_key)
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
84
|
end
|
data/lib/aho_sdk/system.rb
CHANGED
|
@@ -15,10 +15,10 @@ module AhoSdk
|
|
|
15
15
|
#
|
|
16
16
|
class System
|
|
17
17
|
# @param api_key [String] API key for authentication
|
|
18
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
18
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
19
19
|
# @param timeout [Integer] Request timeout in seconds (default: 30)
|
|
20
20
|
# @param logger [Logger] Optional logger for debugging
|
|
21
|
-
def initialize(api_key:, base_url: "https://aho.com", timeout: 30, logger: nil)
|
|
21
|
+
def initialize(api_key:, base_url: "https://api.aho.com", timeout: 30, logger: nil)
|
|
22
22
|
@client = HttpClient.new(api_key: api_key, base_url: base_url, timeout: timeout, logger: logger)
|
|
23
23
|
@health = HealthResource.new(@client)
|
|
24
24
|
end
|
|
@@ -39,7 +39,7 @@ module AhoSdk
|
|
|
39
39
|
#
|
|
40
40
|
# @return [Hash]
|
|
41
41
|
def get
|
|
42
|
-
@client.get("/
|
|
42
|
+
@client.get("/v1/health")
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
end
|
|
@@ -10,14 +10,14 @@ module AhoSdk
|
|
|
10
10
|
# Public endpoints (no authentication required)
|
|
11
11
|
#
|
|
12
12
|
# @example
|
|
13
|
-
# client = AhoSdk::
|
|
13
|
+
# client = AhoSdk::Unauthenticated.new
|
|
14
14
|
# client.schemas.list
|
|
15
15
|
#
|
|
16
|
-
class
|
|
17
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
16
|
+
class Unauthenticated
|
|
17
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
18
18
|
# @param timeout [Integer] Request timeout in seconds (default: 30)
|
|
19
19
|
# @param logger [Logger] Optional logger for debugging
|
|
20
|
-
def initialize(base_url: "https://aho.com", timeout: 30, logger: nil)
|
|
20
|
+
def initialize(base_url: "https://api.aho.com", timeout: 30, logger: nil)
|
|
21
21
|
@client = HttpClient.new(api_key: nil, base_url: base_url, timeout: timeout, logger: logger)
|
|
22
22
|
@schemas = SchemasResource.new(@client)
|
|
23
23
|
end
|
|
@@ -34,12 +34,12 @@ module AhoSdk
|
|
|
34
34
|
@client = client
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
#
|
|
37
|
+
# Browse public credential schemas
|
|
38
38
|
#
|
|
39
39
|
# @return [Hash]
|
|
40
40
|
def list(category: nil, tag: nil, q: nil, page: nil, per_page: nil)
|
|
41
41
|
fetch_page = ->(p) {
|
|
42
|
-
response = @client.get("/
|
|
42
|
+
response = @client.get("/v1/schemas", params: { category: category, tag: tag, q: q, page: p, per_page: per_page })
|
|
43
43
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
44
44
|
}
|
|
45
45
|
fetch_page.call(page)
|
|
@@ -50,7 +50,7 @@ module AhoSdk
|
|
|
50
50
|
# @return [Hash]
|
|
51
51
|
def get(slug:)
|
|
52
52
|
fetch_page = ->(p) {
|
|
53
|
-
response = @client.get("/
|
|
53
|
+
response = @client.get("/v1/schemas/#{slug}")
|
|
54
54
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
55
55
|
}
|
|
56
56
|
fetch_page.call(1)
|
data/lib/aho_sdk/verifier.rb
CHANGED
|
@@ -12,23 +12,31 @@ module AhoSdk
|
|
|
12
12
|
# @example
|
|
13
13
|
# client = AhoSdk::Verifier.new(api_key: ENV["AHO_VERIFIER_API_KEY"])
|
|
14
14
|
# client.presentations.list
|
|
15
|
+
# client.dc_sessions.list
|
|
16
|
+
# client.render.list
|
|
15
17
|
# client.requests.list
|
|
16
18
|
# client.responses.list
|
|
17
19
|
#
|
|
18
20
|
class Verifier
|
|
19
21
|
# @param api_key [String] API key for authentication
|
|
20
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
22
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
21
23
|
# @param timeout [Integer] Request timeout in seconds (default: 30)
|
|
22
24
|
# @param logger [Logger] Optional logger for debugging
|
|
23
|
-
def initialize(api_key:, base_url: "https://aho.com", timeout: 30, logger: nil)
|
|
25
|
+
def initialize(api_key:, base_url: "https://api.aho.com", timeout: 30, logger: nil)
|
|
24
26
|
@client = HttpClient.new(api_key: api_key, base_url: base_url, timeout: timeout, logger: logger)
|
|
25
27
|
@presentations = PresentationsResource.new(@client)
|
|
28
|
+
@dc_sessions = DcSessionsResource.new(@client)
|
|
29
|
+
@render = RenderResource.new(@client)
|
|
26
30
|
@requests = RequestsResource.new(@client)
|
|
27
31
|
@responses = ResponsesResource.new(@client)
|
|
28
32
|
end
|
|
29
33
|
|
|
30
34
|
# @return [PresentationsResource]
|
|
31
35
|
attr_reader :presentations
|
|
36
|
+
# @return [DcSessionsResource]
|
|
37
|
+
attr_reader :dc_sessions
|
|
38
|
+
# @return [RenderResource]
|
|
39
|
+
attr_reader :render
|
|
32
40
|
# @return [RequestsResource]
|
|
33
41
|
attr_reader :requests
|
|
34
42
|
# @return [ResponsesResource]
|
|
@@ -47,7 +55,60 @@ module AhoSdk
|
|
|
47
55
|
#
|
|
48
56
|
# @return [Hash]
|
|
49
57
|
def verify(body: nil, idempotency_key: nil)
|
|
50
|
-
@client.post("/
|
|
58
|
+
@client.post("/v1/verifier/presentations/verify", body: body, idempotency_key: idempotency_key)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Dc_sessions resource operations
|
|
63
|
+
# @api private
|
|
64
|
+
class DcSessionsResource
|
|
65
|
+
# @api private
|
|
66
|
+
def initialize(client)
|
|
67
|
+
@client = client
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Create a DC API session
|
|
71
|
+
#
|
|
72
|
+
# @return [Hash]
|
|
73
|
+
def create(body: nil, idempotency_key: nil)
|
|
74
|
+
@client.post("/v1/verifier/dc_sessions", body: body, idempotency_key: idempotency_key)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Get DC API session status
|
|
78
|
+
#
|
|
79
|
+
# @return [Hash]
|
|
80
|
+
def get(id:)
|
|
81
|
+
@client.get("/v1/verifier/dc_sessions/#{id}")
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Verify a DC API session
|
|
85
|
+
#
|
|
86
|
+
# @return [Hash]
|
|
87
|
+
def verify(id:, body: nil, idempotency_key: nil)
|
|
88
|
+
@client.post("/v1/verifier/dc_sessions/#{id}/verify", body: body, idempotency_key: idempotency_key)
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Render resource operations
|
|
93
|
+
# @api private
|
|
94
|
+
class RenderResource
|
|
95
|
+
# @api private
|
|
96
|
+
def initialize(client)
|
|
97
|
+
@client = client
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Render verified claims as visual credential
|
|
101
|
+
#
|
|
102
|
+
# @return [Hash]
|
|
103
|
+
def list(id:, format: nil)
|
|
104
|
+
@client.get("/v1/verifier/dc_sessions/#{id}/render", params: { format: format })
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Render claims as visual credential
|
|
108
|
+
#
|
|
109
|
+
# @return [Hash]
|
|
110
|
+
def create(body: nil, idempotency_key: nil)
|
|
111
|
+
@client.post("/v1/verifier/render", body: body, idempotency_key: idempotency_key)
|
|
51
112
|
end
|
|
52
113
|
end
|
|
53
114
|
|
|
@@ -63,15 +124,15 @@ module AhoSdk
|
|
|
63
124
|
#
|
|
64
125
|
# @return [Hash]
|
|
65
126
|
def create(body: nil, idempotency_key: nil)
|
|
66
|
-
@client.post("/
|
|
127
|
+
@client.post("/v1/verifier/requests", body: body, idempotency_key: idempotency_key)
|
|
67
128
|
end
|
|
68
129
|
|
|
69
130
|
# List presentation requests
|
|
70
131
|
#
|
|
71
132
|
# @return [Hash]
|
|
72
|
-
def list(status: nil, page:
|
|
133
|
+
def list(status: nil, page: nil, per_page: nil)
|
|
73
134
|
fetch_page = ->(p) {
|
|
74
|
-
response = @client.get("/
|
|
135
|
+
response = @client.get("/v1/verifier/requests", params: { status: status, page: p, per_page: per_page })
|
|
75
136
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
76
137
|
}
|
|
77
138
|
fetch_page.call(page)
|
|
@@ -81,44 +142,44 @@ module AhoSdk
|
|
|
81
142
|
#
|
|
82
143
|
# @return [Hash]
|
|
83
144
|
def get(uuid:)
|
|
84
|
-
@client.get("/
|
|
145
|
+
@client.get("/v1/verifier/requests/#{uuid}")
|
|
85
146
|
end
|
|
86
147
|
|
|
87
148
|
# Update a draft presentation request
|
|
88
149
|
#
|
|
89
150
|
# @return [Hash]
|
|
90
151
|
def update(uuid:, body: nil, idempotency_key: nil)
|
|
91
|
-
@client.patch("/
|
|
152
|
+
@client.patch("/v1/verifier/requests/#{uuid}", body: body, idempotency_key: idempotency_key)
|
|
92
153
|
end
|
|
93
154
|
|
|
94
155
|
# Delete a draft presentation request
|
|
95
156
|
#
|
|
96
157
|
# @return [Hash]
|
|
97
158
|
def delete(uuid:)
|
|
98
|
-
@client.delete("/
|
|
159
|
+
@client.delete("/v1/verifier/requests/#{uuid}")
|
|
99
160
|
end
|
|
100
161
|
|
|
101
162
|
# Activate a draft presentation request
|
|
102
163
|
#
|
|
103
164
|
# @return [Hash]
|
|
104
165
|
def activate(uuid:, idempotency_key: nil)
|
|
105
|
-
@client.post("/
|
|
166
|
+
@client.post("/v1/verifier/requests/#{uuid}/activate", idempotency_key: idempotency_key)
|
|
106
167
|
end
|
|
107
168
|
|
|
108
169
|
# Close an active presentation request
|
|
109
170
|
#
|
|
110
171
|
# @return [Hash]
|
|
111
172
|
def close(uuid:, idempotency_key: nil)
|
|
112
|
-
@client.post("/
|
|
173
|
+
@client.post("/v1/verifier/requests/#{uuid}/close", idempotency_key: idempotency_key)
|
|
113
174
|
end
|
|
114
175
|
|
|
115
176
|
# Get QR code for presentation request
|
|
116
177
|
#
|
|
117
178
|
# @return [String]
|
|
118
|
-
def qr_code(uuid:, format:
|
|
179
|
+
def qr_code(uuid:, format: nil, output_format: :svg)
|
|
119
180
|
format_map = { svg: "image/svg+xml", png: "image/png", json: "application/json" }
|
|
120
181
|
accept = format_map[output_format] || format_map.values.first
|
|
121
|
-
@client.get("/
|
|
182
|
+
@client.get("/v1/verifier/requests/#{uuid}/qr_code", params: { format: format }, accept: accept)
|
|
122
183
|
end
|
|
123
184
|
end
|
|
124
185
|
|
|
@@ -133,9 +194,9 @@ module AhoSdk
|
|
|
133
194
|
# List responses for a presentation request
|
|
134
195
|
#
|
|
135
196
|
# @return [Hash]
|
|
136
|
-
def list(request_uuid:, status: nil, page:
|
|
197
|
+
def list(request_uuid:, status: nil, page: nil, per_page: nil)
|
|
137
198
|
fetch_page = ->(p) {
|
|
138
|
-
response = @client.get("/
|
|
199
|
+
response = @client.get("/v1/verifier/requests/#{request_uuid}/responses", params: { status: status, page: p, per_page: per_page })
|
|
139
200
|
Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
|
|
140
201
|
}
|
|
141
202
|
fetch_page.call(page)
|
|
@@ -145,7 +206,7 @@ module AhoSdk
|
|
|
145
206
|
#
|
|
146
207
|
# @return [Hash]
|
|
147
208
|
def get(request_uuid:, uuid:)
|
|
148
|
-
@client.get("/
|
|
209
|
+
@client.get("/v1/verifier/requests/#{request_uuid}/responses/#{uuid}")
|
|
149
210
|
end
|
|
150
211
|
end
|
|
151
212
|
end
|
data/lib/aho_sdk/version.rb
CHANGED
data/lib/aho_sdk.rb
CHANGED
|
@@ -18,71 +18,70 @@ require_relative "aho_sdk/issuer"
|
|
|
18
18
|
|
|
19
19
|
require_relative "aho_sdk/schemas"
|
|
20
20
|
|
|
21
|
-
require_relative "aho_sdk/
|
|
21
|
+
require_relative "aho_sdk/unauthenticated"
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
module AhoSdk
|
|
25
25
|
class << self
|
|
26
26
|
# Create a new Account client
|
|
27
27
|
# @param api_key [String] API key for authentication
|
|
28
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
28
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
29
29
|
# @return [Account]
|
|
30
|
-
def account(api_key:, base_url: "https://aho.com")
|
|
30
|
+
def account(api_key:, base_url: "https://api.aho.com")
|
|
31
31
|
Account.new(api_key: api_key, base_url: base_url)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
# Create a new System client
|
|
36
36
|
# @param api_key [String] API key for authentication
|
|
37
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
37
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
38
38
|
# @return [System]
|
|
39
|
-
def system(api_key:, base_url: "https://aho.com")
|
|
39
|
+
def system(api_key:, base_url: "https://api.aho.com")
|
|
40
40
|
System.new(api_key: api_key, base_url: base_url)
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
# Create a new Holder client
|
|
45
45
|
# @param api_key [String] API key for authentication
|
|
46
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
46
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
47
47
|
# @return [Holder]
|
|
48
|
-
def holder(api_key:, base_url: "https://aho.com")
|
|
48
|
+
def holder(api_key:, base_url: "https://api.aho.com")
|
|
49
49
|
Holder.new(api_key: api_key, base_url: base_url)
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
# Create a new Verifier client
|
|
54
54
|
# @param api_key [String] API key for authentication
|
|
55
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
55
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
56
56
|
# @return [Verifier]
|
|
57
|
-
def verifier(api_key:, base_url: "https://aho.com")
|
|
57
|
+
def verifier(api_key:, base_url: "https://api.aho.com")
|
|
58
58
|
Verifier.new(api_key: api_key, base_url: base_url)
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
# Create a new Issuer client
|
|
63
63
|
# @param api_key [String] API key for authentication
|
|
64
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
64
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
65
65
|
# @return [Issuer]
|
|
66
|
-
def issuer(api_key:, base_url: "https://aho.com")
|
|
66
|
+
def issuer(api_key:, base_url: "https://api.aho.com")
|
|
67
67
|
Issuer.new(api_key: api_key, base_url: base_url)
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
# Create a new Schemas client
|
|
72
72
|
# @param api_key [String] API key for authentication
|
|
73
|
-
# @param base_url [String] Base URL (default: https://aho.com)
|
|
73
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
74
74
|
# @return [Schemas]
|
|
75
|
-
def schemas(api_key:, base_url: "https://aho.com")
|
|
75
|
+
def schemas(api_key:, base_url: "https://api.aho.com")
|
|
76
76
|
Schemas.new(api_key: api_key, base_url: base_url)
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
# Create a new
|
|
81
|
-
# @param
|
|
82
|
-
# @
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Public.new(api_key: api_key, base_url: base_url)
|
|
80
|
+
# Create a new Unauthenticated client
|
|
81
|
+
# @param base_url [String] Base URL (default: https://api.aho.com)
|
|
82
|
+
# @return [Unauthenticated]
|
|
83
|
+
def unauthenticated(base_url: "https://api.aho.com")
|
|
84
|
+
Unauthenticated.new(base_url: base_url)
|
|
86
85
|
end
|
|
87
86
|
end
|
|
88
87
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aho-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aho
|
|
@@ -41,9 +41,9 @@ files:
|
|
|
41
41
|
- lib/aho_sdk/http_client.rb
|
|
42
42
|
- lib/aho_sdk/issuer.rb
|
|
43
43
|
- lib/aho_sdk/page.rb
|
|
44
|
-
- lib/aho_sdk/public.rb
|
|
45
44
|
- lib/aho_sdk/schemas.rb
|
|
46
45
|
- lib/aho_sdk/system.rb
|
|
46
|
+
- lib/aho_sdk/unauthenticated.rb
|
|
47
47
|
- lib/aho_sdk/verifier.rb
|
|
48
48
|
- lib/aho_sdk/version.rb
|
|
49
49
|
homepage: https://aho.com
|
|
@@ -53,7 +53,7 @@ metadata:
|
|
|
53
53
|
homepage_uri: https://aho.com
|
|
54
54
|
source_code_uri: https://github.com/aho-hq/aho-ruby
|
|
55
55
|
changelog_uri: https://github.com/aho-hq/aho-ruby/blob/main/CHANGELOG.md
|
|
56
|
-
documentation_uri: https://aho.com/
|
|
56
|
+
documentation_uri: https://aho.com/docs/sdks/api/ruby
|
|
57
57
|
rdoc_options: []
|
|
58
58
|
require_paths:
|
|
59
59
|
- lib
|