Skip to content

Commit 36816a9

Browse files
authored
feat: add support for organization discovery domains (#1187)
* feat: add discovery domain handling to organisations feat(clients.ts): rename multiResourceRefreshTokenPolicies to multiResourceRefreshTokenPoliciesSchema feat(clients.ts): allow organization_discovery_methods to accept null values * e2e update
1 parent fe70aad commit 36816a9

12 files changed

Lines changed: 8574 additions & 13959 deletions

src/context/directory/handlers/organizations.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ async function dump(context: DirectoryContext): Promise<void> {
6161
});
6262
}
6363

64+
if (organization.discovery_domains && organization.discovery_domains.length > 0) {
65+
organization.discovery_domains = organization.discovery_domains.map((dd) => {
66+
// discovery_domains id is a computed field
67+
delete dd.id;
68+
69+
return {
70+
...dd,
71+
};
72+
});
73+
}
74+
6475
dumpJSON(organizationFile, organization);
6576
});
6677
}

src/context/yaml/handlers/organizations.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { YAMLHandler } from '.';
22
import YAMLContext from '..';
3-
import { Asset, ParsedAsset } from '../../../types';
3+
import { Asset } from '../../../types';
44

55
type ParsedOrganizations = {
66
organizations: Asset[] | null;
@@ -36,6 +36,16 @@ async function dump(context: YAMLContext): Promise<ParsedOrganizations> {
3636
};
3737
});
3838
}
39+
if (org.discovery_domains && org.discovery_domains.length > 0) {
40+
org.discovery_domains = org.discovery_domains.map((dd) => {
41+
// discovery_domains id is a computed field
42+
delete dd.id;
43+
44+
return {
45+
...dd,
46+
};
47+
});
48+
}
3949

4050
return org;
4151
}),

src/tools/auth0/handlers/clients.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Assets } from '../../../types';
22
import { paginate } from '../client';
33
import DefaultAPIHandler from './default';
44

5-
const multiResourceRefreshTokenPolicies = {
5+
const multiResourceRefreshTokenPoliciesSchema = {
66
type: ['array', 'null'],
77
description:
88
'A collection of policies governing multi-resource refresh token exchange (MRRT), defining how refresh tokens can be used across different resource servers',
@@ -79,7 +79,7 @@ export const schema = {
7979
type: ['object', 'null'],
8080
description: 'Refresh token configuration',
8181
properties: {
82-
policies: multiResourceRefreshTokenPolicies,
82+
policies: multiResourceRefreshTokenPoliciesSchema,
8383
},
8484
},
8585
token_quota: {
@@ -145,6 +145,21 @@ export const schema = {
145145
description:
146146
'The identifier of a resource server in your tenant. This property links a client to a resource server indicating that the client IS that resource server. Can only be set when app_type=resource_server.',
147147
},
148+
organization_usage: {
149+
type: 'string',
150+
enum: ['deny', 'allow', 'require'],
151+
},
152+
organization_require_behavior: {
153+
type: 'string',
154+
enum: ['no_prompt', 'pre_login_prompt', 'post_login_prompt'],
155+
},
156+
organization_discovery_methods: {
157+
type: ['array', 'null'],
158+
items: {
159+
type: 'string',
160+
enum: ['email', 'organization_name'],
161+
},
162+
},
148163
skip_non_verifiable_callback_uri_confirmation_prompt: {
149164
type: ['boolean', 'null'],
150165
description: 'Whether to skip the confirmation prompt for non-verifiable callback URIs',

0 commit comments

Comments
 (0)