auth0 5.15.0 → 5.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/actions/get-prerelease/action.yml +30 -0
- data/.github/actions/get-release-notes/action.yml +42 -0
- data/.github/actions/get-version/action.yml +21 -0
- data/.github/actions/release-create/action.yml +47 -0
- data/.github/actions/rubygems-publish/action.yml +30 -0
- data/.github/actions/tag-exists/action.yml +36 -0
- data/.github/workflows/codeql.yml +3 -3
- data/.github/workflows/matrix.json +1 -5
- data/.github/workflows/release.yml +22 -0
- data/.github/workflows/ruby-release.yml +72 -0
- data/.github/workflows/snyk.yml +4 -2
- data/.github/workflows/test.yml +3 -3
- data/.shiprc +2 -1
- data/.version +1 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +82 -81
- data/examples/ruby-api/Gemfile.lock +2 -2
- data/lib/auth0/api/authentication_endpoints.rb +2 -1
- data/lib/auth0/api/v2/client_grants.rb +27 -2
- data/lib/auth0/api/v2/organizations.rb +50 -0
- data/lib/auth0/api/v2/users.rb +20 -0
- data/lib/auth0/version.rb +1 -1
- data/spec/lib/auth0/api/authentication_endpoints_spec.rb +28 -0
- data/spec/lib/auth0/api/v2/client_grants_spec.rb +30 -0
- data/spec/lib/auth0/api/v2/organizations_spec.rb +66 -0
- data/spec/lib/auth0/api/v2/users_spec.rb +45 -0
- data/spec/lib/auth0/mixins/initializer_spec.rb +2 -1
- data/spec/lib/auth0/mixins/token_management_spec.rb +2 -1
- metadata +12 -5
- data/.circleci/config.yml +0 -60
- data/.github/workflows/publish.yml +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 001f09f32948583c13fb7a3bf421d34a469ba5cd4b0b8ce080a5febaf2e8369b
|
4
|
+
data.tar.gz: 671271047cdaa71aa6cbf6595d35623b9cfdc79e59aa2a5f9f6e8af59e1d6e52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d95a176bd531635ac2502eb147384da9ac0417020dc17e6e0592ba508ece19c70cd1e7037718ffcfdb4b1bcedb3dd6c2866746923328fe5777c075e542aabb0
|
7
|
+
data.tar.gz: 9e693a863adeabb6940f06832ecfd67c30fbcfb6106108f228c3e3959b1bb0892601cca649a5d3a009ec645b24750f5a467a3942be4202c9c30d353102fb4722
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Return a boolean indicating if the version contains prerelease identifiers
|
2
|
+
|
3
|
+
#
|
4
|
+
# Returns a simple true/false boolean indicating whether the version indicates it's a prerelease or not.
|
5
|
+
#
|
6
|
+
# TODO: Remove once the common repo is public.
|
7
|
+
#
|
8
|
+
|
9
|
+
inputs:
|
10
|
+
version:
|
11
|
+
required: true
|
12
|
+
|
13
|
+
outputs:
|
14
|
+
prerelease:
|
15
|
+
value: ${{ steps.get_prerelease.outputs.PRERELEASE }}
|
16
|
+
|
17
|
+
runs:
|
18
|
+
using: composite
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- id: get_prerelease
|
22
|
+
shell: bash
|
23
|
+
run: |
|
24
|
+
if [[ "${VERSION}" == *"beta"* || "${VERSION}" == *"alpha"* ]]; then
|
25
|
+
echo "PRERELEASE=true" >> $GITHUB_OUTPUT
|
26
|
+
else
|
27
|
+
echo "PRERELEASE=false" >> $GITHUB_OUTPUT
|
28
|
+
fi
|
29
|
+
env:
|
30
|
+
VERSION: ${{ inputs.version }}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
name: Return the release notes extracted from the PR body
|
2
|
+
|
3
|
+
#
|
4
|
+
# Returns the release notes from the content of a pull request linked to a release branch. It expects the branch name to be in the format release/vX.Y.Z, release/X.Y.Z, release/vX.Y.Z-beta.N. etc.
|
5
|
+
#
|
6
|
+
# TODO: Remove once the common repo is public.
|
7
|
+
#
|
8
|
+
inputs:
|
9
|
+
version:
|
10
|
+
required: true
|
11
|
+
repo_name:
|
12
|
+
required: false
|
13
|
+
repo_owner:
|
14
|
+
required: true
|
15
|
+
token:
|
16
|
+
required: true
|
17
|
+
|
18
|
+
outputs:
|
19
|
+
release-notes:
|
20
|
+
value: ${{ steps.get_release_notes.outputs.RELEASE_NOTES }}
|
21
|
+
|
22
|
+
runs:
|
23
|
+
using: composite
|
24
|
+
|
25
|
+
steps:
|
26
|
+
- uses: actions/github-script@v7
|
27
|
+
id: get_release_notes
|
28
|
+
with:
|
29
|
+
result-encoding: string
|
30
|
+
script: |
|
31
|
+
const { data: pulls } = await github.rest.pulls.list({
|
32
|
+
owner: process.env.REPO_OWNER,
|
33
|
+
repo: process.env.REPO_NAME,
|
34
|
+
state: 'all',
|
35
|
+
head: `${process.env.REPO_OWNER}:release/${process.env.VERSION}`,
|
36
|
+
});
|
37
|
+
core.setOutput('RELEASE_NOTES', pulls[0].body);
|
38
|
+
env:
|
39
|
+
GITHUB_TOKEN: ${{ inputs.token }}
|
40
|
+
REPO_OWNER: ${{ inputs.repo_owner }}
|
41
|
+
REPO_NAME: ${{ inputs.repo_name }}
|
42
|
+
VERSION: ${{ inputs.version }}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: Return the version extracted from the branch name
|
2
|
+
|
3
|
+
#
|
4
|
+
# Returns the version from the .version file.
|
5
|
+
#
|
6
|
+
# TODO: Remove once the common repo is public.
|
7
|
+
#
|
8
|
+
|
9
|
+
outputs:
|
10
|
+
version:
|
11
|
+
value: ${{ steps.get_version.outputs.VERSION }}
|
12
|
+
|
13
|
+
runs:
|
14
|
+
using: composite
|
15
|
+
|
16
|
+
steps:
|
17
|
+
- id: get_version
|
18
|
+
shell: bash
|
19
|
+
run: |
|
20
|
+
VERSION=$(head -1 .version)
|
21
|
+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
@@ -0,0 +1,47 @@
|
|
1
|
+
name: Create a GitHub release
|
2
|
+
|
3
|
+
#
|
4
|
+
# Creates a GitHub release with the given version.
|
5
|
+
#
|
6
|
+
# TODO: Remove once the common repo is public.
|
7
|
+
#
|
8
|
+
|
9
|
+
inputs:
|
10
|
+
token:
|
11
|
+
required: true
|
12
|
+
files:
|
13
|
+
required: false
|
14
|
+
name:
|
15
|
+
required: true
|
16
|
+
body:
|
17
|
+
required: true
|
18
|
+
tag:
|
19
|
+
required: true
|
20
|
+
commit:
|
21
|
+
required: true
|
22
|
+
draft:
|
23
|
+
default: false
|
24
|
+
required: false
|
25
|
+
prerelease:
|
26
|
+
default: false
|
27
|
+
required: false
|
28
|
+
fail_on_unmatched_files:
|
29
|
+
default: true
|
30
|
+
required: false
|
31
|
+
|
32
|
+
runs:
|
33
|
+
using: composite
|
34
|
+
|
35
|
+
steps:
|
36
|
+
- uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
|
37
|
+
with:
|
38
|
+
body: ${{ inputs.body }}
|
39
|
+
name: ${{ inputs.name }}
|
40
|
+
tag_name: ${{ inputs.tag }}
|
41
|
+
target_commitish: ${{ inputs.commit }}
|
42
|
+
draft: ${{ inputs.draft }}
|
43
|
+
prerelease: ${{ inputs.prerelease }}
|
44
|
+
fail_on_unmatched_files: ${{ inputs.fail_on_unmatched_files }}
|
45
|
+
files: ${{ inputs.files }}
|
46
|
+
env:
|
47
|
+
GITHUB_TOKEN: ${{ inputs.token }}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Publishes to RubyGems
|
2
|
+
|
3
|
+
#
|
4
|
+
# Publishes to RubyGems
|
5
|
+
#
|
6
|
+
# TODO: Remove once the common repo is public.
|
7
|
+
#
|
8
|
+
|
9
|
+
inputs:
|
10
|
+
rubygems-token:
|
11
|
+
required: true
|
12
|
+
ruby-version:
|
13
|
+
required: true
|
14
|
+
|
15
|
+
runs:
|
16
|
+
using: composite
|
17
|
+
|
18
|
+
steps:
|
19
|
+
- name: Configure Ruby
|
20
|
+
uses: ./.github/actions/setup
|
21
|
+
with:
|
22
|
+
ruby: ${{ inputs.ruby-version }}
|
23
|
+
|
24
|
+
- name: Publish to RubyGems
|
25
|
+
shell: bash
|
26
|
+
run: |
|
27
|
+
gem build *.gemspec
|
28
|
+
gem push *.gem
|
29
|
+
env:
|
30
|
+
GEM_HOST_API_KEY: ${{ inputs.rubygems-token }}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
name: Return a boolean indicating if a tag already exists for the repository
|
2
|
+
|
3
|
+
#
|
4
|
+
# Returns a simple true/false boolean indicating whether the tag exists or not.
|
5
|
+
#
|
6
|
+
# TODO: Remove once the common repo is public.
|
7
|
+
#
|
8
|
+
|
9
|
+
inputs:
|
10
|
+
token:
|
11
|
+
required: true
|
12
|
+
tag:
|
13
|
+
required: true
|
14
|
+
|
15
|
+
outputs:
|
16
|
+
exists:
|
17
|
+
description: 'Whether the tag exists or not'
|
18
|
+
value: ${{ steps.tag-exists.outputs.EXISTS }}
|
19
|
+
|
20
|
+
runs:
|
21
|
+
using: composite
|
22
|
+
|
23
|
+
steps:
|
24
|
+
- id: tag-exists
|
25
|
+
shell: bash
|
26
|
+
run: |
|
27
|
+
GET_API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/${TAG_NAME}"
|
28
|
+
http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s -H "Authorization: token ${GITHUB_TOKEN}")
|
29
|
+
if [ "$http_status_code" -ne "404" ] ; then
|
30
|
+
echo "EXISTS=true" >> $GITHUB_OUTPUT
|
31
|
+
else
|
32
|
+
echo "EXISTS=false" >> $GITHUB_OUTPUT
|
33
|
+
fi
|
34
|
+
env:
|
35
|
+
TAG_NAME: ${{ inputs.tag }}
|
36
|
+
GITHUB_TOKEN: ${{ inputs.token }}
|
@@ -39,15 +39,15 @@ jobs:
|
|
39
39
|
uses: actions/checkout@v4
|
40
40
|
|
41
41
|
- name: Initialize CodeQL
|
42
|
-
uses: github/codeql-action/init@
|
42
|
+
uses: github/codeql-action/init@v3
|
43
43
|
with:
|
44
44
|
languages: ${{ matrix.language }}
|
45
45
|
queries: +security-and-quality
|
46
46
|
|
47
47
|
- name: Autobuild
|
48
|
-
uses: github/codeql-action/autobuild@
|
48
|
+
uses: github/codeql-action/autobuild@v3
|
49
49
|
|
50
50
|
- name: Perform CodeQL Analysis
|
51
|
-
uses: github/codeql-action/analyze@
|
51
|
+
uses: github/codeql-action/analyze@v3
|
52
52
|
with:
|
53
53
|
category: "/language:${{ matrix.language }}"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: Create Release
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
types:
|
6
|
+
- closed
|
7
|
+
workflow_dispatch:
|
8
|
+
|
9
|
+
permissions:
|
10
|
+
contents: write
|
11
|
+
|
12
|
+
### TODO: Replace instances of './.github/workflow/' w/ `auth0/dx-sdk-actions/` and append `@latest` after the common `dx-sdk-actions` repo is made public.
|
13
|
+
### TODO: Also remove `get-prerelease`, `get-version`, `rubygems-publish`, `release-create`, `tag-create` and `tag-exists` actions from this repo's .github/actions folder and `ruby-release` from `./github/workflows` once the repo is public.
|
14
|
+
|
15
|
+
jobs:
|
16
|
+
release:
|
17
|
+
uses: ./.github/workflows/ruby-release.yml
|
18
|
+
with:
|
19
|
+
ruby-version: 3.2
|
20
|
+
secrets:
|
21
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
22
|
+
rubygems-token: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
name: Create Release
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_call:
|
5
|
+
inputs:
|
6
|
+
ruby-version:
|
7
|
+
required: true
|
8
|
+
type: string
|
9
|
+
secrets:
|
10
|
+
github-token:
|
11
|
+
required: true
|
12
|
+
rubygems-token:
|
13
|
+
required: true
|
14
|
+
|
15
|
+
jobs:
|
16
|
+
release:
|
17
|
+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
environment: release
|
20
|
+
|
21
|
+
steps:
|
22
|
+
# Checkout the code
|
23
|
+
- uses: actions/checkout@v4
|
24
|
+
with:
|
25
|
+
fetch-depth: 0
|
26
|
+
|
27
|
+
# Get the version from the branch name
|
28
|
+
- id: get_version
|
29
|
+
uses: ./.github/actions/get-version
|
30
|
+
|
31
|
+
# Get the prerelease flag from the branch name
|
32
|
+
- id: get_prerelease
|
33
|
+
uses: ./.github/actions/get-prerelease
|
34
|
+
with:
|
35
|
+
version: ${{ steps.get_version.outputs.version }}
|
36
|
+
|
37
|
+
# Get the release notes
|
38
|
+
# This will expose the release notes as env.RELEASE_NOTES
|
39
|
+
- id: get_release_notes
|
40
|
+
uses: ./.github/actions/get-release-notes
|
41
|
+
with:
|
42
|
+
token: ${{ secrets.github-token }}
|
43
|
+
version: ${{ steps.get_version.outputs.version }}
|
44
|
+
repo_owner: ${{ github.repository_owner }}
|
45
|
+
repo_name: ${{ github.event.repository.name }}
|
46
|
+
|
47
|
+
# Check if the tag already exists
|
48
|
+
- id: tag_exists
|
49
|
+
uses: ./.github/actions/tag-exists
|
50
|
+
with:
|
51
|
+
tag: ${{ steps.get_version.outputs.version }}
|
52
|
+
token: ${{ secrets.github-token }}
|
53
|
+
|
54
|
+
# If the tag already exists, exit with an error
|
55
|
+
- if: steps.tag_exists.outputs.exists == 'true'
|
56
|
+
run: exit 1
|
57
|
+
|
58
|
+
# Publish the release to our package manager
|
59
|
+
- uses: ./.github/actions/rubygems-publish
|
60
|
+
with:
|
61
|
+
ruby-version: ${{ inputs.ruby-version }}
|
62
|
+
rubygems-token: ${{ secrets.rubygems-token }}
|
63
|
+
|
64
|
+
# Create a release for the tag
|
65
|
+
- uses: ./.github/actions/release-create
|
66
|
+
with:
|
67
|
+
token: ${{ secrets.github-token }}
|
68
|
+
name: ${{ steps.get_version.outputs.version }}
|
69
|
+
body: ${{ steps.get_release_notes.outputs.release-notes }}
|
70
|
+
tag: ${{ steps.get_version.outputs.version }}
|
71
|
+
commit: ${{ github.sha }}
|
72
|
+
prerelease: ${{ steps.get_prerelease.outputs.prerelease }}
|
data/.github/workflows/snyk.yml
CHANGED
@@ -11,7 +11,7 @@ on:
|
|
11
11
|
branches:
|
12
12
|
- master
|
13
13
|
schedule:
|
14
|
-
- cron:
|
14
|
+
- cron: "30 0 1,15 * *"
|
15
15
|
|
16
16
|
permissions:
|
17
17
|
contents: read
|
@@ -42,6 +42,8 @@ jobs:
|
|
42
42
|
with:
|
43
43
|
ref: ${{ github.event.pull_request.head.sha || github.ref }}
|
44
44
|
|
45
|
-
-
|
45
|
+
- run: npm install -g snyk
|
46
|
+
|
47
|
+
- run: snyk test
|
46
48
|
env:
|
47
49
|
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
data/.github/workflows/test.yml
CHANGED
@@ -14,7 +14,7 @@ permissions:
|
|
14
14
|
contents: read
|
15
15
|
|
16
16
|
concurrency:
|
17
|
-
group: ${{ github.workflow }}-${{ github.ref }}
|
17
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
18
18
|
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
19
19
|
|
20
20
|
env:
|
@@ -65,5 +65,5 @@ jobs:
|
|
65
65
|
run: bundle exec rake test
|
66
66
|
|
67
67
|
- name: Upload coverage
|
68
|
-
if: matrix.ruby == '3.2'
|
69
|
-
uses: codecov/codecov-action@
|
68
|
+
if: matrix.ruby == '3.2' || matrix.ruby == '3.3'
|
69
|
+
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # pin@3.1.5
|
data/.shiprc
CHANGED
data/.version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
v5.17.0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v5.17.0](https://github.com/auth0/ruby-auth0/tree/v5.17.0) (2024-05-24)
|
4
|
+
[Full Changelog](https://github.com/auth0/ruby-auth0/compare/v5.16.0...v5.17.0)
|
5
|
+
|
6
|
+
**Added**
|
7
|
+
- Add user session management API calls [\#588](https://github.com/auth0/ruby-auth0/pull/588) ([wjohnstondrip](https://github.com/wjohnstondrip))
|
8
|
+
|
9
|
+
## [v5.16.0](https://github.com/auth0/ruby-auth0/tree/v5.16.0) (2023-11-13)
|
10
|
+
[Full Changelog](https://github.com/auth0/ruby-auth0/compare/v5.15.0...v5.16.0)
|
11
|
+
|
12
|
+
**Added**
|
13
|
+
- [SDK-4546] Add orgs in client credentials support [\#540](https://github.com/auth0/ruby-auth0/pull/540) ([adamjmcgrath](https://github.com/adamjmcgrath))
|
14
|
+
|
3
15
|
## [v5.15.0](https://github.com/auth0/ruby-auth0/tree/v5.15.0) (2023-10-30)
|
4
16
|
[Full Changelog](https://github.com/auth0/ruby-auth0/compare/v5.14.2...v5.15.0)
|
5
17
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
auth0 (5.
|
4
|
+
auth0 (5.17.0)
|
5
5
|
addressable (~> 2.8)
|
6
6
|
jwt (~> 2.7)
|
7
7
|
rest-client (~> 2.1)
|
@@ -11,22 +11,23 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
actionpack (7.1.
|
15
|
-
actionview (= 7.1.
|
16
|
-
activesupport (= 7.1.
|
14
|
+
actionpack (7.1.3.3)
|
15
|
+
actionview (= 7.1.3.3)
|
16
|
+
activesupport (= 7.1.3.3)
|
17
17
|
nokogiri (>= 1.8.5)
|
18
|
+
racc
|
18
19
|
rack (>= 2.2.4)
|
19
20
|
rack-session (>= 1.0.1)
|
20
21
|
rack-test (>= 0.6.3)
|
21
22
|
rails-dom-testing (~> 2.2)
|
22
23
|
rails-html-sanitizer (~> 1.6)
|
23
|
-
actionview (7.1.
|
24
|
-
activesupport (= 7.1.
|
24
|
+
actionview (7.1.3.3)
|
25
|
+
activesupport (= 7.1.3.3)
|
25
26
|
builder (~> 3.1)
|
26
27
|
erubi (~> 1.11)
|
27
28
|
rails-dom-testing (~> 2.2)
|
28
29
|
rails-html-sanitizer (~> 1.6)
|
29
|
-
activesupport (7.1.
|
30
|
+
activesupport (7.1.3.3)
|
30
31
|
base64
|
31
32
|
bigdecimal
|
32
33
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
@@ -36,14 +37,14 @@ GEM
|
|
36
37
|
minitest (>= 5.1)
|
37
38
|
mutex_m
|
38
39
|
tzinfo (~> 2.0)
|
39
|
-
addressable (2.8.
|
40
|
+
addressable (2.8.6)
|
40
41
|
public_suffix (>= 2.0.2, < 6.0)
|
41
42
|
ast (2.4.2)
|
42
|
-
base64 (0.
|
43
|
-
bigdecimal (3.1.
|
43
|
+
base64 (0.2.0)
|
44
|
+
bigdecimal (3.1.8)
|
44
45
|
builder (3.2.4)
|
45
46
|
coderay (1.1.3)
|
46
|
-
concurrent-ruby (1.2.
|
47
|
+
concurrent-ruby (1.2.3)
|
47
48
|
connection_pool (2.4.1)
|
48
49
|
coveralls (0.7.1)
|
49
50
|
multi_json (~> 1.3)
|
@@ -51,19 +52,18 @@ GEM
|
|
51
52
|
simplecov (>= 0.7)
|
52
53
|
term-ansicolor
|
53
54
|
thor
|
54
|
-
crack (0.
|
55
|
+
crack (1.0.0)
|
56
|
+
bigdecimal
|
55
57
|
rexml
|
56
58
|
crass (1.0.6)
|
57
|
-
diff-lcs (1.5.
|
59
|
+
diff-lcs (1.5.1)
|
58
60
|
docile (1.4.0)
|
59
|
-
domain_name (0.
|
60
|
-
unf (>= 0.0.5, < 1.0.0)
|
61
|
+
domain_name (0.6.20240107)
|
61
62
|
dotenv (2.8.1)
|
62
63
|
dotenv-rails (2.8.1)
|
63
64
|
dotenv (= 2.8.1)
|
64
65
|
railties (>= 3.2)
|
65
|
-
drb (2.
|
66
|
-
ruby2_keywords
|
66
|
+
drb (2.2.1)
|
67
67
|
erubi (1.12.0)
|
68
68
|
faker (2.23.0)
|
69
69
|
i18n (>= 1.8.11, < 2)
|
@@ -86,61 +86,62 @@ GEM
|
|
86
86
|
guard (~> 2.1)
|
87
87
|
guard-compat (~> 1.1)
|
88
88
|
rspec (>= 2.99.0, < 4.0)
|
89
|
-
hashdiff (1.0
|
89
|
+
hashdiff (1.1.0)
|
90
90
|
http-accept (1.7.0)
|
91
91
|
http-cookie (1.0.5)
|
92
92
|
domain_name (~> 0.5)
|
93
|
-
i18n (1.14.
|
93
|
+
i18n (1.14.5)
|
94
94
|
concurrent-ruby (~> 1.0)
|
95
|
-
io-console (0.
|
96
|
-
irb (1.
|
97
|
-
rdoc
|
98
|
-
reline (>= 0.
|
99
|
-
json (2.
|
100
|
-
jwt (2.
|
95
|
+
io-console (0.7.2)
|
96
|
+
irb (1.13.1)
|
97
|
+
rdoc (>= 4.0.0)
|
98
|
+
reline (>= 0.4.2)
|
99
|
+
json (2.7.2)
|
100
|
+
jwt (2.8.1)
|
101
|
+
base64
|
101
102
|
language_server-protocol (3.17.0.3)
|
102
|
-
listen (3.
|
103
|
+
listen (3.9.0)
|
103
104
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
104
105
|
rb-inotify (~> 0.9, >= 0.9.10)
|
105
|
-
loofah (2.
|
106
|
+
loofah (2.22.0)
|
106
107
|
crass (~> 1.0.2)
|
107
108
|
nokogiri (>= 1.12.0)
|
108
|
-
lumberjack (1.2.
|
109
|
-
method_source (1.
|
110
|
-
mime-types (3.5.
|
109
|
+
lumberjack (1.2.10)
|
110
|
+
method_source (1.1.0)
|
111
|
+
mime-types (3.5.2)
|
111
112
|
mime-types-data (~> 3.2015)
|
112
|
-
mime-types-data (3.
|
113
|
-
minitest (5.
|
113
|
+
mime-types-data (3.2024.0507)
|
114
|
+
minitest (5.23.1)
|
114
115
|
multi_json (1.15.0)
|
115
|
-
mutex_m (0.
|
116
|
+
mutex_m (0.2.0)
|
116
117
|
nenv (0.3.0)
|
117
118
|
netrc (0.11.0)
|
118
|
-
nokogiri (1.
|
119
|
+
nokogiri (1.16.5-aarch64-linux)
|
119
120
|
racc (~> 1.4)
|
120
|
-
nokogiri (1.
|
121
|
+
nokogiri (1.16.5-arm64-darwin)
|
121
122
|
racc (~> 1.4)
|
122
|
-
nokogiri (1.
|
123
|
+
nokogiri (1.16.5-x86_64-darwin)
|
123
124
|
racc (~> 1.4)
|
124
|
-
nokogiri (1.
|
125
|
+
nokogiri (1.16.5-x86_64-linux)
|
125
126
|
racc (~> 1.4)
|
126
127
|
notiffany (0.1.3)
|
127
128
|
nenv (~> 0.1)
|
128
129
|
shellany (~> 0.0)
|
129
|
-
parallel (1.
|
130
|
-
parser (3.
|
130
|
+
parallel (1.24.0)
|
131
|
+
parser (3.3.1.0)
|
131
132
|
ast (~> 2.4.1)
|
132
133
|
racc
|
133
|
-
pp (0.
|
134
|
+
pp (0.5.0)
|
134
135
|
prettyprint
|
135
|
-
prettyprint (0.
|
136
|
+
prettyprint (0.2.0)
|
136
137
|
pry (0.14.2)
|
137
138
|
coderay (~> 1.1)
|
138
139
|
method_source (~> 1.0)
|
139
|
-
psych (5.1.
|
140
|
+
psych (5.1.2)
|
140
141
|
stringio
|
141
|
-
public_suffix (5.0.
|
142
|
-
racc (1.
|
143
|
-
rack (3.0.
|
142
|
+
public_suffix (5.0.5)
|
143
|
+
racc (1.8.0)
|
144
|
+
rack (3.0.11)
|
144
145
|
rack-session (2.0.0)
|
145
146
|
rack (>= 3.0.0)
|
146
147
|
rack-test (2.1.0)
|
@@ -155,23 +156,23 @@ GEM
|
|
155
156
|
rails-html-sanitizer (1.6.0)
|
156
157
|
loofah (~> 2.21)
|
157
158
|
nokogiri (~> 1.14)
|
158
|
-
railties (7.1.
|
159
|
-
actionpack (= 7.1.
|
160
|
-
activesupport (= 7.1.
|
159
|
+
railties (7.1.3.3)
|
160
|
+
actionpack (= 7.1.3.3)
|
161
|
+
activesupport (= 7.1.3.3)
|
161
162
|
irb
|
162
163
|
rackup (>= 1.0.0)
|
163
164
|
rake (>= 12.2)
|
164
165
|
thor (~> 1.0, >= 1.2.2)
|
165
166
|
zeitwerk (~> 2.6)
|
166
167
|
rainbow (3.1.1)
|
167
|
-
rake (13.1
|
168
|
+
rake (13.2.1)
|
168
169
|
rb-fsevent (0.11.2)
|
169
|
-
rb-inotify (0.
|
170
|
+
rb-inotify (0.11.1)
|
170
171
|
ffi (~> 1.0)
|
171
|
-
rdoc (6.
|
172
|
+
rdoc (6.7.0)
|
172
173
|
psych (>= 4.0.0)
|
173
|
-
regexp_parser (2.
|
174
|
-
reline (0.
|
174
|
+
regexp_parser (2.9.2)
|
175
|
+
reline (0.5.7)
|
175
176
|
io-console (~> 0.5)
|
176
177
|
rest-client (2.1.0)
|
177
178
|
http-accept (>= 1.7.0, < 2.0)
|
@@ -179,39 +180,40 @@ GEM
|
|
179
180
|
mime-types (>= 1.16, < 4.0)
|
180
181
|
netrc (~> 0.8)
|
181
182
|
retryable (3.0.5)
|
182
|
-
rexml (3.2.
|
183
|
-
|
184
|
-
|
185
|
-
rspec-
|
186
|
-
rspec-
|
187
|
-
|
188
|
-
|
189
|
-
|
183
|
+
rexml (3.2.8)
|
184
|
+
strscan (>= 3.0.9)
|
185
|
+
rspec (3.13.0)
|
186
|
+
rspec-core (~> 3.13.0)
|
187
|
+
rspec-expectations (~> 3.13.0)
|
188
|
+
rspec-mocks (~> 3.13.0)
|
189
|
+
rspec-core (3.13.0)
|
190
|
+
rspec-support (~> 3.13.0)
|
191
|
+
rspec-expectations (3.13.0)
|
190
192
|
diff-lcs (>= 1.2.0, < 2.0)
|
191
|
-
rspec-support (~> 3.
|
192
|
-
rspec-mocks (3.
|
193
|
+
rspec-support (~> 3.13.0)
|
194
|
+
rspec-mocks (3.13.1)
|
193
195
|
diff-lcs (>= 1.2.0, < 2.0)
|
194
|
-
rspec-support (~> 3.
|
195
|
-
rspec-support (3.
|
196
|
-
rubocop (1.
|
196
|
+
rspec-support (~> 3.13.0)
|
197
|
+
rspec-support (3.13.1)
|
198
|
+
rubocop (1.64.0)
|
197
199
|
json (~> 2.3)
|
198
200
|
language_server-protocol (>= 3.17.0)
|
199
201
|
parallel (~> 1.10)
|
200
|
-
parser (>= 3.
|
202
|
+
parser (>= 3.3.0.2)
|
201
203
|
rainbow (>= 2.2.2, < 4.0)
|
202
204
|
regexp_parser (>= 1.8, < 3.0)
|
203
205
|
rexml (>= 3.2.5, < 4.0)
|
204
|
-
rubocop-ast (>= 1.
|
206
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
205
207
|
ruby-progressbar (~> 1.7)
|
206
208
|
unicode-display_width (>= 2.4.0, < 3.0)
|
207
|
-
rubocop-ast (1.
|
208
|
-
parser (>= 3.
|
209
|
-
rubocop-rails (2.
|
209
|
+
rubocop-ast (1.31.3)
|
210
|
+
parser (>= 3.3.1.0)
|
211
|
+
rubocop-rails (2.25.0)
|
210
212
|
activesupport (>= 4.2.0)
|
211
213
|
rack (>= 1.1)
|
212
214
|
rubocop (>= 1.33.0, < 2.0)
|
215
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
213
216
|
ruby-progressbar (1.13.0)
|
214
|
-
ruby2_keywords (0.0.5)
|
215
217
|
shellany (0.0.1)
|
216
218
|
simplecov (0.22.0)
|
217
219
|
docile (~> 1.1)
|
@@ -222,29 +224,28 @@ GEM
|
|
222
224
|
simplecov (~> 0.19)
|
223
225
|
simplecov-html (0.12.3)
|
224
226
|
simplecov_json_formatter (0.1.4)
|
225
|
-
stringio (3.0
|
227
|
+
stringio (3.1.0)
|
228
|
+
strscan (3.1.0)
|
226
229
|
sync (0.5.0)
|
227
|
-
term-ansicolor (1.
|
230
|
+
term-ansicolor (1.8.0)
|
228
231
|
tins (~> 1.0)
|
229
232
|
terminal-notifier-guard (1.7.0)
|
230
|
-
thor (1.3.
|
233
|
+
thor (1.3.1)
|
231
234
|
timecop (0.9.8)
|
232
|
-
tins (1.
|
235
|
+
tins (1.33.0)
|
236
|
+
bigdecimal
|
233
237
|
sync
|
234
238
|
tzinfo (2.0.6)
|
235
239
|
concurrent-ruby (~> 1.0)
|
236
|
-
unf (0.1.4)
|
237
|
-
unf_ext
|
238
|
-
unf_ext (0.0.8.2)
|
239
240
|
unicode-display_width (2.5.0)
|
240
241
|
vcr (6.2.0)
|
241
|
-
webmock (3.
|
242
|
+
webmock (3.23.1)
|
242
243
|
addressable (>= 2.8.0)
|
243
244
|
crack (>= 0.3.2)
|
244
245
|
hashdiff (>= 0.4.0, < 2.0.0)
|
245
246
|
webrick (1.8.1)
|
246
247
|
zache (0.13.1)
|
247
|
-
zeitwerk (2.6.
|
248
|
+
zeitwerk (2.6.14)
|
248
249
|
|
249
250
|
PLATFORMS
|
250
251
|
aarch64-linux
|
@@ -31,7 +31,8 @@ module Auth0
|
|
31
31
|
request_params = {
|
32
32
|
grant_type: 'client_credentials',
|
33
33
|
client_id: client_id,
|
34
|
-
audience: audience
|
34
|
+
audience: audience,
|
35
|
+
organization: organization
|
35
36
|
}
|
36
37
|
|
37
38
|
populate_client_assertion_or_secret(request_params, client_id: client_id, client_secret: client_secret)
|
@@ -11,13 +11,15 @@ module Auth0
|
|
11
11
|
# @param audience [string] The audience of the client grant to retrieve.
|
12
12
|
# @param page [int] Page number to get, 0-based.
|
13
13
|
# @param per_page [int] Results per page if also passing a page number.
|
14
|
+
# @param allow_any_organization [bool] Optional filter on allow_any_organization.
|
14
15
|
# @return [json] Returns the client grants.
|
15
|
-
def client_grants (client_id: nil, audience: nil, page: nil, per_page: nil)
|
16
|
+
def client_grants (client_id: nil, audience: nil, page: nil, per_page: nil, allow_any_organization: nil)
|
16
17
|
request_params = {
|
17
18
|
client_id: client_id,
|
18
19
|
audience: audience,
|
19
20
|
page: page,
|
20
|
-
per_page: per_page
|
21
|
+
per_page: per_page,
|
22
|
+
allow_any_organization: allow_any_organization
|
21
23
|
}
|
22
24
|
get(client_grants_path, request_params)
|
23
25
|
end
|
@@ -54,6 +56,29 @@ module Auth0
|
|
54
56
|
end
|
55
57
|
alias update_client_grant patch_client_grant
|
56
58
|
|
59
|
+
|
60
|
+
# Get the organizations associated to a client grant.
|
61
|
+
# @param id [string] The client_grant_id of the client grant.
|
62
|
+
# @param options [hash] The Hash options used to define the paging of results
|
63
|
+
# * :per_page [integer] The amount of entries per page. Default: 50. Max value: 100.
|
64
|
+
# * :page [integer] The page number. Zero based.
|
65
|
+
# * :from [string] For checkpoint pagination, the ID from which to start selection from.
|
66
|
+
# * :take [integer] For checkpoint pagination, the number of entries to retrieve. Default is 50.
|
67
|
+
# * :include_totals [boolean] True to include query summary in the result, false or nil otherwise.
|
68
|
+
# @return [json] Returns the organizations.
|
69
|
+
def get_client_grants_organizations(client_grant_id, options = {})
|
70
|
+
raise Auth0::InvalidParameter, 'Must specify a client grant id' if client_grant_id.to_s.empty?
|
71
|
+
request_params = {
|
72
|
+
per_page: options.fetch(:per_page, nil),
|
73
|
+
page: options.fetch(:page, nil),
|
74
|
+
from: options.fetch(:from, nil),
|
75
|
+
take: options.fetch(:take, nil),
|
76
|
+
include_totals: options.fetch(:include_totals, nil)
|
77
|
+
}
|
78
|
+
path = "#{client_grants_path}/#{client_grant_id}/organizations"
|
79
|
+
get(path, request_params)
|
80
|
+
end
|
81
|
+
|
57
82
|
private
|
58
83
|
|
59
84
|
# Client Grants API path
|
@@ -330,6 +330,52 @@ module Auth0
|
|
330
330
|
end
|
331
331
|
alias remove_organizations_member_roles delete_organizations_member_roles
|
332
332
|
|
333
|
+
# Get client grants associated to an organization
|
334
|
+
# @param organization_id [string] The Organization ID
|
335
|
+
# @param options [hash] The Hash options used to define the paging of results
|
336
|
+
# * :client_id [string] The client_id of the client grant to retrieve.
|
337
|
+
# * :audience [string] The audience of the client grant to retrieve.
|
338
|
+
# * :per_page [integer] The amount of entries per page. Default: 50. Max value: 100.
|
339
|
+
# * :page [integer] The page number. Zero based.
|
340
|
+
# * :include_totals [boolean] True to include query summary in the result, false or nil otherwise.
|
341
|
+
def get_organizations_client_grants(organization_id, options= {})
|
342
|
+
raise Auth0::MissingOrganizationId, 'Must supply a valid organization_id' if organization_id.to_s.empty?
|
343
|
+
request_params = {
|
344
|
+
client_id: options.fetch(:client_id, nil),
|
345
|
+
audience: options.fetch(:audience, nil),
|
346
|
+
per_page: options.fetch(:per_page, nil),
|
347
|
+
page: options.fetch(:page, nil),
|
348
|
+
include_totals: options.fetch(:include_totals, nil)
|
349
|
+
}
|
350
|
+
path = "#{organizations_client_grants_path(organization_id)}"
|
351
|
+
get(path, request_params)
|
352
|
+
end
|
353
|
+
|
354
|
+
# Associate a client grant with an organization
|
355
|
+
# @param organization_id [string] The Organization ID
|
356
|
+
# @param grant_id [string] The Client Grant ID you want to associate to the Organization.
|
357
|
+
def create_organizations_client_grant(organization_id, grant_id)
|
358
|
+
raise Auth0::MissingOrganizationId, 'Must supply a valid organization_id' if organization_id.to_s.empty?
|
359
|
+
raise Auth0::InvalidParameter, 'Must supply a valid grant_id' if grant_id.to_s.empty?
|
360
|
+
|
361
|
+
body = {}
|
362
|
+
body[:grant_id] = grant_id
|
363
|
+
|
364
|
+
path = "#{organizations_client_grants_path(organization_id)}"
|
365
|
+
post(path, body)
|
366
|
+
end
|
367
|
+
|
368
|
+
# Remove a client grant from an organization
|
369
|
+
# @param organization_id [string] The Organization ID
|
370
|
+
# @param grant_id [string] The Client Grant ID you want to remove from the Organization.
|
371
|
+
def delete_organizations_client_grant(organization_id, grant_id)
|
372
|
+
raise Auth0::MissingOrganizationId, 'Must supply a valid organization_id' if organization_id.to_s.empty?
|
373
|
+
raise Auth0::InvalidParameter, 'Must supply a valid grant_id' if grant_id.to_s.empty?
|
374
|
+
|
375
|
+
path = "#{organizations_path}/#{organization_id}/client-grants/#{grant_id}"
|
376
|
+
delete(path)
|
377
|
+
end
|
378
|
+
|
333
379
|
private
|
334
380
|
# Organizations API path
|
335
381
|
def organizations_path
|
@@ -351,6 +397,10 @@ module Auth0
|
|
351
397
|
def organizations_invitations_path(org_id)
|
352
398
|
"#{organizations_path}/#{org_id}/invitations"
|
353
399
|
end
|
400
|
+
|
401
|
+
def organizations_client_grants_path(org_id)
|
402
|
+
"#{organizations_path}/#{org_id}/client-grants"
|
403
|
+
end
|
354
404
|
end
|
355
405
|
end
|
356
406
|
end
|
data/lib/auth0/api/v2/users.rb
CHANGED
@@ -445,6 +445,26 @@ module Auth0
|
|
445
445
|
delete "#{users_path}/#{user_id}/authentication-methods/#{authentication_method_id}"
|
446
446
|
end
|
447
447
|
|
448
|
+
# Delete all sessions for a user.
|
449
|
+
#
|
450
|
+
# @param user_id [string] The user ID
|
451
|
+
# @see https://auth0.com/docs/api/management/v2/users/delete-sessions-for-user
|
452
|
+
def delete_user_sessions(user_id)
|
453
|
+
raise Auth0::MissingUserId, 'Must supply a valid user_id' if user_id.to_s.empty?
|
454
|
+
|
455
|
+
delete "#{users_path}/#{user_id}/sessions"
|
456
|
+
end
|
457
|
+
|
458
|
+
# Retrieve details for a user's sessions.
|
459
|
+
#
|
460
|
+
# @param user_id [string] The user ID
|
461
|
+
# @see https://auth0.com/docs/api/management/v2/users/get-sessions-for-user
|
462
|
+
def user_sessions(user_id)
|
463
|
+
raise Auth0::MissingUserId, 'Must supply a valid user_id' if user_id.to_s.empty?
|
464
|
+
|
465
|
+
get "#{users_path}/#{user_id}/sessions"
|
466
|
+
end
|
467
|
+
|
448
468
|
private
|
449
469
|
|
450
470
|
# Users API path
|
data/lib/auth0/version.rb
CHANGED
@@ -56,6 +56,7 @@ describe Auth0::Api::AuthenticationEndpoints do
|
|
56
56
|
grant_type: 'client_credentials',
|
57
57
|
client_id: client_id,
|
58
58
|
audience: api_identifier,
|
59
|
+
organization: nil,
|
59
60
|
client_secret: client_secret
|
60
61
|
}.to_json
|
61
62
|
))
|
@@ -74,6 +75,33 @@ describe Auth0::Api::AuthenticationEndpoints do
|
|
74
75
|
expect(result.expires_in).not_to be_nil
|
75
76
|
end
|
76
77
|
|
78
|
+
it 'requests a new token using organization' do
|
79
|
+
expect(RestClient::Request).to receive(:execute).with(hash_including(
|
80
|
+
method: :post,
|
81
|
+
url: 'https://samples.auth0.com/oauth/token',
|
82
|
+
payload: {
|
83
|
+
grant_type: 'client_credentials',
|
84
|
+
client_id: client_id,
|
85
|
+
audience: api_identifier,
|
86
|
+
organization: 'foo',
|
87
|
+
client_secret: client_secret
|
88
|
+
}.to_json
|
89
|
+
))
|
90
|
+
.and_return(StubResponse.new({
|
91
|
+
"access_token" => "test_response",
|
92
|
+
"expires_in" => 86400,
|
93
|
+
"scope" => "scope"},
|
94
|
+
true,
|
95
|
+
200))
|
96
|
+
|
97
|
+
result = client_secret_instance.send :api_token, audience: api_identifier, organization: 'foo'
|
98
|
+
|
99
|
+
expect(result).to be_a_kind_of(Auth0::ApiToken)
|
100
|
+
expect(result.access_token).not_to be_nil
|
101
|
+
expect(result.scope).not_to be_nil
|
102
|
+
expect(result.expires_in).not_to be_nil
|
103
|
+
end
|
104
|
+
|
77
105
|
it 'requests a new token using client_assertion' do
|
78
106
|
expect(RestClient::Request).to receive(:execute) do |arg|
|
79
107
|
expect(arg).to match(
|
@@ -14,6 +14,7 @@ describe Auth0::Api::V2::ClientGrants do
|
|
14
14
|
expect(@instance).to receive(:get).with(
|
15
15
|
'/api/v2/client-grants', {
|
16
16
|
client_id: nil,
|
17
|
+
allow_any_organization: nil,
|
17
18
|
audience: nil,
|
18
19
|
page: nil,
|
19
20
|
per_page: nil
|
@@ -27,6 +28,7 @@ describe Auth0::Api::V2::ClientGrants do
|
|
27
28
|
expect(@instance).to receive(:get).with(
|
28
29
|
'/api/v2/client-grants', {
|
29
30
|
client_id: '1',
|
31
|
+
allow_any_organization: nil,
|
30
32
|
audience: audience,
|
31
33
|
page: nil,
|
32
34
|
per_page: nil
|
@@ -38,12 +40,25 @@ describe Auth0::Api::V2::ClientGrants do
|
|
38
40
|
expect(@instance).to receive(:get).with(
|
39
41
|
'/api/v2/client-grants', {
|
40
42
|
client_id: nil,
|
43
|
+
allow_any_organization: nil,
|
41
44
|
audience: nil,
|
42
45
|
page: 1,
|
43
46
|
per_page: 2
|
44
47
|
})
|
45
48
|
expect { @instance.client_grants(page: 1, per_page: 2) }.not_to raise_error
|
46
49
|
end
|
50
|
+
|
51
|
+
it 'is expected to send get /api/v2/client-grants/ with allow_any_organization' do
|
52
|
+
expect(@instance).to receive(:get).with(
|
53
|
+
'/api/v2/client-grants', {
|
54
|
+
client_id: nil,
|
55
|
+
allow_any_organization: true,
|
56
|
+
audience: nil,
|
57
|
+
page: nil,
|
58
|
+
per_page: nil
|
59
|
+
})
|
60
|
+
expect { @instance.client_grants(allow_any_organization: true) }.not_to raise_error
|
61
|
+
end
|
47
62
|
end
|
48
63
|
|
49
64
|
context '.create_client_grant' do
|
@@ -73,4 +88,19 @@ describe Auth0::Api::V2::ClientGrants do
|
|
73
88
|
it { expect { @instance.patch_client_grant('', nil) }.to raise_error 'Must specify a client grant id' }
|
74
89
|
it { expect { @instance.patch_client_grant('some', nil) }.to raise_error 'Must specify a valid body' }
|
75
90
|
end
|
91
|
+
|
92
|
+
context '.get_client_grants_organizations' do
|
93
|
+
it { expect(@instance).to respond_to(:get_client_grants_organizations) }
|
94
|
+
it 'is expected to send get to /api/v2/client-grants/organizations' do
|
95
|
+
expect(@instance).to receive(:get).with('/api/v2/client-grants/1/organizations', {
|
96
|
+
per_page: nil,
|
97
|
+
page: nil,
|
98
|
+
from: nil,
|
99
|
+
take: nil,
|
100
|
+
include_totals: nil
|
101
|
+
})
|
102
|
+
expect { @instance.get_client_grants_organizations('1') }.not_to raise_error
|
103
|
+
end
|
104
|
+
it { expect { @instance.get_client_grants_organizations('') }.to raise_error 'Must specify a client grant id' }
|
105
|
+
end
|
76
106
|
end
|
@@ -639,4 +639,70 @@ describe Auth0::Api::V2::Organizations do
|
|
639
639
|
expect { @instance.delete_organizations_member_roles('org_id', 'user_id') }.to raise_error 'Must supply an array of role ids'
|
640
640
|
end
|
641
641
|
end
|
642
|
+
|
643
|
+
context '.get_organizations_client_grants' do
|
644
|
+
it 'is expected to respond to a get_organizations_client_grants method' do
|
645
|
+
expect(@instance).to respond_to(:get_organizations_client_grants)
|
646
|
+
end
|
647
|
+
|
648
|
+
it 'is expected to get /api/v2/organizations/org_id/client-grants' do
|
649
|
+
expect(@instance).to receive(:get).with(
|
650
|
+
'/api/v2/organizations/org_id/client-grants', {
|
651
|
+
per_page: nil,
|
652
|
+
page: nil,
|
653
|
+
client_id: nil,
|
654
|
+
audience: nil,
|
655
|
+
include_totals: nil
|
656
|
+
})
|
657
|
+
expect { @instance.get_organizations_client_grants('org_id') }.not_to raise_error
|
658
|
+
end
|
659
|
+
|
660
|
+
it 'is expected to get /api/v2/organizations/org_id/client-grants with custom parameters' do
|
661
|
+
expect(@instance).to receive(:get).with(
|
662
|
+
'/api/v2/organizations/org_id/client-grants', {
|
663
|
+
per_page: 10,
|
664
|
+
page: 1,
|
665
|
+
client_id: 'client_id',
|
666
|
+
audience: 'api',
|
667
|
+
include_totals: true
|
668
|
+
})
|
669
|
+
expect do
|
670
|
+
@instance.get_organizations_client_grants(
|
671
|
+
'org_id',
|
672
|
+
per_page: 10,
|
673
|
+
page: 1,
|
674
|
+
client_id: 'client_id',
|
675
|
+
audience: 'api',
|
676
|
+
include_totals: true
|
677
|
+
)
|
678
|
+
end.not_to raise_error
|
679
|
+
end
|
680
|
+
end
|
681
|
+
|
682
|
+
context '.create_organizations_client_grants' do
|
683
|
+
it 'is expected to respond to a create_organizations_client_grants method' do
|
684
|
+
expect(@instance).to respond_to(:create_organizations_client_grant)
|
685
|
+
end
|
686
|
+
|
687
|
+
it 'is expected to post /api/v2/organizations/org_id/client-grants' do
|
688
|
+
expect(@instance).to receive(:post).with(
|
689
|
+
'/api/v2/organizations/org_id/client-grants', {
|
690
|
+
grant_id: 'grant_id'
|
691
|
+
})
|
692
|
+
expect { @instance.create_organizations_client_grant('org_id', 'grant_id') }.not_to raise_error
|
693
|
+
end
|
694
|
+
end
|
695
|
+
|
696
|
+
context '.delete_organizations_client_grant' do
|
697
|
+
it 'is expected to respond to a delete_organizations_client_grant method' do
|
698
|
+
expect(@instance).to respond_to(:delete_organizations_client_grant)
|
699
|
+
end
|
700
|
+
|
701
|
+
it 'is expected to delete /api/v2/organizations/org_id/client-grants' do
|
702
|
+
expect(@instance).to receive(:delete).with(
|
703
|
+
'/api/v2/organizations/org_id/client-grants/grant_id')
|
704
|
+
expect { @instance.delete_organizations_client_grant('org_id', 'grant_id') }.not_to raise_error
|
705
|
+
end
|
706
|
+
end
|
707
|
+
|
642
708
|
end
|
@@ -801,4 +801,49 @@ describe Auth0::Api::V2::Users do
|
|
801
801
|
end.to_not raise_error
|
802
802
|
end
|
803
803
|
end
|
804
|
+
|
805
|
+
context '.delete_user_sessions' do
|
806
|
+
it 'is expected to respond to delete_user_sessions' do
|
807
|
+
expect(@instance).to respond_to(:delete_user_sessions)
|
808
|
+
end
|
809
|
+
|
810
|
+
it 'is expected to raise an exception for a missing user ID' do
|
811
|
+
expect { @instance.delete_user_sessions(nil) }.to raise_exception(Auth0::MissingUserId)
|
812
|
+
end
|
813
|
+
|
814
|
+
it 'is expected to call the endpoint' do
|
815
|
+
expect(@instance).to receive(:delete).with(
|
816
|
+
'/api/v2/users/USER_ID/sessions'
|
817
|
+
)
|
818
|
+
|
819
|
+
expect do
|
820
|
+
@instance.delete_user_sessions 'USER_ID'
|
821
|
+
end.to_not raise_error
|
822
|
+
end
|
823
|
+
end
|
824
|
+
|
825
|
+
context '.user_sessions' do
|
826
|
+
it 'is expected to respond to user_sessions' do
|
827
|
+
expect(@instance).to respond_to :user_authentication_method
|
828
|
+
end
|
829
|
+
|
830
|
+
it 'is expected to respond to user_sessions' do
|
831
|
+
expect(@instance).to respond_to :user_sessions
|
832
|
+
end
|
833
|
+
|
834
|
+
it 'is expected to raise an exception for a missing user ID' do
|
835
|
+
expect { @instance.user_sessions(nil) }.to raise_exception(Auth0::MissingUserId)
|
836
|
+
end
|
837
|
+
|
838
|
+
it 'is expected to GET a user authentication method' do
|
839
|
+
expect(@instance).to receive(:get).with(
|
840
|
+
'/api/v2/users/USER_ID/sessions'
|
841
|
+
)
|
842
|
+
|
843
|
+
expect do
|
844
|
+
@instance.user_sessions('USER_ID')
|
845
|
+
end.not_to raise_error
|
846
|
+
|
847
|
+
end
|
848
|
+
end
|
804
849
|
end
|
@@ -64,7 +64,8 @@ describe Auth0::Mixins::Initializer do
|
|
64
64
|
grant_type: 'client_credentials',
|
65
65
|
client_id: client_id,
|
66
66
|
client_secret: client_secret,
|
67
|
-
audience: api_identifier
|
67
|
+
audience: api_identifier,
|
68
|
+
organization: nil
|
68
69
|
}
|
69
70
|
|
70
71
|
expect(RestClient::Request).to receive(:execute) do |arg|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auth0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Auth0
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2024-05-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rest-client
|
@@ -203,7 +203,6 @@ extensions: []
|
|
203
203
|
extra_rdoc_files: []
|
204
204
|
files:
|
205
205
|
- ".bundle/config"
|
206
|
-
- ".circleci/config.yml"
|
207
206
|
- ".devcontainer/Dockerfile"
|
208
207
|
- ".devcontainer/devcontainer.json"
|
209
208
|
- ".env.example"
|
@@ -212,12 +211,19 @@ files:
|
|
212
211
|
- ".github/ISSUE_TEMPLATE/Feature Request.yml"
|
213
212
|
- ".github/ISSUE_TEMPLATE/config.yml"
|
214
213
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
214
|
+
- ".github/actions/get-prerelease/action.yml"
|
215
|
+
- ".github/actions/get-release-notes/action.yml"
|
216
|
+
- ".github/actions/get-version/action.yml"
|
217
|
+
- ".github/actions/release-create/action.yml"
|
218
|
+
- ".github/actions/rubygems-publish/action.yml"
|
215
219
|
- ".github/actions/setup/action.yml"
|
220
|
+
- ".github/actions/tag-exists/action.yml"
|
216
221
|
- ".github/dependabot.yml"
|
217
222
|
- ".github/stale.yml"
|
218
223
|
- ".github/workflows/codeql.yml"
|
219
224
|
- ".github/workflows/matrix.json"
|
220
|
-
- ".github/workflows/
|
225
|
+
- ".github/workflows/release.yml"
|
226
|
+
- ".github/workflows/ruby-release.yml"
|
221
227
|
- ".github/workflows/semgrep.yml"
|
222
228
|
- ".github/workflows/snyk.yml"
|
223
229
|
- ".github/workflows/test.yml"
|
@@ -228,6 +234,7 @@ files:
|
|
228
234
|
- ".semgrepignore"
|
229
235
|
- ".shiprc"
|
230
236
|
- ".snyk"
|
237
|
+
- ".version"
|
231
238
|
- CHANGELOG.md
|
232
239
|
- CODE_OF_CONDUCT.md
|
233
240
|
- DEPLOYMENT.md
|
@@ -593,7 +600,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
593
600
|
- !ruby/object:Gem::Version
|
594
601
|
version: '0'
|
595
602
|
requirements: []
|
596
|
-
rubygems_version: 3.4.
|
603
|
+
rubygems_version: 3.4.19
|
597
604
|
signing_key:
|
598
605
|
specification_version: 4
|
599
606
|
summary: Auth0 API Client
|
data/.circleci/config.yml
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
version: 2.1
|
2
|
-
orbs:
|
3
|
-
ship: auth0/ship@0
|
4
|
-
codecov: codecov/codecov@3
|
5
|
-
|
6
|
-
matrix_ruby_versions: &matrix_ruby_versions
|
7
|
-
matrix:
|
8
|
-
parameters:
|
9
|
-
ruby_version: ["3.0", "3.1", "3.2"]
|
10
|
-
# Default version of ruby to use for lint and publishing
|
11
|
-
default_ruby_version: &default_ruby_version "3.2"
|
12
|
-
|
13
|
-
executors:
|
14
|
-
ruby-image:
|
15
|
-
parameters:
|
16
|
-
ruby_version:
|
17
|
-
type: string
|
18
|
-
default: *default_ruby_version
|
19
|
-
docker:
|
20
|
-
- image: cimg/ruby:<< parameters.ruby_version >>
|
21
|
-
|
22
|
-
jobs:
|
23
|
-
run-tests:
|
24
|
-
parameters:
|
25
|
-
ruby_version:
|
26
|
-
type: string
|
27
|
-
default: *default_ruby_version
|
28
|
-
executor:
|
29
|
-
name: ruby-image
|
30
|
-
ruby_version: << parameters.ruby_version >>
|
31
|
-
steps:
|
32
|
-
- checkout
|
33
|
-
- run: gem install bundler:2.3.22
|
34
|
-
- restore_cache:
|
35
|
-
key: gems-v2-{{ checksum "Gemfile.lock" }}
|
36
|
-
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
|
37
|
-
- save_cache:
|
38
|
-
key: gems-v2-{{ checksum "Gemfile.lock" }}
|
39
|
-
paths:
|
40
|
-
- vendor/bundle
|
41
|
-
# Must define DOMAIN, CLIENT_ID, CLIENT_SECRET and MASTER_JWT env
|
42
|
-
- run: bundle exec rake test
|
43
|
-
- codecov/upload:
|
44
|
-
file: /home/circleci/project/coverage/coverage.xml
|
45
|
-
|
46
|
-
workflows:
|
47
|
-
tests:
|
48
|
-
jobs:
|
49
|
-
- run-tests:
|
50
|
-
<<: *matrix_ruby_versions
|
51
|
-
- ship/ruby-publish:
|
52
|
-
context:
|
53
|
-
- publish-rubygems
|
54
|
-
- publish-gh
|
55
|
-
filters:
|
56
|
-
branches:
|
57
|
-
only:
|
58
|
-
- master
|
59
|
-
requires:
|
60
|
-
- run-tests
|
@@ -1,37 +0,0 @@
|
|
1
|
-
name: Publish Release
|
2
|
-
|
3
|
-
on:
|
4
|
-
workflow_dispatch:
|
5
|
-
inputs:
|
6
|
-
branch:
|
7
|
-
description: The branch to release from.
|
8
|
-
required: true
|
9
|
-
default: master
|
10
|
-
|
11
|
-
permissions:
|
12
|
-
contents: read
|
13
|
-
|
14
|
-
jobs:
|
15
|
-
publish:
|
16
|
-
name: Publish to RubyGems
|
17
|
-
runs-on: ubuntu-latest
|
18
|
-
environment: release
|
19
|
-
|
20
|
-
steps:
|
21
|
-
- name: Checkout code
|
22
|
-
uses: actions/checkout@v4
|
23
|
-
with:
|
24
|
-
fetch-depth: 0
|
25
|
-
ref: ${{ github.event.inputs.branch }}
|
26
|
-
|
27
|
-
- name: Configure Ruby
|
28
|
-
uses: ./.github/actions/setup
|
29
|
-
with:
|
30
|
-
ruby: 3.2
|
31
|
-
|
32
|
-
- name: Publish to RubyGems
|
33
|
-
run: |
|
34
|
-
gem build *.gemspec
|
35
|
-
gem push *.gem
|
36
|
-
env:
|
37
|
-
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|