passageidentity 0.6.1 → 0.6.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 +6 -0
- data/LICENSE +2 -2
- data/README.md +50 -184
- data/lib/passageidentity/version.rb +1 -1
- data/passageidentity.gemspec +4 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cd467636d69820affe2b8c7132a5020043465a982176d1fe78e0a8e505528d8
|
4
|
+
data.tar.gz: 2ca83b8a479ab84dfe3e8c995684b4cbb0b5a8c8051cb9eefbcc370ed3a36936
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89e9d432cea8930db2686f203813f28ac902fde133080aa150987147e57aec8b2115b5c30b2fde84839e348b539239e09c2c7220f6f5ae1471b92b2b8f11b3b8
|
7
|
+
data.tar.gz: 599688eac0e4ac800315dc07cd47f73c7a04349db737526b492ab5fdeb57049de936b17e406d01d057085a2170794f8939b4cda719adcb3f95d89abd554c1508
|
data/CHANGELOG.md
CHANGED
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2024 Passage by 1Password
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,218 +1,84 @@
|
|
1
|
-
|
1
|
+

|
2
2
|
|
3
|
-
|
3
|
+

|
4
|
+

|
5
|
+

|
4
6
|
|
5
|
-
|
7
|
+
## About
|
6
8
|
|
7
|
-
|
9
|
+
[Passage by 1Password](https://1password.com/product/passage) unlocks the passwordless future with a simpler, more secure passkey authentication experience. Passage handles the complexities of the [WebAuthn API](https://blog.1password.com/what-is-webauthn/), and allows you to implement passkeys with ease.
|
8
10
|
|
9
|
-
|
11
|
+
Use [Passkey Flex](https://docs.passage.id/flex) to add passkeys to an existing authentication experience.
|
10
12
|
|
11
|
-
|
12
|
-
gem install passageidentity
|
13
|
-
```
|
13
|
+
Use [Passkey Complete](https://docs.passage.id/complete) as a standalone passwordless auth solution.
|
14
14
|
|
15
|
-
|
15
|
+
Use [Passkey Ready](https://docs.passage.id/passkey-ready) to determine if your users are ready for passkeys.
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
```ruby
|
20
|
-
PassageClient =
|
21
|
-
Passage::Client.new(
|
22
|
-
app_id: 'YOUR APP ID',
|
23
|
-
api_key: 'YOUR APIKEY',
|
24
|
-
auth_strategy: Passage::HEADER_AUTH,
|
25
|
-
)
|
26
|
-
```
|
17
|
+
### In passage-ruby
|
27
18
|
|
28
|
-
|
19
|
+
Use passage-ruby to implement Passkey Complete into your Ruby backend to authenticate requests and manage users.
|
29
20
|
|
30
|
-
|
31
|
-
|
32
|
-
|
21
|
+
| Product | Compatible |
|
22
|
+
| --- | --- |
|
23
|
+
|  Passkey **Flex** | ✖️ For Passkey Flex, check out the [Passkey Flex APIs](https://docs.passage.id/flex/apis)
|
24
|
+
|  Passkey **Complete** | ✅
|
25
|
+
|  Passkey **Ready** | ✖️ For Passkey Ready, check out [Authentikit](https://www.npmjs.com/package/@passageidentity/authentikit)
|
33
26
|
|
34
|
-
|
27
|
+
<br />
|
35
28
|
|
36
|
-
|
29
|
+
## Getting Started
|
37
30
|
|
38
|
-
|
39
|
-
require 'passageidentity'
|
40
|
-
|
41
|
-
class ApplicationController < ActionController::Base
|
42
|
-
PassageClient = Passage::Client.new(app_id: PASSAGE_APP_ID)
|
43
|
-
def authorize!
|
44
|
-
begin
|
45
|
-
user_id = PassageClient.auth.authenticate_request(request)
|
46
|
-
# user is authorized
|
47
|
-
rescue Exception => e
|
48
|
-
# handle exception (user is not authorized)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
```
|
53
|
-
|
54
|
-
## Retrieve App Info
|
55
|
-
|
56
|
-
To retrieve information about an app , you should use the `get_app` method.
|
57
|
-
|
58
|
-
```ruby
|
59
|
-
require 'passageidentity'
|
60
|
-
|
61
|
-
PassageClient =
|
62
|
-
Passage::Client.new(app_id: PASSAGE_APP_ID)
|
63
|
-
app_info = PassageClient.get_app()
|
64
|
-
|
65
|
-
```
|
66
|
-
|
67
|
-
## Retrieve User Info
|
68
|
-
|
69
|
-
To retrieve information about a user, you should use the `get` method. You will need to use a Passage API key, which can be created in the Passage Console under your Application Settings. This API key grants your web server access to the Passage management APIs to get and update information about users. This API key must be protected and stored in an appropriate secure storage location. It should never be hard-coded in the repository.
|
70
|
-
|
71
|
-
```ruby
|
72
|
-
require 'passageidentity'
|
73
|
-
|
74
|
-
class ApplicationController < ActionController::Base
|
75
|
-
PassageClient =
|
76
|
-
Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
|
77
|
-
def authorize!
|
78
|
-
begin
|
79
|
-
user_id = PassageClient.auth.authenticate_request(request)
|
80
|
-
user = PassageClient.user.get(user_id: @user_id)
|
81
|
-
# user is authorized
|
82
|
-
rescue Exception => e
|
83
|
-
# handle exception (user is not authorized)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
```
|
88
|
-
|
89
|
-
## Retrieve User Info By Identifier
|
90
|
-
|
91
|
-
To retrieve information about a user, you can also use the `get_by_identifier` method. You will need to use a Passage API key, which can be created in the Passage Console under your Application Settings. This API key grants your web server access to the Passage management APIs to get and update information about users. This API key must be protected and stored in an appropriate secure storage location. It should never be hard-coded in the repository.
|
92
|
-
|
93
|
-
```ruby
|
94
|
-
require 'passageidentity'
|
95
|
-
|
96
|
-
class ApplicationController < ActionController::Base
|
97
|
-
PassageClient =
|
98
|
-
Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
|
99
|
-
def authorize!
|
100
|
-
begin
|
101
|
-
user_id = PassageClient.auth.authenticate_request(request)
|
102
|
-
user = PassageClient.user.get_by_identifier(identifier: @identifier)
|
103
|
-
# user is authorized
|
104
|
-
rescue Exception => e
|
105
|
-
# handle exception (user is not authorized)
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
```
|
31
|
+
### Check Prerequisites
|
110
32
|
|
111
|
-
|
33
|
+
<p>
|
34
|
+
You'll need a free Passage account and a Passkey Complete app set up in <a href="https://console.passage.id/">Passage Console</a> to get started. <br />
|
35
|
+
<sub><a href="https://docs.passage.id/home#passage-console">Learn more about Passage Console →</a></sub>
|
36
|
+
</p>
|
112
37
|
|
113
|
-
|
114
|
-
with Passage.
|
38
|
+
### Install
|
115
39
|
|
116
|
-
```
|
117
|
-
|
118
|
-
|
119
|
-
PassageClient =
|
120
|
-
Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
|
121
|
-
|
122
|
-
user = PassageClient.user.deactivate(user_id: user_id)
|
123
|
-
user = PassageClient.user.activate(user_id: user_id)
|
124
|
-
```
|
125
|
-
|
126
|
-
## Create User
|
127
|
-
|
128
|
-
You can create users using their email address or phone number. Note that their phone number must be in E164 format (example shown below).
|
129
|
-
|
130
|
-
```ruby
|
131
|
-
require 'passageidentity'
|
132
|
-
|
133
|
-
PassageClient =
|
134
|
-
Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
|
135
|
-
|
136
|
-
user = PassageClient.user.create(email: 'exampleEmail@domain.com')
|
137
|
-
user = PassageClient.user.create(phone: '+15005550007')
|
40
|
+
```shell
|
41
|
+
gem install passageidentity
|
138
42
|
```
|
139
43
|
|
140
|
-
|
141
|
-
|
142
|
-
You can delete a user using the Passage SDK.
|
44
|
+
### Import
|
143
45
|
|
144
46
|
```ruby
|
145
47
|
require 'passageidentity'
|
146
|
-
|
147
|
-
PassageClient =
|
148
|
-
Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
|
149
|
-
|
150
|
-
success = PassageClient.user.delete(user_id: user_id)
|
151
|
-
puts 'passage user was successfully deleted' if success
|
152
48
|
```
|
153
49
|
|
154
|
-
|
155
|
-
|
156
|
-
You can list the devices associated with a particular Passage User.
|
50
|
+
### Initialize
|
157
51
|
|
158
52
|
```ruby
|
159
|
-
require 'passageidentity'
|
160
|
-
|
161
53
|
PassageClient =
|
162
|
-
Passage::Client.new(
|
163
|
-
|
164
|
-
|
54
|
+
Passage::Client.new(
|
55
|
+
app_id: 'YOUR_PASSAGE_APP_ID',
|
56
|
+
api_key: 'YOUR_PASSAGE_API_KEY',
|
57
|
+
auth_strategy: Passage::HEADER_AUTH,
|
58
|
+
)
|
165
59
|
```
|
166
60
|
|
167
|
-
|
168
|
-
|
169
|
-
You can list the devices associated with a particular Passage User.
|
61
|
+
### Go Passwordless
|
170
62
|
|
171
|
-
|
172
|
-
require 'passageidentity'
|
63
|
+
Find all core functions, user management details, and more implementation guidance on our [Passkey Complete Ruby Documentation](https://docs.passage.id/complete/backend-sdks/ruby) page.
|
173
64
|
|
174
|
-
|
65
|
+
## Support & Feedback
|
175
66
|
|
176
|
-
|
177
|
-
if success
|
178
|
-
puts "passage user device was successfully deleted"
|
179
|
-
end
|
180
|
-
```
|
67
|
+
We are here to help! Find additional docs, the best ways to get in touch with our team, and more within our [support resources](https://github.com/passageidentity/.github/blob/main/SUPPORT.md).
|
181
68
|
|
182
|
-
|
69
|
+
<br />
|
183
70
|
|
184
|
-
|
71
|
+
---
|
185
72
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
magic_link =
|
194
|
-
PassageClient.create_magic_link(
|
195
|
-
email: 'example@domain.com',
|
196
|
-
send: true,
|
197
|
-
channel: Passage::EMAIL_CHANNEL,
|
198
|
-
ttl: 120,
|
199
|
-
)
|
200
|
-
```
|
73
|
+
<p align="center">
|
74
|
+
<picture>
|
75
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/passage-docs/github-md-assets/passage-by-1password-dark.png">
|
76
|
+
<source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/passage-docs/github-md-assets/passage-by-1password-light.png">
|
77
|
+
<img alt="Passage by 1Password Logo" src="https://storage.googleapis.com/passage-docs/github-md-assets/passage-by-1password-light.png">
|
78
|
+
</picture>
|
79
|
+
</p>
|
201
80
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
| _ClientApi_ | [**get_app**](docs/custom/ClientApi.md#get_app) | Get App |
|
207
|
-
| _ClientApi_ | [**create_magic_link**](docs/custom/Passage/ClientApi.md#create_magic_link) | Create Embeddable Magic Link |
|
208
|
-
| _AuthApi_ | [**auth.authenticate_request**](docs/custom/AuthApi.md#authenticate_request) | Validates user jwt token |
|
209
|
-
| _AuthApi_ | [**auth.validate_jwt**](docs/custom/AuthApi.md#validate_jwt) | Validates user jwt token |
|
210
|
-
| _UserAPI_ | [**user.delete_device**](docs/custom/UserApi.md#delete_device) | Delete a device for a user |
|
211
|
-
| _UserAPI_ | [**user.list_devices**](docs/custom/UserApi.md#list_devices) | List User Devices |
|
212
|
-
| _UserAPI_ | [**user.activate**](docs/custom/UserApi.md#activate) | Activate User |
|
213
|
-
| _UserAPI_ | [**user.create**](docs/custom/UserApi.md#create) | Create User |
|
214
|
-
| _UserAPI_ | [**user.deactivate**](docs/custom/UserApi.md#deactivate) | Deactivate User |
|
215
|
-
| _UserAPI_ | [**user.delete**](docs/custom/UserApi.md#delete) | Delete User |
|
216
|
-
| _UserAPI_ | [**user.get**](docs/custom/UserApi.md#get) | Get User |
|
217
|
-
| _UserAPI_ | [**user.update**](docs/custom/UserApi.md#update) | Update User |
|
218
|
-
| _UserAPI_ | [**user.signout**](docs/custom/UserApi.md#signout) | Signout User |
|
81
|
+
<p align="center">
|
82
|
+
<sub>Passage is a product by <a href="https://1password.com/product/passage">1Password</a>, the global leader in access management solutions with nearly 150k business customers.</sub><br />
|
83
|
+
<sub>This project is licensed under the MIT license. See the <a href="LICENSE">LICENSE</a> file for more info.</sub>
|
84
|
+
</p>
|
data/passageidentity.gemspec
CHANGED
@@ -3,13 +3,13 @@ require_relative 'lib/passageidentity/version'
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'passageidentity'
|
5
5
|
s.version = Passage::VERSION
|
6
|
-
s.summary = 'Passage
|
6
|
+
s.summary = 'Passage Passkey Complete SDK'
|
7
7
|
s.description =
|
8
|
-
'
|
9
|
-
s.authors = ['Passage
|
8
|
+
'Passkey Complete for Ruby - Integrate into your Ruby API or service to enable a completely passwordless standalone auth solution with Passage by 1Password.'
|
9
|
+
s.authors = ['Passage by 1Password']
|
10
10
|
s.email = 'support@passage.id'
|
11
11
|
s.files = ['lib/passageidentity.rb']
|
12
|
-
s.homepage = '
|
12
|
+
s.homepage = 'http://docs.passage.id/complete'
|
13
13
|
s.license = 'MIT'
|
14
14
|
|
15
15
|
s.metadata['source_code_uri'] =
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passageidentity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Passage
|
7
|
+
- Passage by 1Password
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -70,8 +70,8 @@ dependencies:
|
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: 3.0.0
|
73
|
-
description:
|
74
|
-
|
73
|
+
description: Passkey Complete for Ruby - Integrate into your Ruby API or service to
|
74
|
+
enable a completely passwordless standalone auth solution with Passage by 1Password.
|
75
75
|
email: support@passage.id
|
76
76
|
executables: []
|
77
77
|
extensions: []
|
@@ -210,7 +210,7 @@ files:
|
|
210
210
|
- tests/errors_test.rb
|
211
211
|
- tests/magic_link_test.rb
|
212
212
|
- tests/user_api_test.rb
|
213
|
-
homepage:
|
213
|
+
homepage: http://docs.passage.id/complete
|
214
214
|
licenses:
|
215
215
|
- MIT
|
216
216
|
metadata:
|
@@ -233,5 +233,5 @@ requirements: []
|
|
233
233
|
rubygems_version: 3.2.33
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
|
-
summary: Passage
|
236
|
+
summary: Passage Passkey Complete SDK
|
237
237
|
test_files: []
|