passageidentity 0.6.0 → 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 +12 -2
- data/Gemfile +1 -1
- data/LICENSE +2 -2
- data/README.md +50 -187
- data/lib/passageidentity/version.rb +1 -1
- data/passageidentity.gemspec +4 -4
- metadata +8 -8
- /data/.github/workflows/{on_pr.yml → on-pull-request.yml} +0 -0
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
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [0.6.2] - 2024-10-22
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
- Update to the new README template, updated license, updated metadata in gemspec file
|
10
|
+
|
11
|
+
## [0.6.1] - 2024-09-26
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
|
15
|
+
- Updated documentation links to point to new documentation
|
16
|
+
|
5
17
|
## [0.6.0] - 2024-03-21
|
6
18
|
|
7
19
|
### Added
|
@@ -35,13 +47,11 @@ All notable changes to this project will be documented in this file.
|
|
35
47
|
- Generate types and api calls with openapi generator.
|
36
48
|
- Version constant instead of parsing gemspec.
|
37
49
|
|
38
|
-
|
39
50
|
### Deprecate
|
40
51
|
|
41
52
|
- `user.signout()` -> `auth.revoke_user_refresh_tokens()`
|
42
53
|
- `auth.authenticate_request()` -> `auth.validate_jwt()`
|
43
54
|
|
44
|
-
|
45
55
|
### Possible Breaking Changes
|
46
56
|
|
47
57
|
- Types are now generated. Previous type names may have changed. [See documentation](https://github.com/passageidentity/passage-ruby/tree/main/docs/generated) for model definitions.
|
data/Gemfile
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,221 +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
|
-
```
|
14
|
-
|
15
|
-
## Instantiating the Passage Class
|
16
|
-
|
17
|
-
Initialize the Passage Client as follows:
|
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
|
-
```
|
27
|
-
|
28
|
-
Passage has three arguments that can be used for initialization: `app_id`, `api_key`, and `auth_strategy`.
|
29
|
-
|
30
|
-
- `app_id` is the Passage App ID that specifies which app should be authorized. It has no default value and must to be set upon initialization.
|
31
|
-
- `api_key` is an API key for the Passage app, which can be generated in the 'App Settings' section of the [Passage Console](https://console.passage.id). It is an optional parameter and not required for authenticating requests. It is required to get or update user information.
|
32
|
-
- `auth_strategy` defines where the Passage SDK should look for the authentication token. It is set by default to `Passage::COOKIE_AUTH`, but can be changed to `Passage::HEADER_AUTH`.
|
33
|
-
|
34
|
-
## Authenticating a Request
|
35
|
-
|
36
|
-
To authenticate an HTTP request in a Rails application, you can use the Passage library in a middleware function. You need to provide Passage with your App ID in order to verify the JWTs.
|
37
|
-
|
38
|
-
```ruby
|
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
|
-
|
68
|
-
## Retrieve User Info
|
69
|
-
|
70
|
-
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.
|
71
|
-
|
72
|
-
```ruby
|
73
|
-
require 'passageidentity'
|
74
|
-
|
75
|
-
class ApplicationController < ActionController::Base
|
76
|
-
PassageClient =
|
77
|
-
Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
|
78
|
-
def authorize!
|
79
|
-
begin
|
80
|
-
user_id = PassageClient.auth.authenticate_request(request)
|
81
|
-
user = PassageClient.user.get(user_id: @user_id)
|
82
|
-
# user is authorized
|
83
|
-
rescue Exception => e
|
84
|
-
# handle exception (user is not authorized)
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
```
|
13
|
+
Use [Passkey Complete](https://docs.passage.id/complete) as a standalone passwordless auth solution.
|
89
14
|
|
90
|
-
|
15
|
+
Use [Passkey Ready](https://docs.passage.id/passkey-ready) to determine if your users are ready for passkeys.
|
91
16
|
|
92
|
-
|
17
|
+
### In passage-ruby
|
93
18
|
|
94
|
-
|
95
|
-
require 'passageidentity'
|
96
|
-
|
97
|
-
class ApplicationController < ActionController::Base
|
98
|
-
PassageClient =
|
99
|
-
Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
|
100
|
-
def authorize!
|
101
|
-
begin
|
102
|
-
user_id = PassageClient.auth.authenticate_request(request)
|
103
|
-
user = PassageClient.user.get_by_identifier(identifier: @identifier)
|
104
|
-
# user is authorized
|
105
|
-
rescue Exception => e
|
106
|
-
# handle exception (user is not authorized)
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
110
|
-
```
|
111
|
-
|
112
|
-
## Activate/Deactivate User
|
19
|
+
Use passage-ruby to implement Passkey Complete into your Ruby backend to authenticate requests and manage users.
|
113
20
|
|
114
|
-
|
115
|
-
|
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)
|
116
26
|
|
117
|
-
|
118
|
-
require 'passageidentity'
|
27
|
+
<br />
|
119
28
|
|
120
|
-
|
121
|
-
Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
|
29
|
+
## Getting Started
|
122
30
|
|
123
|
-
|
124
|
-
user = PassageClient.user.activate(user_id: user_id)
|
125
|
-
```
|
31
|
+
### Check Prerequisites
|
126
32
|
|
127
|
-
|
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>
|
128
37
|
|
129
|
-
|
38
|
+
### Install
|
130
39
|
|
131
|
-
```
|
132
|
-
|
133
|
-
|
134
|
-
PassageClient =
|
135
|
-
Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
|
136
|
-
|
137
|
-
user = PassageClient.user.create(email: 'exampleEmail@domain.com')
|
138
|
-
user = PassageClient.user.create(phone: '+15005550007')
|
40
|
+
```shell
|
41
|
+
gem install passageidentity
|
139
42
|
```
|
140
43
|
|
141
|
-
|
142
|
-
|
143
|
-
You can delete a user using the Passage SDK.
|
44
|
+
### Import
|
144
45
|
|
145
46
|
```ruby
|
146
47
|
require 'passageidentity'
|
147
|
-
|
148
|
-
PassageClient =
|
149
|
-
Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
|
150
|
-
|
151
|
-
success = PassageClient.user.delete(user_id: user_id)
|
152
|
-
puts 'passage user was successfully deleted' if success
|
153
48
|
```
|
154
49
|
|
155
|
-
|
156
|
-
|
157
|
-
You can list the devices associated with a particular Passage User.
|
50
|
+
### Initialize
|
158
51
|
|
159
52
|
```ruby
|
160
|
-
require 'passageidentity'
|
161
|
-
|
162
53
|
PassageClient =
|
163
|
-
Passage::Client.new(
|
164
|
-
|
165
|
-
|
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
|
+
)
|
166
59
|
```
|
167
60
|
|
61
|
+
### Go Passwordless
|
168
62
|
|
169
|
-
|
170
|
-
|
171
|
-
You can list the devices associated with a particular Passage User.
|
172
|
-
|
173
|
-
```ruby
|
174
|
-
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.
|
175
64
|
|
176
|
-
|
65
|
+
## Support & Feedback
|
177
66
|
|
178
|
-
|
179
|
-
if success
|
180
|
-
puts "passage user device was successfully deleted"
|
181
|
-
end
|
182
|
-
```
|
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).
|
183
68
|
|
184
|
-
|
69
|
+
<br />
|
185
70
|
|
186
|
-
|
71
|
+
---
|
187
72
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
magic_link =
|
196
|
-
PassageClient.create_magic_link(
|
197
|
-
email: 'example@domain.com',
|
198
|
-
send: true,
|
199
|
-
channel: Passage::EMAIL_CHANNEL,
|
200
|
-
ttl: 120,
|
201
|
-
)
|
202
|
-
```
|
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>
|
203
80
|
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
------------ | ------------- | -------------
|
209
|
-
*ClientApi* | [**get_app**](docs/custom/ClientApi.md#get_app) | Get App
|
210
|
-
*ClientApi* | [**create_magic_link**](docs/custom/Passage/ClientApi.md#create_magic_link) | Create Embeddable Magic Link
|
211
|
-
*AuthApi* | [**auth.authenticate_request**](docs/custom/AuthApi.md#authenticate_request) | Validates user jwt token
|
212
|
-
*AuthApi* | [**auth.validate_jwt**](docs/custom/AuthApi.md#validate_jwt) | Validates user jwt token
|
213
|
-
*UserAPI* | [**user.delete_device**](docs/custom/UserApi.md#delete_device) | Delete a device for a user
|
214
|
-
*UserAPI* | [**user.list_devices**](docs/custom/UserApi.md#list_devices) | List User Devices
|
215
|
-
*UserAPI* | [**user.activate**](docs/custom/UserApi.md#activate) | Activate User
|
216
|
-
*UserAPI* | [**user.create**](docs/custom/UserApi.md#create) | Create User
|
217
|
-
*UserAPI* | [**user.deactivate**](docs/custom/UserApi.md#deactivate) | Deactivate User
|
218
|
-
*UserAPI* | [**user.delete**](docs/custom/UserApi.md#delete) | Delete User
|
219
|
-
*UserAPI* | [**user.get**](docs/custom/UserApi.md#get) | Get User
|
220
|
-
*UserAPI* | [**user.update**](docs/custom/UserApi.md#update) | Update User
|
221
|
-
*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,15 +70,15 @@ 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: []
|
78
78
|
extra_rdoc_files: []
|
79
79
|
files:
|
80
80
|
- ".github/workflows/deploy.yml"
|
81
|
-
- ".github/workflows/
|
81
|
+
- ".github/workflows/on-pull-request.yml"
|
82
82
|
- ".gitignore"
|
83
83
|
- CHANGELOG.md
|
84
84
|
- CONTRIBUTING.md
|
@@ -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: []
|
File without changes
|