Skip to content

Commit 74ffa44

Browse files
authored
feat: add DPoP support for proof-of-possession mechanism in resourceServers (#1132)
* feat: Add proof_of_possession validation to resource servers schema and tests * feat: Enhance proof_of_possession validation in resource servers schema and tests * chore: Update eslint-config-prettier to version 8.10.2 in package.json and package-lock.json * chore: Update eslint-config packages to latest versions and refactor promise syntax in tests * chore: Update undici dependency to version 7.12.0 in package.json * chore: Update undici dependency to version 7.12.0 in package-lock.json
1 parent c4e4ccd commit 74ffa44

File tree

8 files changed

+324
-45
lines changed

8 files changed

+324
-45
lines changed

package-lock.json

Lines changed: 51 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"nconf": "^0.13.0",
4343
"promise-pool-executor": "^1.1.1",
4444
"sanitize-filename": "^1.6.3",
45-
"undici": "^7.11.0",
45+
"undici": "^7.12.0",
4646
"winston": "^3.17.0",
4747
"yargs": "^15.4.1"
4848
},
@@ -55,8 +55,8 @@
5555
"chai": "^4.5.0",
5656
"chai-as-promised": "^7.1.2",
5757
"eslint": "^7.32.0",
58-
"eslint-config-airbnb-base": "^14.2.1",
59-
"eslint-config-prettier": "^8.10.0",
58+
"eslint-config-airbnb-base": "^15.0.0",
59+
"eslint-config-prettier": "^10.1.8",
6060
"eslint-plugin-import": "^2.32.0",
6161
"husky": "^9.1.7",
6262
"kacl": "^1.1.1",

src/tools/auth0/handlers/resourceServers.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ResourceServer } from 'auth0';
1+
import { ResourceServer, ResourceServerProofOfPossessionMechanismEnum } from 'auth0';
22
import ValidationError from '../../validationError';
33

44
import constants from '../../constants';
@@ -31,6 +31,17 @@ export const schema = {
3131
},
3232
enforce_policies: { type: 'boolean' },
3333
token_dialect: { type: 'string' },
34+
proof_of_possession: {
35+
type: 'object',
36+
properties: {
37+
mechanism: {
38+
type: 'string',
39+
enum: Object.values(ResourceServerProofOfPossessionMechanismEnum),
40+
},
41+
required: { type: 'boolean' },
42+
},
43+
required: ['mechanism', 'required'],
44+
},
3445
},
3546
required: ['name', 'identifier'],
3647
},

test/context/directory/context.test.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,22 +158,25 @@ describe('#directory context validation', () => {
158158
{
159159
tenants: {
160160
getSettings: async () =>
161-
new Promise((res) =>
161+
new Promise((res) => {
162162
res({
163163
data: {
164164
friendly_name: 'Production Tenant',
165165
enabled_locales: ['en', 'es'],
166166
},
167-
})
168-
),
167+
});
168+
}),
169169
},
170170
prompts: {
171171
_getRestClient: (endpoint) => ({
172172
get: (...options) => Promise.resolve({ endpoint, method: 'get', options }),
173173
}),
174174
},
175175
actions: {
176-
getSettings: async () => new Promise((res) => res([])),
176+
getSettings: async () =>
177+
new Promise((res) => {
178+
res([]);
179+
}),
177180
},
178181
}
179182
);

test/context/yaml/context.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,14 +610,14 @@ describe('#YAML context validation', () => {
610610
{
611611
tenants: {
612612
getSettings: async () =>
613-
new Promise((res) =>
614-
res({
613+
new Promise((resolve) => {
614+
resolve({
615615
data: {
616616
friendly_name: 'Production Tenant',
617617
enabled_locales: ['en', 'es'],
618618
},
619-
})
620-
),
619+
});
620+
}),
621621
},
622622
connections: {
623623
getAll: (params) =>

0 commit comments

Comments
 (0)