passageidentity 0.6.1 → 0.7.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.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/lib/openapi_client/api/apps_api.rb +2 -2
  3. data/lib/openapi_client/api/magic_links_api.rb +4 -4
  4. data/lib/openapi_client/api/tokens_api.rb +2 -2
  5. data/lib/openapi_client/api/user_devices_api.rb +3 -3
  6. data/lib/openapi_client/api/users_api.rb +8 -8
  7. data/lib/openapi_client/api_client.rb +36 -30
  8. data/lib/openapi_client/api_error.rb +1 -1
  9. data/lib/openapi_client/configuration.rb +11 -1
  10. data/lib/openapi_client/models/app_info.rb +36 -3
  11. data/lib/openapi_client/models/app_response.rb +1 -1
  12. data/lib/openapi_client/models/apple_user_social_connection.rb +1 -1
  13. data/lib/openapi_client/models/auth_methods.rb +1 -1
  14. data/lib/openapi_client/models/create_magic_link_request.rb +2 -57
  15. data/lib/openapi_client/models/create_user_request.rb +1 -1
  16. data/lib/openapi_client/models/element_customization.rb +1 -1
  17. data/lib/openapi_client/models/font_family.rb +1 -1
  18. data/lib/openapi_client/models/github_user_social_connection.rb +1 -1
  19. data/lib/openapi_client/models/google_user_social_connection.rb +1 -1
  20. data/lib/openapi_client/models/layout_config.rb +1 -1
  21. data/lib/openapi_client/models/layouts.rb +1 -1
  22. data/lib/openapi_client/models/link.rb +1 -1
  23. data/lib/openapi_client/models/list_devices_response.rb +1 -1
  24. data/lib/openapi_client/models/list_paginated_users_item.rb +19 -2
  25. data/lib/openapi_client/models/list_paginated_users_response.rb +1 -1
  26. data/lib/openapi_client/models/magic_link.rb +1 -1
  27. data/lib/openapi_client/models/magic_link_auth_method.rb +1 -1
  28. data/lib/openapi_client/models/magic_link_channel.rb +1 -1
  29. data/lib/openapi_client/models/magic_link_response.rb +1 -1
  30. data/lib/openapi_client/models/magic_link_type.rb +1 -1
  31. data/lib/openapi_client/models/model400_error.rb +1 -1
  32. data/lib/openapi_client/models/model401_error.rb +1 -1
  33. data/lib/openapi_client/models/model403_error.rb +1 -1
  34. data/lib/openapi_client/models/model404_error.rb +3 -3
  35. data/lib/openapi_client/models/model500_error.rb +1 -1
  36. data/lib/openapi_client/models/nonce.rb +1 -1
  37. data/lib/openapi_client/models/otp_auth_method.rb +1 -1
  38. data/lib/openapi_client/models/paginated_links.rb +1 -1
  39. data/lib/openapi_client/models/passkeys_auth_method.rb +1 -1
  40. data/lib/openapi_client/models/social_connection_type.rb +41 -0
  41. data/lib/openapi_client/models/technologies.rb +1 -1
  42. data/lib/openapi_client/models/theme_type.rb +41 -0
  43. data/lib/openapi_client/models/ttl_display_unit.rb +1 -1
  44. data/lib/openapi_client/models/update_user_request.rb +1 -1
  45. data/lib/openapi_client/models/user_event_action.rb +41 -0
  46. data/lib/openapi_client/models/user_event_status.rb +1 -1
  47. data/lib/openapi_client/models/user_info.rb +19 -2
  48. data/lib/openapi_client/models/user_metadata_field.rb +1 -1
  49. data/lib/openapi_client/models/user_metadata_field_type.rb +1 -1
  50. data/lib/openapi_client/models/user_recent_event.rb +51 -5
  51. data/lib/openapi_client/models/user_response.rb +1 -1
  52. data/lib/openapi_client/models/user_social_connections.rb +1 -1
  53. data/lib/openapi_client/models/user_status.rb +1 -1
  54. data/lib/openapi_client/models/web_authn_devices.rb +1 -1
  55. data/lib/openapi_client/models/web_authn_icons.rb +1 -1
  56. data/lib/openapi_client/models/web_authn_type.rb +1 -1
  57. data/lib/openapi_client/version.rb +1 -1
  58. data/lib/openapi_client.rb +4 -4
  59. data/lib/passageidentity/auth.rb +205 -104
  60. data/lib/passageidentity/client.rb +71 -59
  61. data/lib/passageidentity/error.rb +42 -16
  62. data/lib/passageidentity/user_api.rb +120 -161
  63. data/lib/passageidentity/version.rb +1 -1
  64. data/lib/passageidentity.rb +6 -2
  65. metadata +38 -84
  66. data/.github/workflows/deploy.yml +0 -30
  67. data/.github/workflows/on-pull-request.yml +0 -33
  68. data/.gitignore +0 -58
  69. data/CHANGELOG.md +0 -51
  70. data/CONTRIBUTING.md +0 -66
  71. data/Gemfile +0 -13
  72. data/LICENSE +0 -21
  73. data/README.md +0 -218
  74. data/docs/custom/AuthApi.md +0 -141
  75. data/docs/custom/ClientApi.md +0 -107
  76. data/docs/custom/UserApi.md +0 -419
  77. data/docs/generated/AppInfo.md +0 -94
  78. data/docs/generated/AppResponse.md +0 -18
  79. data/docs/generated/AppleUserSocialConnection.md +0 -24
  80. data/docs/generated/AppsApi.md +0 -77
  81. data/docs/generated/AuthMethods.md +0 -22
  82. data/docs/generated/CreateMagicLinkRequest.md +0 -36
  83. data/docs/generated/CreateUserRequest.md +0 -22
  84. data/docs/generated/ElementCustomization.md +0 -56
  85. data/docs/generated/FontFamily.md +0 -15
  86. data/docs/generated/GithubUserSocialConnection.md +0 -24
  87. data/docs/generated/GoogleUserSocialConnection.md +0 -24
  88. data/docs/generated/LayoutConfig.md +0 -26
  89. data/docs/generated/Layouts.md +0 -20
  90. data/docs/generated/Link.md +0 -18
  91. data/docs/generated/ListDevicesResponse.md +0 -18
  92. data/docs/generated/ListPaginatedUsersItem.md +0 -38
  93. data/docs/generated/ListPaginatedUsersResponse.md +0 -28
  94. data/docs/generated/MagicLink.md +0 -36
  95. data/docs/generated/MagicLinkAuthMethod.md +0 -22
  96. data/docs/generated/MagicLinkChannel.md +0 -15
  97. data/docs/generated/MagicLinkResponse.md +0 -18
  98. data/docs/generated/MagicLinkType.md +0 -15
  99. data/docs/generated/MagicLinksApi.md +0 -79
  100. data/docs/generated/Model400Error.md +0 -20
  101. data/docs/generated/Model401Error.md +0 -20
  102. data/docs/generated/Model403Error.md +0 -20
  103. data/docs/generated/Model404Error.md +0 -20
  104. data/docs/generated/Model500Error.md +0 -20
  105. data/docs/generated/Nonce.md +0 -18
  106. data/docs/generated/OtpAuthMethod.md +0 -22
  107. data/docs/generated/PaginatedLinks.md +0 -26
  108. data/docs/generated/PasskeysAuthMethod.md +0 -18
  109. data/docs/generated/README.md +0 -158
  110. data/docs/generated/Technologies.md +0 -15
  111. data/docs/generated/TokensApi.md +0 -78
  112. data/docs/generated/TtlDisplayUnit.md +0 -15
  113. data/docs/generated/UpdateUserRequest.md +0 -22
  114. data/docs/generated/UserDevicesApi.md +0 -152
  115. data/docs/generated/UserEventStatus.md +0 -15
  116. data/docs/generated/UserInfo.md +0 -48
  117. data/docs/generated/UserMetadataField.md +0 -28
  118. data/docs/generated/UserMetadataFieldType.md +0 -15
  119. data/docs/generated/UserRecentEvent.md +0 -30
  120. data/docs/generated/UserResponse.md +0 -18
  121. data/docs/generated/UserSocialConnections.md +0 -22
  122. data/docs/generated/UserStatus.md +0 -15
  123. data/docs/generated/UsersApi.md +0 -534
  124. data/docs/generated/WebAuthnDevices.md +0 -34
  125. data/docs/generated/WebAuthnIcons.md +0 -20
  126. data/docs/generated/WebAuthnType.md +0 -15
  127. data/generate.sh +0 -31
  128. data/openapitools.json +0 -7
  129. data/passageidentity.gemspec +0 -32
  130. data/tests/all.rb +0 -3
  131. data/tests/app_test.rb +0 -15
  132. data/tests/auth_test.rb +0 -74
  133. data/tests/errors_test.rb +0 -30
  134. data/tests/magic_link_test.rb +0 -22
  135. data/tests/user_api_test.rb +0 -121
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passageidentity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
- - Passage Identity
7
+ - Passage by 1Password
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-26 00:00:00.000000000 Z
11
+ date: 2024-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '7.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: '7.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '7.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '7.0'
13
33
  - !ruby/object:Gem::Dependency
