@ctx-core/auth0-management 9.7.164 → 9.8.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.
- package/auth0__user/index.test.ts +49 -0
- package/{src/auth0__v2_client__GET__fetch → auth0__v2_client__GET__fetch}/index.js +2 -2
- package/{src/auth0__v2_client_grants__GET__fetch → auth0__v2_client_grants__GET__fetch}/index.js +2 -2
- package/{src/auth0__v2_user__GET__fetch → auth0__v2_user__GET__fetch}/index.js +2 -2
- package/auth0__v2_user__GET__fetch/index.test.ts +105 -0
- package/{src/auth0__v2_user__PATCH__fetch → auth0__v2_user__PATCH__fetch}/index.d.ts +1 -1
- package/{src/auth0__v2_user__PATCH__fetch → auth0__v2_user__PATCH__fetch}/index.js +2 -4
- package/{src/auth0__v2_users_by_email__GET__fetch → auth0__v2_users_by_email__GET__fetch}/index.d.ts +1 -2
- package/{src/auth0__v2_users_by_email__GET__fetch → auth0__v2_users_by_email__GET__fetch}/index.js +1 -1
- package/{src/auth0__v2_users_by_email__GET__fetch → auth0__v2_users_by_email__GET__fetch}/index.test.ts +31 -31
- package/{src/auth0_management__new → auth0_management__new}/index.js +1 -1
- package/{src/auth0_management__token__new → auth0_management__token__new}/index.test.ts +20 -20
- package/bin/add-grant-password-auth0.mjs +1 -1
- package/bin/auth0.mjs +1 -1
- package/bin/getAll-client-grants-auth0.mjs +1 -1
- package/package.json +26 -11
- package/.ideaexclude +0 -2
- package/CHANGELOG.md +0 -9898
- package/COMMIT_EDITMSG +0 -2
- package/src/auth0__user/index.test.ts +0 -49
- package/src/auth0__v2_user__GET__fetch/index.test.ts +0 -108
- package/src/index.d.ts +0 -12
- package/tsconfig.json +0 -16
- /package/{src/AUTH0_MANAGEMENT_ID → AUTH0_MANAGEMENT_ID}/index.d.ts +0 -0
- /package/{src/AUTH0_MANAGEMENT_ID → AUTH0_MANAGEMENT_ID}/index.js +0 -0
- /package/{src/AUTH0_MANAGEMENT_SECRET → AUTH0_MANAGEMENT_SECRET}/index.d.ts +0 -0
- /package/{src/AUTH0_MANAGEMENT_SECRET → AUTH0_MANAGEMENT_SECRET}/index.js +0 -0
- /package/{src/auth0__user → auth0__user}/index.d.ts +0 -0
- /package/{src/auth0__user → auth0__user}/index.js +0 -0
- /package/{src/auth0__v2_client__GET__fetch → auth0__v2_client__GET__fetch}/index.d.ts +0 -0
- /package/{src/auth0__v2_client_grants__GET__fetch → auth0__v2_client_grants__GET__fetch}/index.d.ts +0 -0
- /package/{src/auth0__v2_user__GET__fetch → auth0__v2_user__GET__fetch}/index.d.ts +0 -0
- /package/{src/auth0_management__client_credentials__body__new → auth0_management__client_credentials__body__new}/index.d.ts +0 -0
- /package/{src/auth0_management__client_credentials__body__new → auth0_management__client_credentials__body__new}/index.js +0 -0
- /package/{src/auth0_management__init → auth0_management__init}/index.d.ts +0 -0
- /package/{src/auth0_management__init → auth0_management__init}/index.js +0 -0
- /package/{src/auth0_management__new → auth0_management__new}/index.d.ts +0 -0
- /package/{src/auth0_management__token__new → auth0_management__token__new}/index.d.ts +0 -0
- /package/{src/auth0_management__token__new → auth0_management__token__new}/index.js +0 -0
- /package/{src/index.js → index.d.ts} +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ctx__new } from '@ctx-core/object'
|
|
2
|
+
import type { UserProfile } from 'auth0'
|
|
3
|
+
import { test } from 'uvu'
|
|
4
|
+
import { equal } from 'uvu/assert'
|
|
5
|
+
import { auth0__user$_, auth0__user_, auth0__user__set } from '../index.js'
|
|
6
|
+
test('auth0__user', ()=>{
|
|
7
|
+
const ctx = ctx__new()
|
|
8
|
+
const auth0__user = auth0__user__new()
|
|
9
|
+
equal(auth0__user$_(ctx).$, undefined)
|
|
10
|
+
equal(auth0__user_(ctx), undefined)
|
|
11
|
+
auth0__user__set(ctx, auth0__user)
|
|
12
|
+
equal(auth0__user$_(ctx).$, auth0__user)
|
|
13
|
+
equal(auth0__user_(ctx), auth0__user)
|
|
14
|
+
})
|
|
15
|
+
test.run()
|
|
16
|
+
function auth0__user__new() {
|
|
17
|
+
return {
|
|
18
|
+
'user_id': 'auth0|507f1f77bcf86cd799439020',
|
|
19
|
+
'email': 'john.doe@gmail.com',
|
|
20
|
+
'email_verified': false,
|
|
21
|
+
'username': 'johndoe',
|
|
22
|
+
'phone_number': '+199999999999999',
|
|
23
|
+
'phone_verified': false,
|
|
24
|
+
'created_at': '',
|
|
25
|
+
'updated_at': '',
|
|
26
|
+
'identities': [
|
|
27
|
+
{
|
|
28
|
+
'connection': 'Initial-Connection',
|
|
29
|
+
'user_id': '507f1f77bcf86cd799439020',
|
|
30
|
+
'provider': 'auth0',
|
|
31
|
+
'isSocial': false
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
'app_metadata': {},
|
|
35
|
+
'user_metadata': {},
|
|
36
|
+
'picture': '',
|
|
37
|
+
'name': '',
|
|
38
|
+
'nickname': '',
|
|
39
|
+
'multifactor': [
|
|
40
|
+
''
|
|
41
|
+
],
|
|
42
|
+
'last_ip': '',
|
|
43
|
+
'last_login': '',
|
|
44
|
+
'logins_count': 0,
|
|
45
|
+
'blocked': false,
|
|
46
|
+
'given_name': '',
|
|
47
|
+
'family_name': ''
|
|
48
|
+
} as UserProfile
|
|
49
|
+
}
|
|
@@ -4,7 +4,7 @@ import { auth0_management__token__new } from '../auth0_management__token__new/in
|
|
|
4
4
|
/** @typedef {import('@ctx-core/fetch').response_pair_T}response_pair_T */
|
|
5
5
|
/** @typedef {import('@ctx-core/object').Ctx}Ctx */
|
|
6
6
|
/** @typedef {import('auth0').Client}Client */
|
|
7
|
-
/** @typedef {import('./
|
|
7
|
+
/** @typedef {import('./index.d.ts').auth0__v2_client__GET__fetch__params_T}auth0__v2_client__GET__fetch__params_T */
|
|
8
8
|
export const [
|
|
9
9
|
auth0__v2_client__GET__fetch,
|
|
10
10
|
auth0__v2_client__GET__fetch2,
|
|
@@ -14,7 +14,7 @@ export const [
|
|
|
14
14
|
* @param {auth0__v2_client__GET__fetch__params_T}params
|
|
15
15
|
* @returns {Promise<response_pair_T<Client>>}
|
|
16
16
|
*/
|
|
17
|
-
async(
|
|
17
|
+
async (
|
|
18
18
|
ctx,
|
|
19
19
|
params
|
|
20
20
|
)=>{
|
package/{src/auth0__v2_client_grants__GET__fetch → auth0__v2_client_grants__GET__fetch}/index.js
RENAMED
|
@@ -5,7 +5,7 @@ import { auth0_management__token__new } from '../auth0_management__token__new/in
|
|
|
5
5
|
/** @typedef {import('@ctx-core/fetch').response_pair_T}response_pair_T */
|
|
6
6
|
/** @typedef {import('@ctx-core/object').Ctx}Ctx */
|
|
7
7
|
/** @typedef {import('auth0').CreateClientGrant}CreateClientGrant */
|
|
8
|
-
/** @typedef {import('./
|
|
8
|
+
/** @typedef {import('./index.d.ts').auth0__v2_client_grants__GET__fetch__params_T}auth0__v2_client_grants__GET__fetch__params_T */
|
|
9
9
|
export const [
|
|
10
10
|
auth0__v2_client_grants__GET__fetch,
|
|
11
11
|
auth0__v2_client_grants__GET__fetch2,
|
|
@@ -15,7 +15,7 @@ export const [
|
|
|
15
15
|
* @param {auth0__v2_client_grants__GET__fetch__params_T}params
|
|
16
16
|
* @returns {Promise<response_pair_T<CreateClientGrant>>}
|
|
17
17
|
*/
|
|
18
|
-
async(ctx, params)=>{
|
|
18
|
+
async (ctx, params)=>{
|
|
19
19
|
const { query, json } = params
|
|
20
20
|
const auth0__token = await auth0_management__token__new(ctx)
|
|
21
21
|
const authorization = header__access_token__verify(auth0__token)
|
|
@@ -3,7 +3,7 @@ import { fetch__template_pair__new } from '@ctx-core/fetch'
|
|
|
3
3
|
import { auth0_management__token__new } from '../auth0_management__token__new/index.js'
|
|
4
4
|
/** @typedef {import('@ctx-core/object').Ctx}Ctx */
|
|
5
5
|
/** @typedef {import('auth0').User}User */
|
|
6
|
-
/** @typedef {import('./
|
|
6
|
+
/** @typedef {import('./index.d.ts').auth0__v2_user__GET__fetch__params_T}auth0__v2_user__GET__fetch__params_T */
|
|
7
7
|
export const [
|
|
8
8
|
auth0__v2_user__GET__fetch,
|
|
9
9
|
auth0__v2_user__GET__fetch2,
|
|
@@ -13,7 +13,7 @@ export const [
|
|
|
13
13
|
* @param {auth0__v2_user__GET__fetch__params_T}params
|
|
14
14
|
* @return {Promise<Response>}
|
|
15
15
|
*/
|
|
16
|
-
async(ctx, params)=>{
|
|
16
|
+
async (ctx, params)=>{
|
|
17
17
|
const AUTH0_DOMAIN = params.AUTH0_DOMAIN || AUTH0_DOMAIN_(ctx)
|
|
18
18
|
const { user_id } = params
|
|
19
19
|
const auth0__token = await auth0_management__token__new(ctx)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { AUTH0_DOMAIN__set } from '@ctx-core/auth0'
|
|
2
|
+
import { ctx__new } from '@ctx-core/object'
|
|
3
|
+
import { type UserProfile } from 'auth0'
|
|
4
|
+
import { restore, stub } from 'sinon'
|
|
5
|
+
import { test } from 'uvu'
|
|
6
|
+
import { equal } from 'uvu/assert'
|
|
7
|
+
import { auth0_management__init } from '../auth0_management__init/index.js'
|
|
8
|
+
import { auth0__v2_user__GET__fetch, auth0__v2_user__GET__fetch2 } from '../index.js'
|
|
9
|
+
test.after.each(()=>restore())
|
|
10
|
+
test('auth0__v2_user__GET__fetch', async ()=>{
|
|
11
|
+
const ctx = ctx__new()
|
|
12
|
+
AUTH0_DOMAIN__set(ctx, 'myapp.auth0.com')
|
|
13
|
+
auth0_management__init(ctx, {
|
|
14
|
+
AUTH0_MANAGEMENT_ID: 'AUTH0_MANAGEMENT_ID',
|
|
15
|
+
AUTH0_MANAGEMENT_SECRET: 'AUTH0_MANAGEMENT_SECRET'
|
|
16
|
+
})
|
|
17
|
+
const auth0__user = auth0__user__new()
|
|
18
|
+
api_v2_user__stub(auth0__user)
|
|
19
|
+
const response = await auth0__v2_user__GET__fetch(ctx, {
|
|
20
|
+
user_id: '123'
|
|
21
|
+
})
|
|
22
|
+
equal(response.status, 200)
|
|
23
|
+
equal(await response.json(), auth0__user)
|
|
24
|
+
})
|
|
25
|
+
test('auth0__v2_user__GET__fetch2', async ()=>{
|
|
26
|
+
const ctx = ctx__new()
|
|
27
|
+
AUTH0_DOMAIN__set(ctx, 'myapp.auth0.com')
|
|
28
|
+
auth0_management__init(ctx, {
|
|
29
|
+
AUTH0_MANAGEMENT_ID: 'AUTH0_MANAGEMENT_ID',
|
|
30
|
+
AUTH0_MANAGEMENT_SECRET: 'AUTH0_MANAGEMENT_SECRET'
|
|
31
|
+
})
|
|
32
|
+
const test__auth0__user = auth0__user__new()
|
|
33
|
+
api_v2_user__stub(test__auth0__user)
|
|
34
|
+
const [auth0__user, response] =
|
|
35
|
+
await auth0__v2_user__GET__fetch2(ctx, {
|
|
36
|
+
user_id: '123'
|
|
37
|
+
})
|
|
38
|
+
equal(response.status, 200)
|
|
39
|
+
equal(auth0__user, test__auth0__user)
|
|
40
|
+
})
|
|
41
|
+
test.run()
|
|
42
|
+
function auth0__user__new() {
|
|
43
|
+
return {
|
|
44
|
+
'user_id': 'auth0|507f1f77bcf86cd799439020',
|
|
45
|
+
'email': 'john.doe@gmail.com',
|
|
46
|
+
'email_verified': false,
|
|
47
|
+
'username': 'johndoe',
|
|
48
|
+
'phone_number': '+199999999999999',
|
|
49
|
+
'phone_verified': false,
|
|
50
|
+
'created_at': '',
|
|
51
|
+
'updated_at': '',
|
|
52
|
+
'identities': [
|
|
53
|
+
{
|
|
54
|
+
'connection': 'Initial-Connection',
|
|
55
|
+
'user_id': '507f1f77bcf86cd799439020',
|
|
56
|
+
'provider': 'auth0',
|
|
57
|
+
'isSocial': false
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
'app_metadata': {},
|
|
61
|
+
'user_metadata': {},
|
|
62
|
+
'picture': '',
|
|
63
|
+
'name': '',
|
|
64
|
+
'nickname': '',
|
|
65
|
+
'multifactor': [
|
|
66
|
+
''
|
|
67
|
+
],
|
|
68
|
+
'last_ip': '',
|
|
69
|
+
'last_login': '',
|
|
70
|
+
'logins_count': 0,
|
|
71
|
+
'blocked': false,
|
|
72
|
+
'given_name': '',
|
|
73
|
+
'family_name': ''
|
|
74
|
+
} as UserProfile
|
|
75
|
+
}
|
|
76
|
+
function api_v2_user__stub(auth0__user:UserProfile) {
|
|
77
|
+
const fetch = stub(globalThis, 'fetch')
|
|
78
|
+
fetch
|
|
79
|
+
.withArgs('https://myapp.auth0.com/oauth/token', {
|
|
80
|
+
method: 'POST',
|
|
81
|
+
headers: { 'Content-Type': 'application/json' },
|
|
82
|
+
body: JSON.stringify({
|
|
83
|
+
grant_type: 'client_credentials',
|
|
84
|
+
client_id: 'AUTH0_MANAGEMENT_ID',
|
|
85
|
+
client_secret: 'AUTH0_MANAGEMENT_SECRET',
|
|
86
|
+
audience: 'https://myapp.auth0.com/api/v2/',
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
.resolves(new Response(JSON.stringify({
|
|
90
|
+
access_token: 'access_token',
|
|
91
|
+
token_type: 'Bearer',
|
|
92
|
+
}), {
|
|
93
|
+
status: 200,
|
|
94
|
+
headers: {
|
|
95
|
+
'Content-Type': 'application/json'
|
|
96
|
+
}
|
|
97
|
+
}))
|
|
98
|
+
fetch.withArgs('https://myapp.auth0.com/api/v2/users/123')
|
|
99
|
+
.resolves(new Response(JSON.stringify(auth0__user), {
|
|
100
|
+
status: 200,
|
|
101
|
+
headers: {
|
|
102
|
+
'Content-Type': 'application/json'
|
|
103
|
+
}
|
|
104
|
+
}))
|
|
105
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { fetch__template_pair_T } from '@ctx-core/fetch'
|
|
2
2
|
import type { Ctx } from '@ctx-core/object'
|
|
3
|
-
import type {
|
|
3
|
+
import type { UserProfile, UserUpdate } from 'auth0'
|
|
4
4
|
import type { Auth0Error } from 'auth0-js'
|
|
5
5
|
export declare const [
|
|
6
6
|
auth0__v2_user__PATCH__fetch,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { AUTH0_DOMAIN_, header__access_token__verify } from '@ctx-core/auth0'
|
|
2
2
|
import { fetch__template_pair__new } from '@ctx-core/fetch'
|
|
3
|
-
import {
|
|
4
|
-
auth0_management__token__new
|
|
5
|
-
} from '../auth0_management__token__new/index.js'
|
|
3
|
+
import { auth0_management__token__new } from '../auth0_management__token__new/index.js'
|
|
6
4
|
/** @typedef {import('@ctx-core/object').Ctx}Ctx */
|
|
7
5
|
/** @typedef {import('auth0').UpdateUserData}UpdateUserData */
|
|
8
|
-
/** @typedef {import('./
|
|
6
|
+
/** @typedef {import('./index.d.ts').auth0__v2_user__PATCH__fetch__data_T}auth0__v2_user__PATCH__fetch__data_T */
|
|
9
7
|
/** @typedef {import('./index.d.ts').auth0__v2_user__PATCH__error_T}auth0__v2_user__PATCH__error_T */
|
|
10
8
|
export const [
|
|
11
9
|
auth0__v2_user__PATCH__fetch,
|
package/{src/auth0__v2_users_by_email__GET__fetch → auth0__v2_users_by_email__GET__fetch}/index.d.ts
RENAMED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { fetch__template_pair_T } from '@ctx-core/fetch'
|
|
2
2
|
import type { Ctx } from '@ctx-core/object'
|
|
3
|
-
import type { Auth0Error } from 'auth0-js'
|
|
4
|
-
import type { Auth0UserProfile } from 'auth0-js'
|
|
3
|
+
import type { Auth0Error, Auth0UserProfile } from 'auth0-js'
|
|
5
4
|
export declare const [
|
|
6
5
|
auth0__v2_users_by_email__GET__fetch,
|
|
7
6
|
auth0__v2_users_by_email__GET__fetch2,
|
package/{src/auth0__v2_users_by_email__GET__fetch → auth0__v2_users_by_email__GET__fetch}/index.js
RENAMED
|
@@ -3,7 +3,7 @@ import { fetch__template_pair__new } from '@ctx-core/fetch'
|
|
|
3
3
|
import { auth0_management__token__new } from '../auth0_management__token__new/index.js'
|
|
4
4
|
/** @typedef {import('@ctx-core/object').Ctx}Ctx */
|
|
5
5
|
/** @type {import('auth0-js').Auth0UserProfile}Auth0UserProfile */
|
|
6
|
-
/** @typedef {import('./
|
|
6
|
+
/** @typedef {import('./index.d.ts').auth0__v2_users_by_email__GET__fetch__params_T}auth0__v2_users_by_email__GET__fetch__params_T */
|
|
7
7
|
export const [
|
|
8
8
|
auth0__v2_users_by_email__GET__fetch,
|
|
9
9
|
auth0__v2_users_by_email__GET__fetch2,
|
|
@@ -46,39 +46,39 @@ test.run()
|
|
|
46
46
|
function fetch__users_by_email__stub(user_a:Auth0UserProfile[]) {
|
|
47
47
|
const fetch = stub(globalThis, 'fetch')
|
|
48
48
|
fetch
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
})
|
|
49
|
+
.withArgs('https://myapp.auth0.com/oauth/token', {
|
|
50
|
+
method: 'POST',
|
|
51
|
+
headers: { 'Content-Type': 'application/json' },
|
|
52
|
+
body: JSON.stringify({
|
|
53
|
+
grant_type: 'client_credentials',
|
|
54
|
+
client_id: 'AUTH0_MANAGEMENT_ID',
|
|
55
|
+
client_secret: 'AUTH0_MANAGEMENT_SECRET',
|
|
56
|
+
audience: 'https://myapp.auth0.com/api/v2/',
|
|
58
57
|
})
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
58
|
+
})
|
|
59
|
+
.resolves(new Response(JSON.stringify({
|
|
60
|
+
access_token: 'access_token',
|
|
61
|
+
token_type: 'Bearer',
|
|
62
|
+
}), {
|
|
63
|
+
status: 200,
|
|
64
|
+
headers: {
|
|
65
|
+
'Content-Type': 'application/json'
|
|
66
|
+
}
|
|
67
|
+
}))
|
|
68
68
|
fetch
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
69
|
+
.withArgs('https://myapp.auth0.com/api/v2/users-by-email?email=john.doe%40gmail.com', {
|
|
70
|
+
'method': 'GET',
|
|
71
|
+
'headers': {
|
|
72
|
+
'Content-Type': 'application/json',
|
|
73
|
+
'authorization': 'Bearer access_token'
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
.resolves(new Response(JSON.stringify(user_a), {
|
|
77
|
+
status: 200,
|
|
78
|
+
headers: {
|
|
79
|
+
'Content-Type': 'application/json'
|
|
80
|
+
}
|
|
81
|
+
}))
|
|
82
82
|
}
|
|
83
83
|
function user_a_():Auth0UserProfile[] {
|
|
84
84
|
return [
|
|
@@ -6,7 +6,7 @@ const require = createRequire(import.meta.url)
|
|
|
6
6
|
const { ManagementClient } = require('auth0')
|
|
7
7
|
/** @typedef {import('@ctx-core/object').Ctx}Ctx */
|
|
8
8
|
/** @typedef {import('auth0').ManagementClient}ManagementClient */
|
|
9
|
-
/** @typedef {import('./
|
|
9
|
+
/** @typedef {import('./index.d.ts').auth0_management__params_T}auth0_management__params_T */
|
|
10
10
|
/**
|
|
11
11
|
* @param {Ctx}ctx
|
|
12
12
|
* @param {auth0_management__params_T}params
|
|
@@ -15,30 +15,30 @@ test('auth0_management__token__new|error', async ()=>{
|
|
|
15
15
|
fetch__oauth_token__stub()
|
|
16
16
|
let err
|
|
17
17
|
await auth0_management__token__new(ctx)
|
|
18
|
-
|
|
18
|
+
.catch($err=>err = $err)
|
|
19
19
|
equal(!!err, true)
|
|
20
|
-
equal(err
|
|
20
|
+
equal(err!.message, 'security error: invalid credentials')
|
|
21
21
|
function fetch__oauth_token__stub() {
|
|
22
22
|
stub(globalThis, 'fetch')
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})
|
|
23
|
+
.withArgs('https://myapp.auth0.com/oauth/token', {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
headers: { 'Content-Type': 'application/json' },
|
|
26
|
+
body: JSON.stringify({
|
|
27
|
+
grant_type: 'client_credentials',
|
|
28
|
+
client_id: 'AUTH0_MANAGEMENT_ID',
|
|
29
|
+
client_secret: 'AUTH0_MANAGEMENT_SECRET',
|
|
30
|
+
audience: 'https://myapp.auth0.com/api/v2/',
|
|
32
31
|
})
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
32
|
+
})
|
|
33
|
+
.resolves(new Response(JSON.stringify({
|
|
34
|
+
error: 'security error',
|
|
35
|
+
error_description: 'invalid credentials'
|
|
36
|
+
}), {
|
|
37
|
+
status: 403,
|
|
38
|
+
headers: {
|
|
39
|
+
'Content-Type': 'application/json',
|
|
40
|
+
}
|
|
41
|
+
}))
|
|
42
42
|
}
|
|
43
43
|
})
|
|
44
44
|
test.run()
|
package/bin/auth0.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { import_meta_env_ } from '@ctx-core/env'
|
|
3
3
|
import { ctx__new } from '@ctx-core/object'
|
|
4
|
-
import { auth0__v2_client_grants__GET__fetch2, auth0__v2__url_ } from '../
|
|
4
|
+
import { auth0__v2_client_grants__GET__fetch2, auth0__v2__url_ } from '../index.js'
|
|
5
5
|
await main()
|
|
6
6
|
async function main() {
|
|
7
7
|
const ctx = ctx__new()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/auth0-management",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.8.0",
|
|
4
4
|
"description": "ctx-core auth0 management api",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -17,9 +17,25 @@
|
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"author": "Brian Takita",
|
|
19
19
|
"type": "module",
|
|
20
|
-
"
|
|
20
|
+
"files": [
|
|
21
|
+
"*.d.ts",
|
|
22
|
+
"./bin",
|
|
23
|
+
"./auth0__user",
|
|
24
|
+
"./auth0__v2_client__GET__fetch",
|
|
25
|
+
"./auth0__v2_client_grants__GET__fetch",
|
|
26
|
+
"./auth0__v2_user__GET__fetch",
|
|
27
|
+
"./auth0__v2_user__PATCH__fetch",
|
|
28
|
+
"./auth0__v2_users_by_email__GET__fetch",
|
|
29
|
+
"./auth0_management__client_credentials__body__new",
|
|
30
|
+
"./auth0_management__init",
|
|
31
|
+
"./auth0_management__new",
|
|
32
|
+
"./auth0_management__token__new",
|
|
33
|
+
"./AUTH0_MANAGEMENT_ID",
|
|
34
|
+
"./AUTH0_MANAGEMENT_SECRET"
|
|
35
|
+
],
|
|
36
|
+
"types": "./index.d.ts",
|
|
21
37
|
"exports": {
|
|
22
|
-
".": "./
|
|
38
|
+
".": "./index.js",
|
|
23
39
|
"./package.json": "./package.json"
|
|
24
40
|
},
|
|
25
41
|
"bin": {
|
|
@@ -28,13 +44,13 @@
|
|
|
28
44
|
"getAll-client-grants-auth0": "./bin/getAll-client-grants-auth0.mjs"
|
|
29
45
|
},
|
|
30
46
|
"dependencies": {
|
|
31
|
-
"@ctx-core/auth0": "^40.0
|
|
32
|
-
"@ctx-core/env": "^17.
|
|
33
|
-
"@ctx-core/error": "^12.
|
|
34
|
-
"@ctx-core/fetch": "^13.0
|
|
35
|
-
"@ctx-core/nanostores": "7.0
|
|
36
|
-
"@ctx-core/object": "^
|
|
37
|
-
"@ctx-core/uri": "^12.
|
|
47
|
+
"@ctx-core/auth0": "^40.1.0",
|
|
48
|
+
"@ctx-core/env": "^17.4.0",
|
|
49
|
+
"@ctx-core/error": "^12.4.0",
|
|
50
|
+
"@ctx-core/fetch": "^13.1.0",
|
|
51
|
+
"@ctx-core/nanostores": "7.1.0",
|
|
52
|
+
"@ctx-core/object": "^30.1.0",
|
|
53
|
+
"@ctx-core/uri": "^12.5.0",
|
|
38
54
|
"auth0": "^4.1.0"
|
|
39
55
|
},
|
|
40
56
|
"devDependencies": {
|
|
@@ -52,7 +68,6 @@
|
|
|
52
68
|
"access": "public",
|
|
53
69
|
"cache": "~/.npm"
|
|
54
70
|
},
|
|
55
|
-
"svelte": "./src/index.js",
|
|
56
71
|
"sideEffects": false,
|
|
57
72
|
"scripts": {
|
|
58
73
|
"build": ":",
|
package/.ideaexclude
DELETED