descope 1.1.0 → 1.2.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/.github/workflows/ci.yaml +4 -4
- data/.github/workflows/publish-gem.yaml +2 -2
- data/.github/workflows/release-please.yaml +1 -1
- data/.release-please-manifest.json +1 -1
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +10 -0
- data/Gemfile +5 -5
- data/Gemfile.lock +32 -32
- data/README.md +233 -1
- data/lib/descope/api/v1/auth/enchantedlink.rb +76 -9
- data/lib/descope/api/v1/management/access_key.rb +8 -7
- data/lib/descope/api/v1/management/analytics.rb +62 -0
- data/lib/descope/api/v1/management/audit.rb +2 -2
- data/lib/descope/api/v1/management/authz.rb +15 -15
- data/lib/descope/api/v1/management/common.rb +76 -0
- data/lib/descope/api/v1/management/descoper.rb +45 -0
- data/lib/descope/api/v1/management/engine.rb +44 -0
- data/lib/descope/api/v1/management/fga.rb +64 -0
- data/lib/descope/api/v1/management/flow.rb +5 -5
- data/lib/descope/api/v1/management/group.rb +42 -0
- data/lib/descope/api/v1/management/jwt_template.rb +49 -0
- data/lib/descope/api/v1/management/lists.rb +96 -0
- data/lib/descope/api/v1/management/management_key.rb +54 -0
- data/lib/descope/api/v1/management/outbound_app.rb +112 -0
- data/lib/descope/api/v1/management/password.rb +2 -2
- data/lib/descope/api/v1/management/permission.rb +4 -4
- data/lib/descope/api/v1/management/project.rb +5 -5
- data/lib/descope/api/v1/management/role.rb +5 -5
- data/lib/descope/api/v1/management/scim.rb +14 -14
- data/lib/descope/api/v1/management/scope_claim_mapping.rb +34 -0
- data/lib/descope/api/v1/management/sso_application.rb +7 -7
- data/lib/descope/api/v1/management/sso_settings.rb +5 -5
- data/lib/descope/api/v1/management/tenant.rb +8 -6
- data/lib/descope/api/v1/management/third_party_application.rb +190 -0
- data/lib/descope/api/v1/management/user.rb +36 -36
- data/lib/descope/api/v1/management.rb +22 -0
- data/lib/descope/http_client.rb +30 -0
- data/lib/descope/mixins/common.rb +1 -0
- data/lib/descope/mixins/http.rb +23 -16
- data/lib/descope/mixins/initializer.rb +19 -9
- data/lib/descope/mixins/requests.rb +24 -0
- data/lib/descope/mixins.rb +2 -1
- data/lib/descope/version.rb +1 -1
- data/spec/integration/lib.descope/api/v1/management/user_spec.rb +1 -1
- data/spec/lib.descope/api/v1/auth/enchantedlink_spec.rb +163 -1
- data/spec/lib.descope/api/v1/management/access_key_spec.rb +7 -7
- data/spec/lib.descope/api/v1/management/analytics_spec.rb +82 -0
- data/spec/lib.descope/api/v1/management/audit_spec.rb +2 -2
- data/spec/lib.descope/api/v1/management/authz_spec.rb +16 -16
- data/spec/lib.descope/api/v1/management/descoper_spec.rb +101 -0
- data/spec/lib.descope/api/v1/management/engine_spec.rb +115 -0
- data/spec/lib.descope/api/v1/management/fga_spec.rb +169 -0
- data/spec/lib.descope/api/v1/management/flow_spec.rb +5 -5
- data/spec/lib.descope/api/v1/management/group_spec.rb +72 -0
- data/spec/lib.descope/api/v1/management/jwt_template_spec.rb +103 -0
- data/spec/lib.descope/api/v1/management/lists_spec.rb +285 -0
- data/spec/lib.descope/api/v1/management/management_key_spec.rb +109 -0
- data/spec/lib.descope/api/v1/management/outbound_app_spec.rb +236 -0
- data/spec/lib.descope/api/v1/management/password_spec.rb +2 -2
- data/spec/lib.descope/api/v1/management/permission_spec.rb +4 -4
- data/spec/lib.descope/api/v1/management/project_spec.rb +4 -4
- data/spec/lib.descope/api/v1/management/role_spec.rb +5 -5
- data/spec/lib.descope/api/v1/management/scim_spec.rb +14 -14
- data/spec/lib.descope/api/v1/management/scope_claim_mapping_spec.rb +59 -0
- data/spec/lib.descope/api/v1/management/sso_application_spec.rb +6 -6
- data/spec/lib.descope/api/v1/management/sso_settings_spec.rb +5 -5
- data/spec/lib.descope/api/v1/management/tenant_spec.rb +6 -6
- data/spec/lib.descope/api/v1/management/third_party_application_spec.rb +171 -0
- data/spec/lib.descope/api/v1/management/user_spec.rb +36 -36
- data/spec/lib.descope/auth_management_key_spec.rb +151 -0
- data/spec/support/client_config.rb +1 -0
- data/spec/support/dummy_class.rb +12 -9
- metadata +28 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 46b46c0f4ea895abb2c02d5728cf7aac05b1f3928cf5b3c605597618d151bfb9
|
|
4
|
+
data.tar.gz: dc6763494e5bc8caaf3cde6b40f9f84a8d4d297c34d42db54aac94d192e3633e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3cbbe031f32d0fae0044d03e957abd674acc5257a426069082fcb01b097417a2b547255eee816b3b7c9c35b96b9d5a779b46eb561c95cbc31a45b3929e03904a
|
|
7
|
+
data.tar.gz: fde06107b8aa690dbb9867b4a028e1bb523dd25f077afbae29262d2a326aa12a0a5c6f1cd5bcbf03c116f3824363433325a9965e6e19b7757a1e579be622e504
|
data/.github/workflows/ci.yaml
CHANGED
|
@@ -33,9 +33,9 @@ jobs:
|
|
|
33
33
|
ci_node_index: [0, 1, 2, 3]
|
|
34
34
|
steps:
|
|
35
35
|
- name: Checkout Code
|
|
36
|
-
uses: actions/checkout@
|
|
36
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
37
37
|
|
|
38
|
-
- uses: ruby/setup-ruby@
|
|
38
|
+
- uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
|
39
39
|
with:
|
|
40
40
|
bundler-cache: true # Cache bundle based on Gemfile.lock
|
|
41
41
|
|
|
@@ -49,9 +49,9 @@ jobs:
|
|
|
49
49
|
contents: read
|
|
50
50
|
steps:
|
|
51
51
|
- name: Checkout Code
|
|
52
|
-
uses: actions/checkout@
|
|
52
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
53
53
|
|
|
54
|
-
- uses: ruby/setup-ruby@
|
|
54
|
+
- uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
|
55
55
|
with:
|
|
56
56
|
bundler-cache: true # Cache bundle based on Gemfile.lock
|
|
57
57
|
|
|
@@ -10,12 +10,12 @@ jobs:
|
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
12
|
- name: Checkout Code
|
|
13
|
-
uses: actions/checkout@
|
|
13
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
14
14
|
with:
|
|
15
15
|
ref: main
|
|
16
16
|
fetch-depth: 0
|
|
17
17
|
|
|
18
|
-
- uses: ruby/setup-ruby@
|
|
18
|
+
- uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
|
19
19
|
with:
|
|
20
20
|
# We are not letting this step to run bundle install, we will do it later
|
|
21
21
|
bundler-cache: false
|
|
@@ -19,7 +19,7 @@ jobs:
|
|
|
19
19
|
private_key: ${{ secrets.RELEASE_APP_PEM }}
|
|
20
20
|
app_id: ${{ secrets.RELEASE_APP_ID }}
|
|
21
21
|
|
|
22
|
-
- uses: googleapis/release-please-action@
|
|
22
|
+
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
|
|
23
23
|
id: release
|
|
24
24
|
with:
|
|
25
25
|
# The release-please-config.json and .release-please-manifest.json files
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.4.
|
|
1
|
+
3.4.11
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## [1.2.0](https://github.com/descope/descope-ruby-sdk/compare/descope/v1.1.0...descope/v1.2.0) (2026-10-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **auth:** support an auth management key for disabled auth methods ([#230](https://github.com/descope/descope-ruby-sdk/issues/230)) ([b746320](https://github.com/descope/descope-ruby-sdk/commit/b746320b1e69b53d0a75767e774f3ae1afbbced9))
|
|
9
|
+
* **enchantedlink:** add SMS support alongside the existing email routes ([#234](https://github.com/descope/descope-ruby-sdk/issues/234)) ([cc122b1](https://github.com/descope/descope-ruby-sdk/commit/cc122b13a87cb2a056f42321e586327cf03ef3fd))
|
|
10
|
+
* **lists:** add list_check_texts to check multiple texts in one call ([#244](https://github.com/descope/descope-ruby-sdk/issues/244)) ([2f62cde](https://github.com/descope/descope-ruby-sdk/commit/2f62cdeee6aa8e9f2891fe5a9e9f759eaab6f2bb))
|
|
11
|
+
* **management:** add missing management modules for go-sdk parity ([#209](https://github.com/descope/descope-ruby-sdk/issues/209)) ([17c34e0](https://github.com/descope/descope-ruby-sdk/commit/17c34e0059a50cab5a9839de9c476cbe3112cfe1))
|
|
12
|
+
|
|
3
13
|
## [1.1.0](https://github.com/descope/descope-ruby-sdk/compare/descope-v1.0.7...descope/v1.1.0) (2025-12-13)
|
|
4
14
|
|
|
5
15
|
|
data/Gemfile
CHANGED
|
@@ -4,18 +4,18 @@ source 'https://rubygems.org'
|
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
6
|
group :development do
|
|
7
|
-
gem 'rubocop', '1.
|
|
8
|
-
gem 'rubocop-rails', '2.
|
|
7
|
+
gem 'rubocop', '1.91.0', require: false
|
|
8
|
+
gem 'rubocop-rails', '2.38.0', require: false
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
group :test do
|
|
12
|
-
gem 'factory_bot', '6.
|
|
12
|
+
gem 'factory_bot', '6.6.0', require: false
|
|
13
13
|
gem 'faker', require: false
|
|
14
14
|
gem 'parallel_tests', require: false
|
|
15
15
|
gem 'rack-test', '2.2.0', require: false
|
|
16
16
|
gem 'rotp', '6.3.0', require: false
|
|
17
17
|
gem 'rspec', '3.13.2', require: false
|
|
18
|
-
gem 'selenium-webdriver', '4.
|
|
18
|
+
gem 'selenium-webdriver', '4.49.0', require: false
|
|
19
19
|
gem 'simplecov', '0.22.0', require: false
|
|
20
|
-
gem 'super_diff', '0.
|
|
20
|
+
gem 'super_diff', '0.19.0', require: false
|
|
21
21
|
end
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
descope (1.
|
|
4
|
+
descope (1.2.0)
|
|
5
5
|
addressable (~> 2.8)
|
|
6
6
|
jwt (~> 2.7)
|
|
7
7
|
rest-client (~> 2.1)
|
|
@@ -11,16 +11,16 @@ PATH
|
|
|
11
11
|
GEM
|
|
12
12
|
remote: https://rubygems.org/
|
|
13
13
|
specs:
|
|
14
|
-
activesupport (7.2.
|
|
14
|
+
activesupport (7.2.4)
|
|
15
15
|
base64
|
|
16
16
|
benchmark (>= 0.3)
|
|
17
17
|
bigdecimal
|
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
19
|
-
connection_pool (>= 2.2.5)
|
|
19
|
+
connection_pool (>= 2.2.5, < 3)
|
|
20
20
|
drb
|
|
21
21
|
i18n (>= 1.6, < 2)
|
|
22
22
|
logger (>= 1.4.2)
|
|
23
|
-
minitest (>= 5.1)
|
|
23
|
+
minitest (>= 5.1, < 6)
|
|
24
24
|
securerandom (>= 0.3)
|
|
25
25
|
tzinfo (~> 2.0, >= 2.0.5)
|
|
26
26
|
addressable (2.8.6)
|
|
@@ -30,25 +30,25 @@ GEM
|
|
|
30
30
|
base64 (0.3.0)
|
|
31
31
|
benchmark (0.5.0)
|
|
32
32
|
bigdecimal (3.3.1)
|
|
33
|
-
concurrent-ruby (1.3.
|
|
33
|
+
concurrent-ruby (1.3.8)
|
|
34
34
|
connection_pool (2.5.5)
|
|
35
35
|
diff-lcs (1.6.2)
|
|
36
36
|
docile (1.4.0)
|
|
37
37
|
domain_name (0.6.20240107)
|
|
38
38
|
drb (2.2.3)
|
|
39
|
-
factory_bot (6.
|
|
39
|
+
factory_bot (6.6.0)
|
|
40
40
|
activesupport (>= 6.1.0)
|
|
41
41
|
faker (3.3.1)
|
|
42
42
|
i18n (>= 1.8.11, < 2)
|
|
43
43
|
http-accept (1.7.0)
|
|
44
44
|
http-cookie (1.0.5)
|
|
45
45
|
domain_name (~> 0.5)
|
|
46
|
-
i18n (1.
|
|
46
|
+
i18n (1.15.2)
|
|
47
47
|
concurrent-ruby (~> 1.0)
|
|
48
|
-
json (2.
|
|
48
|
+
json (2.21.2)
|
|
49
49
|
jwt (2.8.1)
|
|
50
50
|
base64
|
|
51
|
-
language_server-protocol (3.17.0.
|
|
51
|
+
language_server-protocol (3.17.0.6)
|
|
52
52
|
lint_roller (1.1.0)
|
|
53
53
|
logger (1.7.0)
|
|
54
54
|
mime-types (3.5.2)
|
|
@@ -57,22 +57,22 @@ GEM
|
|
|
57
57
|
minitest (5.27.0)
|
|
58
58
|
netrc (0.11.0)
|
|
59
59
|
optimist (3.2.1)
|
|
60
|
-
parallel (1.
|
|
60
|
+
parallel (1.28.0)
|
|
61
61
|
parallel_tests (5.5.0)
|
|
62
62
|
parallel
|
|
63
|
-
parser (3.3.
|
|
63
|
+
parser (3.3.12.0)
|
|
64
64
|
ast (~> 2.4.1)
|
|
65
65
|
racc
|
|
66
66
|
patience_diff (1.2.0)
|
|
67
67
|
optimist (~> 3.0)
|
|
68
|
-
prism (1.
|
|
68
|
+
prism (1.9.0)
|
|
69
69
|
public_suffix (5.0.5)
|
|
70
70
|
racc (1.8.1)
|
|
71
|
-
rack (3.2.
|
|
71
|
+
rack (3.2.7)
|
|
72
72
|
rack-test (2.2.0)
|
|
73
73
|
rack (>= 1.3)
|
|
74
74
|
rainbow (3.1.1)
|
|
75
|
-
regexp_parser (2.
|
|
75
|
+
regexp_parser (2.13.1)
|
|
76
76
|
rest-client (2.1.0)
|
|
77
77
|
http-accept (>= 1.7.0, < 2.0)
|
|
78
78
|
http-cookie (>= 1.0.2, < 2.0)
|
|
@@ -94,30 +94,30 @@ GEM
|
|
|
94
94
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
95
95
|
rspec-support (~> 3.13.0)
|
|
96
96
|
rspec-support (3.13.6)
|
|
97
|
-
rubocop (1.
|
|
98
|
-
json (
|
|
97
|
+
rubocop (1.91.0)
|
|
98
|
+
json (>= 2.3)
|
|
99
99
|
language_server-protocol (~> 3.17.0.2)
|
|
100
100
|
lint_roller (~> 1.1.0)
|
|
101
|
-
parallel (
|
|
101
|
+
parallel (>= 1.10)
|
|
102
102
|
parser (>= 3.3.0.2)
|
|
103
103
|
rainbow (>= 2.2.2, < 4.0)
|
|
104
104
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
105
|
-
rubocop-ast (>= 1.
|
|
105
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
106
106
|
ruby-progressbar (~> 1.7)
|
|
107
107
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
108
|
-
rubocop-ast (1.
|
|
108
|
+
rubocop-ast (1.50.0)
|
|
109
109
|
parser (>= 3.3.7.2)
|
|
110
|
-
prism (~> 1.
|
|
111
|
-
rubocop-rails (2.
|
|
110
|
+
prism (~> 1.7)
|
|
111
|
+
rubocop-rails (2.38.0)
|
|
112
112
|
activesupport (>= 4.2.0)
|
|
113
113
|
lint_roller (~> 1.1)
|
|
114
114
|
rack (>= 1.1)
|
|
115
|
-
rubocop (>= 1.
|
|
115
|
+
rubocop (>= 1.89.0, < 2.0)
|
|
116
116
|
rubocop-ast (>= 1.44.0, < 2.0)
|
|
117
117
|
ruby-progressbar (1.13.0)
|
|
118
118
|
rubyzip (2.4.1)
|
|
119
119
|
securerandom (0.4.1)
|
|
120
|
-
selenium-webdriver (4.
|
|
120
|
+
selenium-webdriver (4.49.0)
|
|
121
121
|
base64 (~> 0.2)
|
|
122
122
|
logger (~> 1.4)
|
|
123
123
|
rexml (~> 3.2, >= 3.2.5)
|
|
@@ -129,10 +129,10 @@ GEM
|
|
|
129
129
|
simplecov_json_formatter (~> 0.1)
|
|
130
130
|
simplecov-html (0.12.3)
|
|
131
131
|
simplecov_json_formatter (0.1.4)
|
|
132
|
-
super_diff (0.
|
|
133
|
-
attr_extras (>= 6.2.4)
|
|
134
|
-
diff-lcs
|
|
135
|
-
patience_diff
|
|
132
|
+
super_diff (0.19.0)
|
|
133
|
+
attr_extras (>= 6.2.4, < 8)
|
|
134
|
+
diff-lcs (~> 1.5)
|
|
135
|
+
patience_diff (~> 1.2)
|
|
136
136
|
tzinfo (2.0.6)
|
|
137
137
|
concurrent-ruby (~> 1.0)
|
|
138
138
|
unicode-display_width (2.6.0)
|
|
@@ -147,17 +147,17 @@ PLATFORMS
|
|
|
147
147
|
|
|
148
148
|
DEPENDENCIES
|
|
149
149
|
descope!
|
|
150
|
-
factory_bot (= 6.
|
|
150
|
+
factory_bot (= 6.6.0)
|
|
151
151
|
faker
|
|
152
152
|
parallel_tests
|
|
153
153
|
rack-test (= 2.2.0)
|
|
154
154
|
rotp (= 6.3.0)
|
|
155
155
|
rspec (= 3.13.2)
|
|
156
|
-
rubocop (= 1.
|
|
157
|
-
rubocop-rails (= 2.
|
|
158
|
-
selenium-webdriver (= 4.
|
|
156
|
+
rubocop (= 1.91.0)
|
|
157
|
+
rubocop-rails (= 2.38.0)
|
|
158
|
+
selenium-webdriver (= 4.49.0)
|
|
159
159
|
simplecov (= 0.22.0)
|
|
160
|
-
super_diff (= 0.
|
|
160
|
+
super_diff (= 0.19.0)
|
|
161
161
|
|
|
162
162
|
BUNDLED WITH
|
|
163
163
|
2.5.6
|
data/README.md
CHANGED
|
@@ -31,9 +31,49 @@ descope_client = Descope::Client.new(
|
|
|
31
31
|
)
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
### Auth Management Key
|
|
35
|
+
|
|
36
|
+
Authentication methods whose public access has been disabled can still be used by providing an
|
|
37
|
+
auth management key. When set, it is sent along with every authentication request.
|
|
38
|
+
|
|
39
|
+
Create one in the [Descope Console](https://app.descope.com/settings/company/managementkeys) with
|
|
40
|
+
either the `Authentication` or `Full Access` scope on the project or company.
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
# Initialized after setting the DESCOPE_PROJECT_ID and DESCOPE_AUTH_MANAGEMENT_KEY env vars
|
|
44
|
+
descope_client = Descope::Client.new({})
|
|
45
|
+
|
|
46
|
+
# ** Or directly **
|
|
47
|
+
descope_client = Descope::Client.new(
|
|
48
|
+
{
|
|
49
|
+
project_id: '<project_id>',
|
|
50
|
+
auth_management_key: ENV['AUTH_MGMT_KEY']
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Note**: the auth management key can, and probably should, be a different management key than the
|
|
56
|
+
one provided for [management API usage](#setup-1). The auth management key is never sent on
|
|
57
|
+
management requests, and the management key is never sent on authentication requests.
|
|
58
|
+
|
|
59
|
+
### Request timeout
|
|
60
|
+
|
|
61
|
+
Every request is bounded by a 60 second timeout, matching the other Descope server SDKs. Raise it
|
|
62
|
+
for calls that legitimately take longer, such as `export_project` on a large project:
|
|
63
|
+
|
|
64
|
+
```ruby
|
|
65
|
+
descope_client = Descope::Client.new(
|
|
66
|
+
{
|
|
67
|
+
project_id: '<project_id>',
|
|
68
|
+
timeout_seconds: 180
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
34
73
|
### Important Logging note
|
|
35
74
|
You may pass `log_level: 'debug'` to the client config or use `DESCOPE_LOG_LEVEL` env var.
|
|
36
|
-
Be aware that
|
|
75
|
+
Be aware that everything after the project ID in the `Authorization` header is masked, but the JWT
|
|
76
|
+
responses are printed on debug
|
|
37
77
|
|
|
38
78
|
Do not run with log level debug on Production!
|
|
39
79
|
|
|
@@ -172,6 +212,33 @@ pending_ref = res['pendingRef'] # Used to poll for a valid session
|
|
|
172
212
|
masked_email = res['maskedEmail'] # The email that the message was sent to in a masked format
|
|
173
213
|
```
|
|
174
214
|
|
|
215
|
+
The same three calls are available over SMS, as `enchanted_link_sign_up_with_phone`,
|
|
216
|
+
`enchanted_link_sign_in_with_phone` and `enchanted_link_sign_up_or_in_with_phone`. The `login_id` is
|
|
217
|
+
a phone number, and the response carries `maskedPhone` instead of `maskedEmail`.
|
|
218
|
+
|
|
219
|
+
```ruby
|
|
220
|
+
res = descope_client.enchanted_link_sign_up_or_in_with_phone(
|
|
221
|
+
login_id: '+11111111111',
|
|
222
|
+
uri: 'https://myapp.com/verify-enchanted-link', # Set redirect URI here or via console
|
|
223
|
+
template_id: 'my-text-template-id' # Optional, selects a specific text template
|
|
224
|
+
)
|
|
225
|
+
link_identifier = res['linkId'] # Matches the identifier at the start of the SMS, so the user can confirm it
|
|
226
|
+
pending_ref = res['pendingRef'] # Used to poll for a valid session
|
|
227
|
+
masked_phone = res['maskedPhone'] # The phone number that the message was sent to in a masked format
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
An existing user's phone number can be updated with an enchanted link sent over SMS, using the
|
|
231
|
+
refresh token of their active session:
|
|
232
|
+
|
|
233
|
+
```ruby
|
|
234
|
+
res = descope_client.enchanted_link_update_user_phone(
|
|
235
|
+
login_id: 'someone@example.com',
|
|
236
|
+
phone: '+11111111111',
|
|
237
|
+
uri: 'https://myapp.com/verify-enchanted-link',
|
|
238
|
+
refresh_token: refresh_token
|
|
239
|
+
)
|
|
240
|
+
```
|
|
241
|
+
|
|
175
242
|
After sending the link, you must poll to receive a valid session using the `pending_ref` from
|
|
176
243
|
the previous step. A valid session will be returned only after the user clicks the right link.
|
|
177
244
|
|
|
@@ -504,6 +571,8 @@ in nature. Please use responsibly.
|
|
|
504
571
|
|
|
505
572
|
To use the management API you'll need a `Management Key` along with your `Project ID`.
|
|
506
573
|
Create one in the [Descope Console](https://app.descope.com/settings/company/managementkeys).
|
|
574
|
+
This key is used only for management functions - to reach authentication methods whose public
|
|
575
|
+
access has been disabled, use the [Auth Management Key](#auth-management-key) instead.
|
|
507
576
|
|
|
508
577
|
```ruby
|
|
509
578
|
require 'descope'
|
|
@@ -1269,6 +1338,160 @@ resp["apps"].each do |app|
|
|
|
1269
1338
|
end
|
|
1270
1339
|
```
|
|
1271
1340
|
|
|
1341
|
+
### Manage Third Party Applications
|
|
1342
|
+
|
|
1343
|
+
You can create, update, patch, delete or load third party (OIDC) applications, and manage their secrets and consents:
|
|
1344
|
+
|
|
1345
|
+
```ruby
|
|
1346
|
+
# Create a third party application (response includes the generated id and secret)
|
|
1347
|
+
resp = descope_client.create_application(
|
|
1348
|
+
name: "My third party app",
|
|
1349
|
+
login_page_url: "https://dummy.com/login"
|
|
1350
|
+
)
|
|
1351
|
+
id = resp["id"]
|
|
1352
|
+
|
|
1353
|
+
# Update (overrides all fields) or patch (only given fields)
|
|
1354
|
+
descope_client.update_application(id: id, name: "Updated name", login_page_url: "https://dummy.com/login")
|
|
1355
|
+
descope_client.patch_application(id: id, name: "Patched name")
|
|
1356
|
+
|
|
1357
|
+
# Load one / all applications
|
|
1358
|
+
descope_client.load_application(id)
|
|
1359
|
+
descope_client.load_all_applications
|
|
1360
|
+
|
|
1361
|
+
# Manage the application secret
|
|
1362
|
+
descope_client.get_application_secret(id)
|
|
1363
|
+
descope_client.rotate_application_secret(id)
|
|
1364
|
+
|
|
1365
|
+
# Delete consents for the application
|
|
1366
|
+
descope_client.delete_consents(app_id: id, user_ids: ["U123"])
|
|
1367
|
+
|
|
1368
|
+
# Application deletion cannot be undone. Use carefully.
|
|
1369
|
+
descope_client.delete_application(id)
|
|
1370
|
+
```
|
|
1371
|
+
|
|
1372
|
+
### Manage Management Keys
|
|
1373
|
+
|
|
1374
|
+
Create and manage management keys for a project:
|
|
1375
|
+
|
|
1376
|
+
```ruby
|
|
1377
|
+
# Response includes the key metadata and the one-time cleartext value
|
|
1378
|
+
resp = descope_client.create_management_key(
|
|
1379
|
+
name: "CI key",
|
|
1380
|
+
description: "used by CI",
|
|
1381
|
+
expires_in: 0, # 0 = no expiration (seconds)
|
|
1382
|
+
permitted_ips: ["1.2.3.4/32"]
|
|
1383
|
+
)
|
|
1384
|
+
|
|
1385
|
+
descope_client.update_management_key(id: "key-id", name: "renamed CI key")
|
|
1386
|
+
descope_client.get_management_key(id: "key-id")
|
|
1387
|
+
descope_client.search_management_keys(status: "active")
|
|
1388
|
+
descope_client.delete_management_key(id: "key-id")
|
|
1389
|
+
```
|
|
1390
|
+
|
|
1391
|
+
### Manage Engines
|
|
1392
|
+
|
|
1393
|
+
```ruby
|
|
1394
|
+
resp = descope_client.create_engine(name: "my-engine") # secret returned only here and on rotate
|
|
1395
|
+
descope_client.update_engine(id: resp["id"], name: "renamed-engine")
|
|
1396
|
+
descope_client.load_engine(id: resp["id"])
|
|
1397
|
+
descope_client.load_all_engines
|
|
1398
|
+
descope_client.rotate_engine_secret(id: resp["id"])
|
|
1399
|
+
descope_client.delete_engine(id: resp["id"])
|
|
1400
|
+
```
|
|
1401
|
+
|
|
1402
|
+
### Manage Descopers
|
|
1403
|
+
|
|
1404
|
+
```ruby
|
|
1405
|
+
descope_client.create_descoper([{ loginId: "admin@descope.com", roleNames: ["Descoper"] }])
|
|
1406
|
+
descope_client.update_descoper(id: "U123", attributes: { name: "Admin" })
|
|
1407
|
+
descope_client.get_descoper(id: "U123")
|
|
1408
|
+
descope_client.search_descopers
|
|
1409
|
+
descope_client.delete_descoper(id: "U123")
|
|
1410
|
+
```
|
|
1411
|
+
|
|
1412
|
+
### Manage Lists
|
|
1413
|
+
|
|
1414
|
+
Manage allow/deny lists of IPs and text values:
|
|
1415
|
+
|
|
1416
|
+
```ruby
|
|
1417
|
+
list = descope_client.create_list(name: "blocklist", type: "ip")
|
|
1418
|
+
descope_client.update_list(id: list["id"], name: "blocklist", type: "ip")
|
|
1419
|
+
descope_client.load_list(list["id"])
|
|
1420
|
+
descope_client.load_list_by_name("blocklist")
|
|
1421
|
+
descope_client.load_all_lists
|
|
1422
|
+
descope_client.import_lists(lists: [{ name: "blocklist", type: "ip", data: ["1.2.3.4"] }])
|
|
1423
|
+
|
|
1424
|
+
# IP entries
|
|
1425
|
+
descope_client.list_add_ips(id: list["id"], ips: ["1.2.3.4"])
|
|
1426
|
+
descope_client.list_remove_ips(id: list["id"], ips: ["1.2.3.4"])
|
|
1427
|
+
descope_client.list_check_ip(id: list["id"], ip: "1.2.3.4")
|
|
1428
|
+
|
|
1429
|
+
# Text entries
|
|
1430
|
+
descope_client.list_add_texts(id: list["id"], texts: ["blocked"])
|
|
1431
|
+
descope_client.list_remove_texts(id: list["id"], texts: ["blocked"])
|
|
1432
|
+
descope_client.list_check_text(id: list["id"], text: "blocked")
|
|
1433
|
+
# Check up to 100 texts in one call: exists if any of them is in the list, or only if all are with match_all: true
|
|
1434
|
+
descope_client.list_check_texts(id: list["id"], texts: ["blocked", "other"])
|
|
1435
|
+
descope_client.list_check_texts(id: list["id"], texts: ["blocked", "other"], match_all: true)
|
|
1436
|
+
|
|
1437
|
+
descope_client.clear_list(id: list["id"])
|
|
1438
|
+
descope_client.delete_list(id: list["id"])
|
|
1439
|
+
```
|
|
1440
|
+
|
|
1441
|
+
### Manage JWT Templates
|
|
1442
|
+
|
|
1443
|
+
```ruby
|
|
1444
|
+
descope_client.create_jwt_template(template: { name: "my-template", authSchema: "default" })
|
|
1445
|
+
descope_client.update_jwt_template(template: { id: "T123", name: "my-template" })
|
|
1446
|
+
descope_client.list_jwt_templates
|
|
1447
|
+
descope_client.load_jwt_template(id: "T123")
|
|
1448
|
+
descope_client.delete_jwt_template(id: "T123")
|
|
1449
|
+
```
|
|
1450
|
+
|
|
1451
|
+
### Manage Scope Claim Mapping
|
|
1452
|
+
|
|
1453
|
+
Manage the project-wide OIDC scope-to-claim mapping:
|
|
1454
|
+
|
|
1455
|
+
```ruby
|
|
1456
|
+
descope_client.set_scope_claim_mapping(mappings: [{ scope: "email", claims: ["email"] }])
|
|
1457
|
+
descope_client.get_scope_claim_mapping
|
|
1458
|
+
descope_client.delete_scope_claim_mapping
|
|
1459
|
+
```
|
|
1460
|
+
|
|
1461
|
+
### Query SSO Groups
|
|
1462
|
+
|
|
1463
|
+
Query the SSO groups synced to a project's tenant:
|
|
1464
|
+
|
|
1465
|
+
```ruby
|
|
1466
|
+
descope_client.load_all_groups(tenant_id: "T123")
|
|
1467
|
+
descope_client.load_all_groups_for_members(tenant_id: "T123", user_ids: ["U123"], login_ids: ["a@b.com"])
|
|
1468
|
+
descope_client.load_all_group_members(tenant_id: "T123", group_id: "G123")
|
|
1469
|
+
```
|
|
1470
|
+
|
|
1471
|
+
### Manage FGA (Fine-Grained Authorization)
|
|
1472
|
+
|
|
1473
|
+
Manage a fine-grained authorization schema and relations:
|
|
1474
|
+
|
|
1475
|
+
```ruby
|
|
1476
|
+
# Save/load the schema (schema is a DSL string)
|
|
1477
|
+
descope_client.fga_save_schema(schema: "model\n schema 1.1\ntype user")
|
|
1478
|
+
descope_client.fga_load_schema
|
|
1479
|
+
|
|
1480
|
+
# Create, delete and check relations
|
|
1481
|
+
tuples = [{ resource: "doc1", resourceType: "document", relation: "owner", target: "u1", targetType: "user" }]
|
|
1482
|
+
descope_client.fga_create_relations(tuples: tuples)
|
|
1483
|
+
descope_client.fga_check(tuples: tuples)
|
|
1484
|
+
descope_client.fga_delete_relations(tuples: tuples)
|
|
1485
|
+
```
|
|
1486
|
+
|
|
1487
|
+
### Analytics
|
|
1488
|
+
|
|
1489
|
+
Search project analytics:
|
|
1490
|
+
|
|
1491
|
+
```ruby
|
|
1492
|
+
descope_client.analytics_search(from_ts: 1700000000000, to_ts: 1700086400000, group_by_action: true)
|
|
1493
|
+
```
|
|
1494
|
+
|
|
1272
1495
|
|
|
1273
1496
|
## API Rate Limits
|
|
1274
1497
|
|
|
@@ -1306,6 +1529,15 @@ You can find various usage examples in the [examples folder](https://github.com/
|
|
|
1306
1529
|
bundle install
|
|
1307
1530
|
```
|
|
1308
1531
|
|
|
1532
|
+
### Environment variables
|
|
1533
|
+
|
|
1534
|
+
```bash
|
|
1535
|
+
export DESCOPE_PROJECT_ID=<ProjectID>
|
|
1536
|
+
export DESCOPE_MANAGEMENT_KEY=<ManagementKey>
|
|
1537
|
+
# Optional, only needed for authentication methods with disabled public access
|
|
1538
|
+
export DESCOPE_AUTH_MANAGEMENT_KEY=<AuthManagementKey>
|
|
1539
|
+
```
|
|
1540
|
+
|
|
1309
1541
|
### Run tests
|
|
1310
1542
|
|
|
1311
1543
|
Running all tests:
|