14
34
  name: faraday
15
35
  requirement: !ruby/object:Gem::Requirement
@@ -51,94 +71,32 @@ dependencies:
51
71
  - !ruby/object:Gem::Version
52
72
  version: 2.3.0
53
73
  - !ruby/object:Gem::Dependency
54
- name: openssl
74
+ name: marcel
55
75
  requirement: !ruby/object:Gem::Requirement
56
76
  requirements:
57
77
  - - "~>"
58
78
  - !ruby/object:Gem::Version
59
- version: '3.0'
79
+ version: '1.0'
60
80
  - - ">="
61
81
  - !ruby/object:Gem::Version
62
- version: 3.0.0
82
+ version: 1.0.4
63
83
  type: :runtime
64
84
  prerelease: false
65
85
  version_requirements: !ruby/object:Gem::Requirement
66
86
  requirements:
67
87
  - - "~>"
68
88
  - !ruby/object:Gem::Version
69
- version: '3.0'
89
+ version: '1.0'
70
90
  - - ">="
71
91
  - !ruby/object:Gem::Version
72
- version: 3.0.0
73
- description: Enables verification of server-side authentication and user management
74
- for applications using Passage
92
+ version: 1.0.4
93
+ description: Passkey Complete for Ruby - Integrate into your Ruby API or service to
94
+ enable a completely passwordless standalone auth solution with Passage by 1Password.
75
95
  email: support@passage.id
