accessgrid 0.5.0 → 0.6.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/README.md +23 -0
- data/lib/accessgrid/console.rb +22 -0
- data/lib/accessgrid/request.rb +2 -1
- data/lib/accessgrid/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 611a55bbec1d43d8241d9d92601bfcaaf0f40e96e2d53330d56668311bc8dfd4
|
|
4
|
+
data.tar.gz: e9a7fe6162e349464bf93f9cda848e59deb6dc6ff91690be874ec5eab67945e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b1f579ef34c871ee9f8eea7993d8b67c173dfc3b7c173be75be979f6b008fdfaa07bfc8ddac32de84eab163d4e57a6c193f12369c43be52203c2c180062c43a
|
|
7
|
+
data.tar.gz: 16771d5080fcf568017272d1f23accaa168cff849fe5c6b2d03b3d992cd661d5548ad3551d69dd1096a3a1bc3fe9354eeae54c4be513fddd2e8d5c6cf08ce7b9
|
data/README.md
CHANGED
|
@@ -194,6 +194,12 @@ puts result.id # "0xd3adb00b5"
|
|
|
194
194
|
puts result.status # "in-review" (Apple), "ready" (Android), or "publishing" (already in flight)
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
+
#### Delete a template
|
|
198
|
+
|
|
199
|
+
```ruby
|
|
200
|
+
client.console.delete_template("0xd3adb00b5")
|
|
201
|
+
```
|
|
202
|
+
|
|
197
203
|
#### Reveal a SmartTap private key
|
|
198
204
|
|
|
199
205
|
Fetches the template's SmartTap private key, decrypted client-side. The SDK generates a fresh ephemeral P-256 keypair per call, submits the public half, and decrypts the server's response — you get the plaintext PEM back without touching any crypto.
|
|
@@ -318,6 +324,14 @@ end
|
|
|
318
324
|
client.console.webhooks.delete('abc123')
|
|
319
325
|
```
|
|
320
326
|
|
|
327
|
+
#### Verify a webhook
|
|
328
|
+
|
|
329
|
+
```ruby
|
|
330
|
+
result = client.console.webhooks.verify('abc123')
|
|
331
|
+
|
|
332
|
+
puts "Verified: #{result.verified}"
|
|
333
|
+
```
|
|
334
|
+
|
|
321
335
|
### HID Organizations
|
|
322
336
|
|
|
323
337
|
#### Create an HID org
|
|
@@ -428,6 +442,12 @@ puts "Profile created: #{profile.id}"
|
|
|
428
442
|
puts "AID: #{profile.aid}"
|
|
429
443
|
```
|
|
430
444
|
|
|
445
|
+
#### Delete a credential profile
|
|
446
|
+
|
|
447
|
+
```ruby
|
|
448
|
+
client.console.credential_profiles.delete('a1b2c3d4e5f')
|
|
449
|
+
```
|
|
450
|
+
|
|
431
451
|
## Configuration
|
|
432
452
|
|
|
433
453
|
The SDK can be configured with a custom API endpoint:
|
|
@@ -506,15 +526,18 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/access
|
|
|
506
526
|
| POST /v1/console/card-templates/{id}/ios_preflight | `console.ios_preflight()` | Y |
|
|
507
527
|
| POST /v1/console/card-templates/{id}/publish | `console.publish_template()` | Y |
|
|
508
528
|
| POST /v1/console/card-templates/{id}/smart-tap/reveal | `console.reveal_smart_tap()` | Y |
|
|
529
|
+
| DELETE /v1/console/card-templates/{id} | `console.delete_template()` | Y |
|
|
509
530
|
| GET /v1/console/ledger-items | `console.list_ledger_items()` / `console.ledger_items()` | Y |
|
|
510
531
|
| GET /v1/console/webhooks | `console.webhooks.list()` | Y |
|
|
511
532
|
| POST /v1/console/webhooks | `console.webhooks.create()` | Y |
|
|
512
533
|
| DELETE /v1/console/webhooks/{id} | `console.webhooks.delete()` | Y |
|
|
534
|
+
| POST /v1/console/webhooks/{id}/verify | `console.webhooks.verify()` | Y |
|
|
513
535
|
| GET /v1/console/landing-pages | `console.list_landing_pages()` | Y |
|
|
514
536
|
| POST /v1/console/landing-pages | `console.create_landing_page()` | Y |
|
|
515
537
|
| PUT /v1/console/landing-pages/{id} | `console.update_landing_page()` | Y |
|
|
516
538
|
| GET /v1/console/credential-profiles | `console.credential_profiles.list()` | Y |
|
|
517
539
|
| POST /v1/console/credential-profiles | `console.credential_profiles.create()` | Y |
|
|
540
|
+
| DELETE /v1/console/credential-profiles/{id} | `console.credential_profiles.delete()` | Y |
|
|
518
541
|
| POST /v1/console/hid/orgs | `console.hid.orgs.create()` | Y |
|
|
519
542
|
| POST /v1/console/hid/orgs/activate | `console.hid.orgs.activate()` | Y |
|
|
520
543
|
| GET /v1/console/hid/orgs | `console.hid.orgs.list()` | Y |
|
data/lib/accessgrid/console.rb
CHANGED
|
@@ -78,6 +78,10 @@ module AccessGrid
|
|
|
78
78
|
PublishTemplateResponse.new(response)
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
+
def delete_template(template_id)
|
|
82
|
+
@client.make_request(:delete, "/v1/console/card-templates/#{template_id}")
|
|
83
|
+
end
|
|
84
|
+
|
|
81
85
|
# Reveal the SmartTap private key for a card template, decrypted client-side.
|
|
82
86
|
#
|
|
83
87
|
# The SDK generates a fresh ephemeral P-256 keypair per call, submits the
|
|
@@ -322,6 +326,10 @@ module AccessGrid
|
|
|
322
326
|
profiles = response.is_a?(Array) ? response : response.fetch('credential_profiles', [])
|
|
323
327
|
profiles.map { |profile| CredentialProfile.new(profile) }
|
|
324
328
|
end
|
|
329
|
+
|
|
330
|
+
def delete(credential_profile_id)
|
|
331
|
+
@client.make_request(:delete, "/v1/console/credential-profiles/#{credential_profile_id}")
|
|
332
|
+
end
|
|
325
333
|
end
|
|
326
334
|
|
|
327
335
|
# Manages webhook operations.
|
|
@@ -349,6 +357,20 @@ module AccessGrid
|
|
|
349
357
|
def delete(webhook_id)
|
|
350
358
|
@client.make_request(:delete, "/v1/console/webhooks/#{webhook_id}")
|
|
351
359
|
end
|
|
360
|
+
|
|
361
|
+
def verify(webhook_id)
|
|
362
|
+
response = @client.make_request(:post, "/v1/console/webhooks/#{webhook_id}/verify")
|
|
363
|
+
WebhookVerification.new(response)
|
|
364
|
+
end
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
class WebhookVerification
|
|
368
|
+
attr_reader :id, :verified
|
|
369
|
+
|
|
370
|
+
def initialize(data)
|
|
371
|
+
@id = data['id']
|
|
372
|
+
@verified = data['verified']
|
|
373
|
+
end
|
|
352
374
|
end
|
|
353
375
|
|
|
354
376
|
# Represents a webhook configuration.
|
data/lib/accessgrid/request.rb
CHANGED
|
@@ -82,7 +82,8 @@ module AccessGrid
|
|
|
82
82
|
|
|
83
83
|
last_part = parts.last
|
|
84
84
|
second_to_last_part = parts[-2]
|
|
85
|
-
|
|
85
|
+
action_words = %w[suspend resume unlink delete publish verify]
|
|
86
|
+
@resource_id = action_words.include?(last_part) ? second_to_last_part : last_part
|
|
86
87
|
end
|
|
87
88
|
|
|
88
89
|
def get?
|
data/lib/accessgrid/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: accessgrid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Auston Bunsen
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: base64
|
|
@@ -45,7 +44,6 @@ licenses:
|
|
|
45
44
|
- MIT
|
|
46
45
|
metadata:
|
|
47
46
|
source_code_uri: https://github.com/access-grid/accessgrid-rb
|
|
48
|
-
post_install_message:
|
|
49
47
|
rdoc_options: []
|
|
50
48
|
require_paths:
|
|
51
49
|
- lib
|
|
@@ -60,8 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
60
58
|
- !ruby/object:Gem::Version
|
|
61
59
|
version: '0'
|
|
62
60
|
requirements: []
|
|
63
|
-
rubygems_version:
|
|
64
|
-
signing_key:
|
|
61
|
+
rubygems_version: 4.0.3
|
|
65
62
|
specification_version: 4
|
|
66
63
|
summary: AccessGrid API Client
|
|
67
64
|
test_files: []
|