76
96
  executables: []
77
97
  extensions: []
78
98
  extra_rdoc_files: []
79
99
  files:
80
- - ".github/workflows/deploy.yml"
81
- - ".github/workflows/on-pull-request.yml"
82
- - ".gitignore"
83
- - CHANGELOG.md
84
- - CONTRIBUTING.md
85
- - Gemfile
86
- - LICENSE
87
- - README.md
88
- - docs/custom/AuthApi.md
89
- - docs/custom/ClientApi.md
90
- - docs/custom/UserApi.md
91
- - docs/generated/AppInfo.md
92
- - docs/generated/AppResponse.md
93
- - docs/generated/AppleUserSocialConnection.md
94
- - docs/generated/AppsApi.md
95
- - docs/generated/AuthMethods.md
96
- - docs/generated/CreateMagicLinkRequest.md
97
- - docs/generated/CreateUserRequest.md
98
- - docs/generated/ElementCustomization.md
99
- - docs/generated/FontFamily.md
100
- - docs/generated/GithubUserSocialConnection.md
101
- - docs/generated/GoogleUserSocialConnection.md
102
- - docs/generated/LayoutConfig.md
103
- - docs/generated/Layouts.md
104
- - docs/generated/Link.md
105
- - docs/generated/ListDevicesResponse.md
106
- - docs/generated/ListPaginatedUsersItem.md
107
- - docs/generated/ListPaginatedUsersResponse.md
108
- - docs/generated/MagicLink.md
109
- - docs/generated/MagicLinkAuthMethod.md
110
- - docs/generated/MagicLinkChannel.md
111
- - docs/generated/MagicLinkResponse.md
112
- - docs/generated/MagicLinkType.md
113
- - docs/generated/MagicLinksApi.md
114
- - docs/generated/Model400Error.md
115
- - docs/generated/Model401Error.md
116
- - docs/generated/Model403Error.md
117
- - docs/generated/Model404Error.md
118
- - docs/generated/Model500Error.md
119
- - docs/generated/Nonce.md
120
- - docs/generated/OtpAuthMethod.md
121
- - docs/generated/PaginatedLinks.md
122
- - docs/generated/PasskeysAuthMethod.md
123
- - docs/generated/README.md
124
- - docs/generated/Technologies.md
125
- - docs/generated/TokensApi.md
126
- - docs/generated/TtlDisplayUnit.md
127
- - docs/generated/UpdateUserRequest.md
128
- - docs/generated/UserDevicesApi.md
129
- - docs/generated/UserEventStatus.md
130
- - docs/generated/UserInfo.md
131
- - docs/generated/UserMetadataField.md
132
- - docs/generated/UserMetadataFieldType.md
133
- - docs/generated/UserRecentEvent.md
134
- - docs/generated/UserResponse.md
135
- - docs/generated/UserSocialConnections.md
136
- - docs/generated/UserStatus.md
137
- - docs/generated/UsersApi.md
138
- - docs/generated/WebAuthnDevices.md
139
- - docs/generated/WebAuthnIcons.md
140
- - docs/generated/WebAuthnType.md
141
- - generate.sh
142
100
  - lib/models/update_magic_link_auth_method.rb
143
101
  - lib/models/update_otp_auth_method.rb
144
102
  - lib/models/update_passkeys_auth_method.rb
@@ -181,9 +139,12 @@ files:
181
139
  - lib/openapi_client/models/otp_auth_method.rb
182
140
  - lib/openapi_client/models/paginated_links.rb
183
141
  - lib/openapi_client/models/passkeys_auth_method.rb
142
+ - lib/openapi_client/models/social_connection_type.rb
184
143
  - lib/openapi_client/models/technologies.rb
144
+ - lib/openapi_client/models/theme_type.rb
185
145
  - lib/openapi_client/models/ttl_display_unit.rb
186
146
  - lib/openapi_client/models/update_user_request.rb
147
+ - lib/openapi_client/models/user_event_action.rb
187
148
  - lib/openapi_client/models/user_event_status.rb
188
149
  - lib/openapi_client/models/user_info.rb
189
150
  - lib/openapi_client/models/user_metadata_field.rb
@@ -202,19 +163,12 @@ files:
202
163
  - lib/passageidentity/error.rb
203
164
  - lib/passageidentity/user_api.rb
204
165
  - lib/passageidentity/version.rb
205
- - openapitools.json
206
- - passageidentity.gemspec
207
- - tests/all.rb
208
- - tests/app_test.rb
209
- - tests/auth_test.rb
210
- - tests/errors_test.rb
211
- - tests/magic_link_test.rb
212
- - tests/user_api_test.rb
213
- homepage: https://rubygems.org/gems/passageidentity
166
+ homepage: http://docs.passage.id/complete
214
167
  licenses:
215
168
  - MIT
216
169
  metadata:
217
170
  source_code_uri: https://github.com/passageidentity/passage-ruby
171
+ changelog_uri: https://github.com/passageidentity/passage-ruby/CHANGELOG.md
218
172
  post_install_message:
219
173
  rdoc_options: []
220
174
  require_paths:
@@ -223,15 +177,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
223
177
  requirements:
224
178
  - - ">="
225
179
  - !ruby/object:Gem::Version
226
- version: '0'
180
+ version: 3.1.3
227
181
  required_rubygems_version: !ruby/object:Gem::Requirement
228
182
  requirements:
229
183
  - - ">="
230
184
  - !ruby/object:Gem::Version
231
185
  version: '0'
232
186
  requirements: []
233
- rubygems_version: 3.2.33
187
+ rubygems_version: 3.5.23
234
188
  signing_key:
235
189
  specification_version: 4
236
- summary: Passage SDK for biometric authentication
190
+ summary: Passage Passkey Complete SDK
237
191
  test_files: []
@@ -1,30 +0,0 @@
1
- name: Deploy Ruby Gem
2
-
3
- on:
4
- push:
5
- branches: [main]
6
-
7
- jobs:
8
- build:
9
- name: Build + Publish
10
- runs-on: ubuntu-latest
11
- permissions:
12
- contents: read
13
- packages: write
14
-
15
- steps:
16
- - uses: actions/checkout@v2
17
- - uses: ruby/setup-ruby@v1
18
- with:
19
- ruby-version: '3.0'
20
-
21
- - name: Publish to RubyGems
22
- run: |
23
- mkdir -p $HOME/.gem
24
- touch $HOME/.gem/credentials
25
- chmod 0600 $HOME/.gem/credentials
26
- printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
27
- gem build *.gemspec
28
- gem push *.gem
29
- env:
30
- GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
@@ -1,33 +0,0 @@
1
- name: PR Checks
2
-
3
- on:
4
- workflow_dispatch:
5
- pull_request:
6
- branches:
7
- - main
8
-
9
- env:
10
- API_KEY: ${{ secrets.API_KEY }}
11
- APP_ID: ${{ secrets.APP_ID }}
12
- PSG_JWT: ${{ secrets.PSG_JWT }}
13
- TEST_USER_ID: ${{ secrets.TEST_USER_ID }}
14
-
15
- jobs:
16
- build:
17
- name: Test and Lint
18
- runs-on: ubuntu-latest
19
-
20
- steps:
21
- - uses: actions/checkout@v2
22
- - uses: ruby/setup-ruby@v1
23
- with:
24
- ruby-version: '3.1'
25
-
26
- - name: Run Tests
27
- run: |
28
- bundle install
29
- ruby tests/all.rb
30
- - name: Run Linting
31
- run: |
32
- npm install -g prettier @prettier/plugin-ruby
33
- prettier --check '**/*.rb'
data/.gitignore DELETED
@@ -1,58 +0,0 @@
1
- *.gem
2
- *.rbc
3
- /.config
4
- /coverage/
5
- /InstalledFiles
6
- /pkg/
7
- /spec/reports/
8
- /spec/examples.txt
9
- /test/tmp/
10
- /test/version_tmp/
11
- /tmp/
12
-
13
- .env
14
- # Used by dotenv library to load environment variables.
15
- # .env
16
-
17
- # Ignore Byebug command history file.
18
- .byebug_history
19
-
20
- ## Specific to RubyMotion:
21
- .dat*
22
- .repl_history
23
- build/
24
- *.bridgesupport
25
- build-iPhoneOS/
26
- build-iPhoneSimulator/
27
-
28
- ## Specific to RubyMotion (use of CocoaPods):
29
- #
30
- # We recommend against adding the Pods directory to your .gitignore. However
31
- # you should judge for yourself, the pros and cons are mentioned at:
32
- # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
33
- #
34
- # vendor/Pods/
35
-
36
- ## Documentation cache and generated files:
37
- /.yardoc/
38
- /_yardoc/
39
- /doc/
40
- /rdoc/
41
-
42
- ## Environment normalization:
43
- /.bundle/
44
- /vendor/bundle
45
- /lib/bundler/man/
46
-
47
- # for a library or gem, you might want to ignore these files since the code is
48
- # intended to run in multiple environments; otherwise, check them in:
49
- # Gemfile.lock
50
- # .ruby-version
51
- # .ruby-gemset
52
-
53
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
54
- .rvmrc
55
-
56
- # Used by RuboCop. Remote config files pulled in from inherit_from directive.
57
- # .rubocop-https?--*
58
- Gemfile.lock
data/CHANGELOG.md DELETED
@@ -1,51 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- ## [0.6.1] - 2024-09-26
6
-
7
- ### Changed
8
-
9
- - Updated documentation links to point to new documentation
10
-
11
- ## [0.6.0] - 2024-03-21
12
-
13
- ### Added
14
-
15
- - `GetUserByIdentifier` method has been added
16
- - `ListPaginatedUsersItem` model has been added
17
-
18
- ## [0.5.0] - 2024-01-30
19
-
20
- ### Added
21
-
22
- - `AppleUserSocialConnection` model has been added
23
-
24
- ### Changed
25
-
26
- - `UserEventInfo` has been renamed to `UserRecentEvent`
27
- - Docs have been moved to `/docs`
28
- - `GithubSocialConnection` has been renamed to `GithubUserSocialConnection`
29
- - `GoogleSocialConnection` has been renamed to `GoogleUserSocialConnection`
30
-
31
- ## [0.4.0] - 2024-01-18
32
-
33
- ### Added
34
-
35
- - The `UserInfo` class has a new `'social_connections' =>:'UserSocialConnections'` field for GitHub and Google
36
-
37
- ## [0.3.0] - 2023-12-06
38
-
39
- ### Added
40
-
41
- - Generate types and api calls with openapi generator.
42
- - Version constant instead of parsing gemspec.
43
-
44
- ### Deprecate
45
-
46
- - `user.signout()` -> `auth.revoke_user_refresh_tokens()`
47
- - `auth.authenticate_request()` -> `auth.validate_jwt()`
48
-
49
- ### Possible Breaking Changes
50
-
51
- - 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/CONTRIBUTING.md DELETED
@@ -1,66 +0,0 @@
1
- # Ruby SDK for Passage
2
-
3
- ## Testing the gem locally
4
-
5
- Install the gem
6
-
7
- ```
8
- gem build passageidentity.gemspec -o {$FILE_NAME}.gem
9
- gem install ./{$FILE_NAME}.gem
10
- ```
11
-
12
- Test it out:
13
-
14
- ```
15
- irb -Ilib -rpassageidentity
16
- >> passage = Passage::Client.new(app_id: 'YOUR_APP_ID')
17
- >> passage.auth.authenticate("JWT_HERE")
18
- <passage_user_id>
19
- ```
20
-
21
- Run Tests:
22
-
23
- ```
24
- # all tests
25
- ruby tests/all.rb
26
- # individual test files
27
- ruby tests/*_test.rb
28
- ```
29
-
30
- Run Linter:
31
-
32
- ```
33
- npm install -g prettier @prettier/plugin-ruby
34
- gem install bundler prettier_print syntax_tree syntax_tree-haml syntax_tree-rbs
35
- prettier --write '**/*.rb'
36
- ```
37
-
38
-
39
- To test in the example app, change the Gemfile to include this path:
40
-
41
- ```
42
- gem "passageidentity", path: "../../passage-ruby"
43
- ```
44
-
45
- ## Publishing
46
-
47
- Create an account in rubygems.org then run the following command with your username.
48
-
49
- ```
50
- $ curl -u <username> https://rubygems.org/api/v1/api_key.yaml >
51
- ~/.gem/credentials; chmod 0600 ~/.gem/credentials
52
-
53
- Enter host password for user '<username>':
54
- ```
55
-
56
- ```
57
- gem push passage-0.0.0.gem
58
- ```
59
-
60
- You can check for the gem here:
61
-
62
- ```
63
- gem list -r passage
64
- ```
65
-
66
- ```
data/Gemfile DELETED
@@ -1,13 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in passageidentity.gemspec
4
- gemspec
5
-
6
- group :development do
7
- gem 'rack'
8
- gem 'dotenv'
9
- gem 'prettier_print'
10
- gem 'syntax_tree'
11
- gem 'syntax_tree-haml'
12
- gem 'syntax_tree-rbs'
13
- end
data/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Passage
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
data/README.md DELETED
@@ -1,218 +0,0 @@
1
- <img src="https://storage.googleapis.com/passage-docs/passage-logo-gradient.svg" alt="Passage logo" style="width:250px;"/>
2
-
3
- [![Gem Version](https://badge.fury.io/rb/passageidentity.svg)](https://badge.fury.io/rb/passageidentity)
4
-
5
- # passage-ruby
6
-
7
- This Ruby SDK allows for verification of server-side authentication and user management for Ruby applications build with [Passage](https://passage.id). For more information, please visit [Passage Documentation](https://docs.passage.id).
8
-
9
- Install this package using [RubyGems](https://rubygems.org/gems/passageidentity).
10
-
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
- ## 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
- ```
110
-
111
- ## Activate/Deactivate User
112
-
113
- You can activate or deactivate a user using the Passage SDK. These actions require an API Key and deactivating a user will prevent them from logging into your application
114
- with Passage.
115
-
116
- ```ruby
117
- require 'passageidentity'
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')
138
- ```
139
-
140
- ## Delete User
141
-
142
- You can delete a user using the Passage SDK.
143
-
144
- ```ruby
145
- 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
- ```
153
-
154
- ## List User Devices
155
-
156
- You can list the devices associated with a particular Passage User.
157
-
158
- ```ruby
159
- require 'passageidentity'
160
-
161
- PassageClient =
162
- Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
163
-
164
- devices = PassageClient.user.list_devices(user_id: user_id)
165
- ```
166
-
167
- ## List User Devices
168
-
169
- You can list the devices associated with a particular Passage User.
170
-
171
- ```ruby
172
- require 'passageidentity'
173
-
174
- PassageClient = Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
175
-
176
- success = PassageClient.user.delete_device(user_id: user_id, device_id)
177
- if success
178
- puts "passage user device was successfully deleted"
179
- end
180
- ```
181
-
182
- ## Create an Embeddable Magic Link
183
-
184
- To create a magic link, you should use the `create_magic_link` method. You can check out our guide on embeddable magic links in our [docs](https://docs.passage.id/complete/magic-links).
185
-
186
- ```ruby
187
- require 'passageidentity'
188
-
189
- PassageClient =
190
- Passage::Client.new(app_id: PASSAGE_APP_ID, api_key: PASSAGE_API_KEY)
191
-
192
- magic_link = PassageClient.create_magic_link(user_id: user_id)
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
- ```
201
-
202
- ## Available Functions
203
-
204
- | Class | Method | Description |
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 |