diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..d740ffe90 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,15 @@ +coverage: + status: + project: + default: + # Allow up to 1% drop from base coverage + threshold: 1% + patch: + default: + # Allow patch coverage to be 5% below project coverage + threshold: 5% + +comment: + layout: "reach,diff,flags,files" + behavior: default + require_changes: false diff --git a/reference.md b/reference.md index 733a8a058..a2b562d6e 100644 --- a/reference.md +++ b/reference.md @@ -1436,6 +1436,469 @@ await client.clients.rotateSecret("id"); +## ConnectionProfiles + +
client.connectionProfiles.list({ ...params }) -> core.Page +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +const pageableResponse = await client.connectionProfiles.list({ + from: "from", + take: 1, +}); +for await (const item of pageableResponse) { + console.log(item); +} + +// Or you can manually iterate page-by-page +let page = await client.connectionProfiles.list({ + from: "from", + take: 1, +}); +while (page.hasNextPage()) { + page = page.getNextPage(); +} + +// You can also access the underlying response +const response = page.response; +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Management.ListConnectionProfileRequestParameters` + +
+
+ +
+
+ +**requestOptions:** `ConnectionProfilesClient.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.connectionProfiles.create({ ...params }) -> Management.CreateConnectionProfileResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a Connection Profile. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.connectionProfiles.create({ + name: "name", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Management.CreateConnectionProfileRequestContent` + +
+
+ +
+
+ +**requestOptions:** `ConnectionProfilesClient.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.connectionProfiles.listTemplates() -> Management.ListConnectionProfileTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a list of Connection Profile Templates. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.connectionProfiles.listTemplates(); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `ConnectionProfilesClient.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.connectionProfiles.getTemplate(id) -> Management.GetConnectionProfileTemplateResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve a Connection Profile Template. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.connectionProfiles.getTemplate("id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — ID of the connection-profile-template to retrieve. + +
+
+ +
+
+ +**requestOptions:** `ConnectionProfilesClient.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.connectionProfiles.get(id) -> Management.GetConnectionProfileResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve details about a single Connection Profile specified by ID. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.connectionProfiles.get("id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — ID of the connection-profile to retrieve. + +
+
+ +
+
+ +**requestOptions:** `ConnectionProfilesClient.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.connectionProfiles.delete(id) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a single Connection Profile specified by ID. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.connectionProfiles.delete("id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — ID of the connection-profile to delete. + +
+
+ +
+
+ +**requestOptions:** `ConnectionProfilesClient.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.connectionProfiles.update(id, { ...params }) -> Management.UpdateConnectionProfileResponseContent +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the details of a specific Connection Profile. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.connectionProfiles.update("id"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — ID of the connection profile to update. + +
+
+ +
+
+ +**request:** `Management.UpdateConnectionProfileRequestContent` + +
+
+ +
+
+ +**requestOptions:** `ConnectionProfilesClient.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Connections
client.connections.list({ ...params }) -> core.Page @@ -20928,8 +21391,6 @@ await client.prompts.rendering.bulkUpdate({ { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}], }, ], }); @@ -21092,10 +21553,7 @@ Learn more about ; +export interface ConnectionOptionsApple { + /** Apple App Secret (must be a PEM) */ + app_secret?: string | null; + /** Apple Services ID */ + client_id?: string | null; + /** Whether to request email from Apple */ + email?: boolean; + /** Array of freeform scopes */ + freeform_scopes?: Management.ConnectionFreeformScopes; + /** Apple Key ID */ + kid?: string | null; + /** Whether to request name from Apple */ + name?: boolean; + non_persistent_attrs?: (Management.ConnectionNonPersistentAttrs | undefined) | null; + scope?: Management.ConnectionScopeString; + set_user_root_attributes?: Management.ConnectionSetUserRootAttributesEnum; + /** Apple Team ID */ + team_id?: string | null; + upstream_params?: (Management.ConnectionUpstreamParams | undefined) | null; + /** Accepts any additional properties */ + [key: string]: any; +} /** * options for the 'auth0' connection */ -export type ConnectionOptionsAuth0 = Record; +export interface ConnectionOptionsAuth0 extends Management.ConnectionOptionsCommon { + attributes?: Management.ConnectionAttributes; + authentication_methods?: Management.ConnectionAuthenticationMethods | null; + brute_force_protection?: Management.ConnectionBruteForceProtection; + configuration?: Management.ConnectionConfiguration; + customScripts?: Management.ConnectionCustomScripts; + disable_self_service_change_password?: Management.ConnectionDisableSelfServiceChangePassword; + disable_signup?: Management.ConnectionDisableSignup; + enable_script_context?: Management.ConnectionEnableScriptContext; + enabledDatabaseCustomization?: Management.ConnectionEnabledDatabaseCustomization; + import_mode?: Management.ConnectionImportMode; + mfa?: Management.ConnectionMfa; + passkey_options?: Management.ConnectionPasskeyOptions | null; + passwordPolicy?: Management.ConnectionPasswordPolicyEnum | null; + password_complexity_options?: Management.ConnectionPasswordComplexityOptions | null; + password_dictionary?: Management.ConnectionPasswordDictionaryOptions | null; + password_history?: Management.ConnectionPasswordHistoryOptions | null; + password_no_personal_info?: Management.ConnectionPasswordNoPersonalInfoOptions | null; + precedence?: Management.ConnectionIdentifierPrecedence; + realm_fallback?: Management.ConnectionRealmFallback; + requires_username?: Management.ConnectionRequiresUsername; + validation?: Management.ConnectionValidationOptions | null; +} /** * options for the 'auth0-oidc' connection @@ -3052,6 +3181,13 @@ export type ConnectionOptionsBitly = Management.ConnectionOptionsOAuth2Common; export type ConnectionOptionsBox = Management.ConnectionOptionsOAuth2Common; +/** + * Common attributes for connection options including non-persistent attributes and cross-app access + */ +export interface ConnectionOptionsCommon { + non_persistent_attrs?: (Management.ConnectionNonPersistentAttrs | undefined) | null; +} + /** * options for the 'custom' connection */ @@ -3129,7 +3265,12 @@ export type ConnectionOptionsOAuth1 = Record; export type ConnectionOptionsOAuth2 = Management.ConnectionOptionsOAuth2Common; -export type ConnectionOptionsOAuth2Common = Record; +export interface ConnectionOptionsOAuth2Common extends Management.ConnectionOptionsCommon { + client_id?: Management.ConnectionClientId; + client_secret?: Management.ConnectionClientSecret; + upstream_params?: (Management.ConnectionUpstreamParams | undefined) | null; + set_user_root_attributes?: Management.ConnectionSetUserRootAttributesEnum; +} /** * options for the 'oidc' connection @@ -3300,6 +3441,114 @@ export const ConnectionPasswordPolicyEnum = { export type ConnectionPasswordPolicyEnum = (typeof ConnectionPasswordPolicyEnum)[keyof typeof ConnectionPasswordPolicyEnum]; +export interface ConnectionProfile { + id?: Management.ConnectionProfileId; + name?: Management.ConnectionProfileName; + organization?: Management.ConnectionProfileOrganization; + connection_name_prefix_template?: Management.ConnectionNamePrefixTemplate; + enabled_features?: Management.ConnectionProfileEnabledFeatures; + connection_config?: Management.ConnectionProfileConfig; + strategy_overrides?: Management.ConnectionProfileStrategyOverrides; +} + +/** + * Connection profile configuration. + */ +export interface ConnectionProfileConfig {} + +/** + * Enabled features for the connection profile. + */ +export type ConnectionProfileEnabledFeatures = Management.EnabledFeaturesEnum[]; + +/** + * Connection Profile identifier. + */ +export type ConnectionProfileId = string; + +/** + * The name of the connection profile. + */ +export type ConnectionProfileName = string; + +/** + * The organization of the connection profile. + */ +export interface ConnectionProfileOrganization { + show_as_button?: Management.ConnectionProfileOrganizationShowAsButtonEnum; + assign_membership_on_login?: Management.ConnectionProfileOrganizationAssignMembershipOnLoginEnum; +} + +/** Indicates if membership should be assigned on login. */ +export const ConnectionProfileOrganizationAssignMembershipOnLoginEnum = { + None: "none", + Optional: "optional", + Required: "required", +} as const; +export type ConnectionProfileOrganizationAssignMembershipOnLoginEnum = + (typeof ConnectionProfileOrganizationAssignMembershipOnLoginEnum)[keyof typeof ConnectionProfileOrganizationAssignMembershipOnLoginEnum]; + +/** Indicates if the organization should be shown as a button. */ +export const ConnectionProfileOrganizationShowAsButtonEnum = { + None: "none", + Optional: "optional", + Required: "required", +} as const; +export type ConnectionProfileOrganizationShowAsButtonEnum = + (typeof ConnectionProfileOrganizationShowAsButtonEnum)[keyof typeof ConnectionProfileOrganizationShowAsButtonEnum]; + +/** + * Connection Profile Strategy Override + */ +export interface ConnectionProfileStrategyOverride { + enabled_features?: Management.ConnectionProfileStrategyOverridesEnabledFeatures; + connection_config?: Management.ConnectionProfileStrategyOverridesConnectionConfig; +} + +/** + * Strategy-specific overrides for this attribute + */ +export interface ConnectionProfileStrategyOverrides { + pingfederate?: Management.ConnectionProfileStrategyOverride; + ad?: Management.ConnectionProfileStrategyOverride; + adfs?: Management.ConnectionProfileStrategyOverride; + waad?: Management.ConnectionProfileStrategyOverride; + "google-apps"?: Management.ConnectionProfileStrategyOverride; + okta?: Management.ConnectionProfileStrategyOverride; + oidc?: Management.ConnectionProfileStrategyOverride; + samlp?: Management.ConnectionProfileStrategyOverride; +} + +/** + * Connection profile strategy overrides connection configuration. + */ +export interface ConnectionProfileStrategyOverridesConnectionConfig {} + +/** + * Enabled features for a connections profile strategy override. + */ +export type ConnectionProfileStrategyOverridesEnabledFeatures = Management.EnabledFeaturesEnum[]; + +/** + * The structure of the template, which can be used as the payload for creating or updating a Connection Profile. + */ +export interface ConnectionProfileTemplate { + name?: Management.ConnectionProfileName; + organization?: Management.ConnectionProfileOrganization; + connection_name_prefix_template?: Management.ConnectionNamePrefixTemplate; + enabled_features?: Management.ConnectionProfileEnabledFeatures; + connection_config?: Management.ConnectionProfileConfig; + strategy_overrides?: Management.ConnectionProfileStrategyOverrides; +} + +export interface ConnectionProfileTemplateItem { + /** The id of the template. */ + id?: string; + /** The user-friendly name of the template displayed in the UI. */ + display_name?: string; + template?: Management.ConnectionProfileTemplate; +} + /** * The connection's options (depend on the connection strategy) */ @@ -3341,6 +3590,11 @@ export interface ConnectionPropertiesOptions { [key: string]: any; } +/** + * Indicates whether to use realm fallback. + */ +export type ConnectionRealmFallback = boolean; + /** * Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm. */ @@ -3357,6 +3611,11 @@ export interface ConnectionRequestCommon { connected_accounts?: Management.ConnectionConnectedAccountsPurpose; } +/** + * Indicates whether the user is required to provide a username in addition to an email address. + */ +export type ConnectionRequiresUsername = boolean; + export interface ConnectionResponseCommon extends Management.ConnectionRequestCommon { id?: Management.ConnectionId; strategy?: Management.ConnectionIdentityProviderEnum; @@ -3983,6 +4242,11 @@ export interface ConnectionResponseContentYandex extends Management.ConnectionRe name?: Management.ConnectionName; } +/** + * Space separated list of scopes + */ +export type ConnectionScopeString = string; + /** When using an external IdP, this flag determines whether 'name', 'given_name', 'family_name', 'nickname', and 'picture' attributes are updated. In addition, it also determines whether the user is created when user doesnt exist previously. Possible values are 'on_each_login' (default value, it configures the connection to automatically create the user if necessary and update the root attributes from the external IdP with each user login. When this setting is used, root attributes cannot be independently updated), 'on_first_login' (configures the connection to create the user and set the root attributes on first login only, allowing them to be independently updated thereafter), and 'never_on_login' (configures the connection not to create the user and not to set the root attributes from the external IdP, allowing them to be independently updated). */ export const ConnectionSetUserRootAttributesEnum = { OnEachLogin: "on_each_login", @@ -4283,6 +4547,7 @@ export interface CreateClientResponseContent { /** Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */ par_request_expiry?: number | null; token_quota?: Management.TokenQuota; + express_configuration?: Management.ExpressConfiguration; /** The identifier of the resource server that this client is linked to. */ resource_server_identifier?: string; async_approval_notification_channels?: Management.ClientAsyncApprovalNotificationsChannelsApiPostConfiguration; @@ -4290,6 +4555,16 @@ export interface CreateClientResponseContent { [key: string]: any; } +export interface CreateConnectionProfileResponseContent { + id?: Management.ConnectionProfileId; + name?: Management.ConnectionProfileName; + organization?: Management.ConnectionProfileOrganization; + connection_name_prefix_template?: Management.ConnectionNamePrefixTemplate; + enabled_features?: Management.ConnectionProfileEnabledFeatures; + connection_config?: Management.ConnectionProfileConfig; + strategy_overrides?: Management.ConnectionProfileStrategyOverrides; +} + /** * Create a connection with strategy=ad */ @@ -6467,6 +6742,13 @@ export const EmailTemplateNameEnum = { } as const; export type EmailTemplateNameEnum = (typeof EmailTemplateNameEnum)[keyof typeof EmailTemplateNameEnum]; +/** Enum for enabled features. */ +export const EnabledFeaturesEnum = { + Scim: "scim", + UniversalLogout: "universal_logout", +} as const; +export type EnabledFeaturesEnum = (typeof EnabledFeaturesEnum)[keyof typeof EnabledFeaturesEnum]; + /** * Encryption key */ @@ -6813,6 +7095,54 @@ export interface EventStreamWebhookResponseContent { updated_at?: string; } +/** + * Application specific configuration for use with the OIN Express Configuration feature. + */ +export interface ExpressConfiguration { + /** The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name. */ + initiate_login_uri_template: string; + /** The ID of the user attribute profile to use for this application. */ + user_attribute_profile_id: string; + /** The ID of the connection profile to use for this application. */ + connection_profile_id: string; + /** When true, all connections made via express configuration will be enabled for this application. */ + enable_client: boolean; + /** When true, all connections made via express configuration will have the associated organization enabled. */ + enable_organization: boolean; + /** List of client IDs that are linked to this express configuration (e.g. web or mobile clients). */ + linked_clients?: Management.LinkedClientConfiguration[]; + /** This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application. */ + okta_oin_client_id: string; + /** This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain. */ + admin_login_domain: string; + /** The identifier of the published application in the OKTA OIN. */ + oin_submission_id?: string; +} + +/** + * Application specific configuration for use with the OIN Express Configuration feature. + */ +export interface ExpressConfigurationOrNull { + /** The URI users should bookmark to log in to this application. Variable substitution is permitted for the following properties: organization_name, organization_id, and connection_name. */ + initiate_login_uri_template: string; + /** The ID of the user attribute profile to use for this application. */ + user_attribute_profile_id: string; + /** The ID of the connection profile to use for this application. */ + connection_profile_id: string; + /** When true, all connections made via express configuration will be enabled for this application. */ + enable_client: boolean; + /** When true, all connections made via express configuration will have the associated organization enabled. */ + enable_organization: boolean; + /** List of client IDs that are linked to this express configuration (e.g. web or mobile clients). */ + linked_clients?: Management.LinkedClientConfiguration[]; + /** This is the unique identifier for the Okta OIN Express Configuration Client, which Okta will use for this application. */ + okta_oin_client_id: string; + /** This is the domain that admins are expected to log in via for authenticating for express configuration. It can be either the canonical domain or a registered custom domain. */ + admin_login_domain: string; + /** The identifier of the published application in the OKTA OIN. */ + oin_submission_id?: string; +} + export interface ExtensibilityEmailProviderCredentials {} export interface FederatedConnectionTokenSet { @@ -6959,7 +7289,8 @@ export type FlowActionAuth0 = | Management.FlowActionAuth0CreateUser | Management.FlowActionAuth0GetUser | Management.FlowActionAuth0UpdateUser - | Management.FlowActionAuth0SendRequest; + | Management.FlowActionAuth0SendRequest + | Management.FlowActionAuth0SendEmail; export interface FlowActionAuth0CreateUser { id: string; @@ -6993,6 +7324,33 @@ export interface FlowActionAuth0GetUserParams { user_id: string; } +export interface FlowActionAuth0SendEmail { + id: string; + alias?: string; + type: "AUTH0"; + action: "SEND_EMAIL"; + allow_failure?: boolean; + mask_output?: boolean; + params: Management.FlowActionAuth0SendEmailParams; +} + +export interface FlowActionAuth0SendEmailParams { + from?: Management.FlowActionAuth0SendEmailParamsFrom; + to: Management.FlowActionAuth0SendEmailParamsTo; + subject: string; + body: string; + custom_vars?: Management.FlowActionAuth0SendRequestParamsCustomVars; +} + +export interface FlowActionAuth0SendEmailParamsFrom { + name?: string; + email: Management.FlowActionAuth0SendEmailParamsFromEmail; +} + +export type FlowActionAuth0SendEmailParamsFromEmail = string; + +export type FlowActionAuth0SendEmailParamsTo = string; + export interface FlowActionAuth0SendRequest { id: string; alias?: string; @@ -7023,6 +7381,8 @@ export namespace FlowActionAuth0SendRequestParams { export type Method = (typeof Method)[keyof typeof Method]; } +export type FlowActionAuth0SendRequestParamsCustomVars = Record; + export type FlowActionAuth0SendRequestParamsHeaders = Record; export type FlowActionAuth0SendRequestParamsPayload = @@ -9598,6 +9958,7 @@ export interface GetClientResponseContent { /** Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */ par_request_expiry?: number | null; token_quota?: Management.TokenQuota; + express_configuration?: Management.ExpressConfiguration; /** The identifier of the resource server that this client is linked to. */ resource_server_identifier?: string; async_approval_notification_channels?: Management.ClientAsyncApprovalNotificationsChannelsApiPostConfiguration; @@ -9614,6 +9975,24 @@ export interface GetConnectionEnabledClientsResponseContent { [key: string]: any; } +export interface GetConnectionProfileResponseContent { + id?: Management.ConnectionProfileId; + name?: Management.ConnectionProfileName; + organization?: Management.ConnectionProfileOrganization; + connection_name_prefix_template?: Management.ConnectionNamePrefixTemplate; + enabled_features?: Management.ConnectionProfileEnabledFeatures; + connection_config?: Management.ConnectionProfileConfig; + strategy_overrides?: Management.ConnectionProfileStrategyOverrides; +} + +export interface GetConnectionProfileTemplateResponseContent { + /** The id of the template. */ + id?: string; + /** The user-friendly name of the template displayed in the UI. */ + display_name?: string; + template?: Management.ConnectionProfileTemplate; +} + export interface GetConnectionResponseContent { /** The name of the connection */ name?: string; @@ -10412,6 +10791,7 @@ export interface GetTenantSettingsResponseContent { * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. */ skip_non_verifiable_callback_uri_confirmation_prompt?: boolean | null; + resource_parameter_profile?: Management.TenantSettingsResourceParameterProfile; } export interface GetTokenExchangeProfileResponseContent { @@ -10919,6 +11299,14 @@ export const JobFileFormatEnum = { } as const; export type JobFileFormatEnum = (typeof JobFileFormatEnum)[keyof typeof JobFileFormatEnum]; +/** + * Configuration for linked clients in the OIN Express Configuration feature. + */ +export interface LinkedClientConfiguration { + /** The ID of the linked client. */ + client_id: string; +} + export interface ListActionBindingsPaginatedResponseContent { /** The total result count. */ total?: number; @@ -10996,6 +11384,16 @@ export interface ListClientsOffsetPaginatedResponseContent { clients?: Management.Client[]; } +export interface ListConnectionProfileTemplateResponseContent { + connection_profile_templates?: Management.ConnectionProfileTemplateItem[]; +} + +export interface ListConnectionProfilesPaginatedResponseContent { + /** A cursor to be used as the "from" query parameter for the next page of results. */ + next?: string; + connection_profiles?: Management.ConnectionProfile[]; +} + export interface ListConnectionsCheckpointPaginatedResponseContent { /** Opaque identifier for use with the from query parameter for the next page of results. */ next?: string; @@ -11940,11 +12338,12 @@ export interface NetworkAclRule { scope: Management.NetworkAclRuleScopeEnum; } -/** Identifies the origin of the request as the Management API (management), Authentication API (authentication), or either (tenant) */ +/** Identifies the origin of the request as the Management API (management), Authentication API (authentication), Dynamic Client Registration API (dynamic_client_registration), or any (tenant) */ export const NetworkAclRuleScopeEnum = { Management: "management", Authentication: "authentication", Tenant: "tenant", + DynamicClientRegistration: "dynamic_client_registration", } as const; export type NetworkAclRuleScopeEnum = (typeof NetworkAclRuleScopeEnum)[keyof typeof NetworkAclRuleScopeEnum]; @@ -12859,6 +13258,7 @@ export interface RotateClientSecretResponseContent { /** Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */ par_request_expiry?: number | null; token_quota?: Management.TokenQuota; + express_configuration?: Management.ExpressConfiguration; /** The identifier of the resource server that this client is linked to. */ resource_server_identifier?: string; async_approval_notification_channels?: Management.ClientAsyncApprovalNotificationsChannelsApiPostConfiguration; @@ -13200,7 +13600,7 @@ export interface SelfServiceProfileSsoTicketIdpInitiatedOptions { */ export interface SelfServiceProfileSsoTicketProvisioningConfig { /** The scopes of the SCIM tokens generated during the self-service flow. */ - scopes: Management.SelfServiceProfileSsoTicketProvisioningScopeEnum[]; + scopes?: Management.SelfServiceProfileSsoTicketProvisioningScopeEnum[]; /** Lifetime of the tokens in seconds. Must be greater than 900. If not provided, the tokens don't expire. */ token_lifetime?: number | null; } @@ -13881,6 +14281,14 @@ export interface TenantSettingsPasswordPage { html?: string; } +/** Profile that determines how the identity of the protected resource (i.e., API) can be specified in the OAuth endpoints when access is being requested. When set to audience (default), the audience parameter is used to specify the resource server. When set to compatibility, the audience parameter is still checked first, but if it not provided, then the resource parameter can be used to specify the resource server. */ +export const TenantSettingsResourceParameterProfile = { + Audience: "audience", + Compatibility: "compatibility", +} as const; +export type TenantSettingsResourceParameterProfile = + (typeof TenantSettingsResourceParameterProfile)[keyof typeof TenantSettingsResourceParameterProfile]; + /** * Sessions related settings for tenant */ @@ -14294,6 +14702,7 @@ export interface UpdateClientResponseContent { /** Specifies how long, in seconds, a Pushed Authorization Request URI remains valid */ par_request_expiry?: number | null; token_quota?: Management.TokenQuota; + express_configuration?: Management.ExpressConfiguration; /** The identifier of the resource server that this client is linked to. */ resource_server_identifier?: string; async_approval_notification_channels?: Management.ClientAsyncApprovalNotificationsChannelsApiPostConfiguration; @@ -14342,6 +14751,16 @@ export interface UpdateConnectionOptions { [key: string]: any; } +export interface UpdateConnectionProfileResponseContent { + id?: Management.ConnectionProfileId; + name?: Management.ConnectionProfileName; + organization?: Management.ConnectionProfileOrganization; + connection_name_prefix_template?: Management.ConnectionNamePrefixTemplate; + enabled_features?: Management.ConnectionProfileEnabledFeatures; + connection_config?: Management.ConnectionProfileConfig; + strategy_overrides?: Management.ConnectionProfileStrategyOverrides; +} + export interface UpdateConnectionResponseContent { /** The name of the connection */ name?: string; @@ -14808,6 +15227,7 @@ export interface UpdateTenantSettingsResponseContent { * See https://auth0.com/docs/secure/security-guidance/measures-against-app-impersonation for more information. */ skip_non_verifiable_callback_uri_confirmation_prompt?: boolean | null; + resource_parameter_profile?: Management.TenantSettingsResourceParameterProfile; } export interface UpdateTokenQuota { diff --git a/src/management/tests/wire/clients.test.ts b/src/management/tests/wire/clients.test.ts index 453e28e08..2735c2375 100644 --- a/src/management/tests/wire/clients.test.ts +++ b/src/management/tests/wire/clients.test.ts @@ -56,6 +56,15 @@ describe("ClientsClient", () => { skip_non_verifiable_callback_uri_confirmation_prompt: true, par_request_expiry: 1, token_quota: { client_credentials: {} }, + express_configuration: { + initiate_login_uri_template: "initiate_login_uri_template", + user_attribute_profile_id: "user_attribute_profile_id", + connection_profile_id: "connection_profile_id", + enable_client: true, + enable_organization: true, + okta_oin_client_id: "okta_oin_client_id", + admin_login_domain: "admin_login_domain", + }, resource_server_identifier: "resource_server_identifier", async_approval_notification_channels: ["guardian-push"], }, @@ -126,6 +135,15 @@ describe("ClientsClient", () => { token_quota: { client_credentials: {}, }, + express_configuration: { + initiate_login_uri_template: "initiate_login_uri_template", + user_attribute_profile_id: "user_attribute_profile_id", + connection_profile_id: "connection_profile_id", + enable_client: true, + enable_organization: true, + okta_oin_client_id: "okta_oin_client_id", + admin_login_domain: "admin_login_domain", + }, resource_server_identifier: "resource_server_identifier", async_approval_notification_channels: ["guardian-push"], }, @@ -400,6 +418,17 @@ describe("ClientsClient", () => { skip_non_verifiable_callback_uri_confirmation_prompt: true, par_request_expiry: 1, token_quota: { client_credentials: { enforce: true, per_day: 1, per_hour: 1 } }, + express_configuration: { + initiate_login_uri_template: "initiate_login_uri_template", + user_attribute_profile_id: "user_attribute_profile_id", + connection_profile_id: "connection_profile_id", + enable_client: true, + enable_organization: true, + linked_clients: [{ client_id: "client_id" }], + okta_oin_client_id: "okta_oin_client_id", + admin_login_domain: "admin_login_domain", + oin_submission_id: "oin_submission_id", + }, resource_server_identifier: "resource_server_identifier", async_approval_notification_channels: ["guardian-push"], }; @@ -701,6 +730,21 @@ describe("ClientsClient", () => { per_hour: 1, }, }, + express_configuration: { + initiate_login_uri_template: "initiate_login_uri_template", + user_attribute_profile_id: "user_attribute_profile_id", + connection_profile_id: "connection_profile_id", + enable_client: true, + enable_organization: true, + linked_clients: [ + { + client_id: "client_id", + }, + ], + okta_oin_client_id: "okta_oin_client_id", + admin_login_domain: "admin_login_domain", + oin_submission_id: "oin_submission_id", + }, resource_server_identifier: "resource_server_identifier", async_approval_notification_channels: ["guardian-push"], }); @@ -990,6 +1034,17 @@ describe("ClientsClient", () => { skip_non_verifiable_callback_uri_confirmation_prompt: true, par_request_expiry: 1, token_quota: { client_credentials: { enforce: true, per_day: 1, per_hour: 1 } }, + express_configuration: { + initiate_login_uri_template: "initiate_login_uri_template", + user_attribute_profile_id: "user_attribute_profile_id", + connection_profile_id: "connection_profile_id", + enable_client: true, + enable_organization: true, + linked_clients: [{ client_id: "client_id" }], + okta_oin_client_id: "okta_oin_client_id", + admin_login_domain: "admin_login_domain", + oin_submission_id: "oin_submission_id", + }, resource_server_identifier: "resource_server_identifier", async_approval_notification_channels: ["guardian-push"], }; @@ -1285,6 +1340,21 @@ describe("ClientsClient", () => { per_hour: 1, }, }, + express_configuration: { + initiate_login_uri_template: "initiate_login_uri_template", + user_attribute_profile_id: "user_attribute_profile_id", + connection_profile_id: "connection_profile_id", + enable_client: true, + enable_organization: true, + linked_clients: [ + { + client_id: "client_id", + }, + ], + okta_oin_client_id: "okta_oin_client_id", + admin_login_domain: "admin_login_domain", + oin_submission_id: "oin_submission_id", + }, resource_server_identifier: "resource_server_identifier", async_approval_notification_channels: ["guardian-push"], }); @@ -1587,6 +1657,17 @@ describe("ClientsClient", () => { skip_non_verifiable_callback_uri_confirmation_prompt: true, par_request_expiry: 1, token_quota: { client_credentials: { enforce: true, per_day: 1, per_hour: 1 } }, + express_configuration: { + initiate_login_uri_template: "initiate_login_uri_template", + user_attribute_profile_id: "user_attribute_profile_id", + connection_profile_id: "connection_profile_id", + enable_client: true, + enable_organization: true, + linked_clients: [{ client_id: "client_id" }], + okta_oin_client_id: "okta_oin_client_id", + admin_login_domain: "admin_login_domain", + oin_submission_id: "oin_submission_id", + }, resource_server_identifier: "resource_server_identifier", async_approval_notification_channels: ["guardian-push"], }; @@ -1886,6 +1967,21 @@ describe("ClientsClient", () => { per_hour: 1, }, }, + express_configuration: { + initiate_login_uri_template: "initiate_login_uri_template", + user_attribute_profile_id: "user_attribute_profile_id", + connection_profile_id: "connection_profile_id", + enable_client: true, + enable_organization: true, + linked_clients: [ + { + client_id: "client_id", + }, + ], + okta_oin_client_id: "okta_oin_client_id", + admin_login_domain: "admin_login_domain", + oin_submission_id: "oin_submission_id", + }, resource_server_identifier: "resource_server_identifier", async_approval_notification_channels: ["guardian-push"], }); @@ -2165,6 +2261,17 @@ describe("ClientsClient", () => { skip_non_verifiable_callback_uri_confirmation_prompt: true, par_request_expiry: 1, token_quota: { client_credentials: { enforce: true, per_day: 1, per_hour: 1 } }, + express_configuration: { + initiate_login_uri_template: "initiate_login_uri_template", + user_attribute_profile_id: "user_attribute_profile_id", + connection_profile_id: "connection_profile_id", + enable_client: true, + enable_organization: true, + linked_clients: [{ client_id: "client_id" }], + okta_oin_client_id: "okta_oin_client_id", + admin_login_domain: "admin_login_domain", + oin_submission_id: "oin_submission_id", + }, resource_server_identifier: "resource_server_identifier", async_approval_notification_channels: ["guardian-push"], }; @@ -2463,6 +2570,21 @@ describe("ClientsClient", () => { per_hour: 1, }, }, + express_configuration: { + initiate_login_uri_template: "initiate_login_uri_template", + user_attribute_profile_id: "user_attribute_profile_id", + connection_profile_id: "connection_profile_id", + enable_client: true, + enable_organization: true, + linked_clients: [ + { + client_id: "client_id", + }, + ], + okta_oin_client_id: "okta_oin_client_id", + admin_login_domain: "admin_login_domain", + oin_submission_id: "oin_submission_id", + }, resource_server_identifier: "resource_server_identifier", async_approval_notification_channels: ["guardian-push"], }); diff --git a/src/management/tests/wire/connectionProfiles.test.ts b/src/management/tests/wire/connectionProfiles.test.ts new file mode 100644 index 000000000..0a535422f --- /dev/null +++ b/src/management/tests/wire/connectionProfiles.test.ts @@ -0,0 +1,837 @@ +// This file was auto-generated by Fern from our API Definition. + +import { mockServerPool } from "../mock-server/MockServerPool"; +import { ManagementClient } from "../../Client"; +import * as Management from "../../api/index"; + +describe("ConnectionProfilesClient", () => { + test("list (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + next: "next", + connection_profiles: [ + { + id: "id", + name: "name", + connection_name_prefix_template: "connection_name_prefix_template", + enabled_features: ["scim"], + }, + ], + }; + server + .mockEndpoint({ once: false }) + .get("/connection-profiles") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + next: "next", + connection_profiles: [ + { + id: "id", + name: "name", + connection_name_prefix_template: "connection_name_prefix_template", + enabled_features: ["scim"], + }, + ], + }; + const page = await client.connectionProfiles.list({ + from: "from", + take: 1, + }); + + expect(expected.connection_profiles).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.connection_profiles).toEqual(nextPage.data); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint({ once: false }) + .get("/connection-profiles") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.list(); + }).rejects.toThrow(Management.BadRequestError); + }); + + test("list (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint({ once: false }) + .get("/connection-profiles") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.list(); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("list (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint({ once: false }) + .get("/connection-profiles") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.list(); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("list (5)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint({ once: false }) + .get("/connection-profiles") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.list(); + }).rejects.toThrow(Management.TooManyRequestsError); + }); + + test("create (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { + id: "id", + name: "name", + organization: { show_as_button: "none", assign_membership_on_login: "none" }, + connection_name_prefix_template: "connection_name_prefix_template", + enabled_features: ["scim"], + strategy_overrides: { + pingfederate: { enabled_features: ["scim"] }, + ad: { enabled_features: ["scim"] }, + adfs: { enabled_features: ["scim"] }, + waad: { enabled_features: ["scim"] }, + "google-apps": { enabled_features: ["scim"] }, + okta: { enabled_features: ["scim"] }, + oidc: { enabled_features: ["scim"] }, + samlp: { enabled_features: ["scim"] }, + }, + }; + server + .mockEndpoint() + .post("/connection-profiles") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.connectionProfiles.create({ + name: "name", + }); + expect(response).toEqual({ + id: "id", + name: "name", + organization: { + show_as_button: "none", + assign_membership_on_login: "none", + }, + connection_name_prefix_template: "connection_name_prefix_template", + enabled_features: ["scim"], + strategy_overrides: { + pingfederate: { + enabled_features: ["scim"], + }, + ad: { + enabled_features: ["scim"], + }, + adfs: { + enabled_features: ["scim"], + }, + waad: { + enabled_features: ["scim"], + }, + "google-apps": { + enabled_features: ["scim"], + }, + okta: { + enabled_features: ["scim"], + }, + oidc: { + enabled_features: ["scim"], + }, + samlp: { + enabled_features: ["scim"], + }, + }, + }); + }); + + test("create (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/connection-profiles") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.create({ + name: "x", + }); + }).rejects.toThrow(Management.BadRequestError); + }); + + test("create (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/connection-profiles") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.create({ + name: "x", + }); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("create (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/connection-profiles") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.create({ + name: "x", + }); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("create (5)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/connection-profiles") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.create({ + name: "x", + }); + }).rejects.toThrow(Management.ConflictError); + }); + + test("create (6)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "x" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/connection-profiles") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.create({ + name: "x", + }); + }).rejects.toThrow(Management.TooManyRequestsError); + }); + + test("listTemplates (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { connection_profile_templates: [{ id: "id", display_name: "display_name" }] }; + server + .mockEndpoint() + .get("/connection-profiles/templates") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.connectionProfiles.listTemplates(); + expect(response).toEqual({ + connection_profile_templates: [ + { + id: "id", + display_name: "display_name", + }, + ], + }); + }); + + test("listTemplates (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/connection-profiles/templates") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.listTemplates(); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("listTemplates (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/connection-profiles/templates") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.listTemplates(); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("listTemplates (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/connection-profiles/templates") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.listTemplates(); + }).rejects.toThrow(Management.TooManyRequestsError); + }); + + test("getTemplate (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: "id", + display_name: "display_name", + template: { + name: "name", + organization: { show_as_button: "none", assign_membership_on_login: "none" }, + connection_name_prefix_template: "connection_name_prefix_template", + enabled_features: ["scim"], + }, + }; + server + .mockEndpoint() + .get("/connection-profiles/templates/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.connectionProfiles.getTemplate("id"); + expect(response).toEqual({ + id: "id", + display_name: "display_name", + template: { + name: "name", + organization: { + show_as_button: "none", + assign_membership_on_login: "none", + }, + connection_name_prefix_template: "connection_name_prefix_template", + enabled_features: ["scim"], + }, + }); + }); + + test("getTemplate (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/connection-profiles/templates/id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.getTemplate("id"); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("getTemplate (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/connection-profiles/templates/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.getTemplate("id"); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("getTemplate (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/connection-profiles/templates/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.getTemplate("id"); + }).rejects.toThrow(Management.NotFoundError); + }); + + test("getTemplate (5)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/connection-profiles/templates/id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.getTemplate("id"); + }).rejects.toThrow(Management.TooManyRequestsError); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: "id", + name: "name", + organization: { show_as_button: "none", assign_membership_on_login: "none" }, + connection_name_prefix_template: "connection_name_prefix_template", + enabled_features: ["scim"], + strategy_overrides: { + pingfederate: { enabled_features: ["scim"] }, + ad: { enabled_features: ["scim"] }, + adfs: { enabled_features: ["scim"] }, + waad: { enabled_features: ["scim"] }, + "google-apps": { enabled_features: ["scim"] }, + okta: { enabled_features: ["scim"] }, + oidc: { enabled_features: ["scim"] }, + samlp: { enabled_features: ["scim"] }, + }, + }; + server + .mockEndpoint() + .get("/connection-profiles/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.connectionProfiles.get("id"); + expect(response).toEqual({ + id: "id", + name: "name", + organization: { + show_as_button: "none", + assign_membership_on_login: "none", + }, + connection_name_prefix_template: "connection_name_prefix_template", + enabled_features: ["scim"], + strategy_overrides: { + pingfederate: { + enabled_features: ["scim"], + }, + ad: { + enabled_features: ["scim"], + }, + adfs: { + enabled_features: ["scim"], + }, + waad: { + enabled_features: ["scim"], + }, + "google-apps": { + enabled_features: ["scim"], + }, + okta: { + enabled_features: ["scim"], + }, + oidc: { + enabled_features: ["scim"], + }, + samlp: { + enabled_features: ["scim"], + }, + }, + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/connection-profiles/id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.get("id"); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("get (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/connection-profiles/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.get("id"); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("get (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/connection-profiles/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.get("id"); + }).rejects.toThrow(Management.NotFoundError); + }); + + test("get (5)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/connection-profiles/id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.get("id"); + }).rejects.toThrow(Management.TooManyRequestsError); + }); + + test("delete (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/connection-profiles/id").respondWith().statusCode(200).build(); + + const response = await client.connectionProfiles.delete("id"); + expect(response).toEqual(undefined); + }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/connection-profiles/id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.delete("id"); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("delete (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/connection-profiles/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.delete("id"); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("delete (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/connection-profiles/id") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.delete("id"); + }).rejects.toThrow(Management.TooManyRequestsError); + }); + + test("update (1)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + id: "id", + name: "name", + organization: { show_as_button: "none", assign_membership_on_login: "none" }, + connection_name_prefix_template: "connection_name_prefix_template", + enabled_features: ["scim"], + strategy_overrides: { + pingfederate: { enabled_features: ["scim"] }, + ad: { enabled_features: ["scim"] }, + adfs: { enabled_features: ["scim"] }, + waad: { enabled_features: ["scim"] }, + "google-apps": { enabled_features: ["scim"] }, + okta: { enabled_features: ["scim"] }, + oidc: { enabled_features: ["scim"] }, + samlp: { enabled_features: ["scim"] }, + }, + }; + server + .mockEndpoint() + .patch("/connection-profiles/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.connectionProfiles.update("id"); + expect(response).toEqual({ + id: "id", + name: "name", + organization: { + show_as_button: "none", + assign_membership_on_login: "none", + }, + connection_name_prefix_template: "connection_name_prefix_template", + enabled_features: ["scim"], + strategy_overrides: { + pingfederate: { + enabled_features: ["scim"], + }, + ad: { + enabled_features: ["scim"], + }, + adfs: { + enabled_features: ["scim"], + }, + waad: { + enabled_features: ["scim"], + }, + "google-apps": { + enabled_features: ["scim"], + }, + okta: { + enabled_features: ["scim"], + }, + oidc: { + enabled_features: ["scim"], + }, + samlp: { + enabled_features: ["scim"], + }, + }, + }); + }); + + test("update (2)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/connection-profiles/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.update("id"); + }).rejects.toThrow(Management.BadRequestError); + }); + + test("update (3)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/connection-profiles/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.update("id"); + }).rejects.toThrow(Management.UnauthorizedError); + }); + + test("update (4)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/connection-profiles/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.update("id"); + }).rejects.toThrow(Management.ForbiddenError); + }); + + test("update (5)", async () => { + const server = mockServerPool.createServer(); + const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/connection-profiles/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.connectionProfiles.update("id"); + }).rejects.toThrow(Management.TooManyRequestsError); + }); +}); diff --git a/src/management/tests/wire/prompts/rendering.test.ts b/src/management/tests/wire/prompts/rendering.test.ts index 1b28b3002..aedcbae0d 100644 --- a/src/management/tests/wire/prompts/rendering.test.ts +++ b/src/management/tests/wire/prompts/rendering.test.ts @@ -155,9 +155,7 @@ describe("RenderingClient", () => { test("bulkUpdate (1)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { - configs: [{ prompt: "login", screen: "login", rendering_mode: "advanced", head_tags: [{}] }], - }; + const rawRequestBody = { configs: [{ prompt: "login", screen: "login" }] }; const rawResponseBody = { configs: [ { @@ -185,8 +183,6 @@ describe("RenderingClient", () => { { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}], }, ], }); @@ -210,8 +206,8 @@ describe("RenderingClient", () => { const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = { configs: [ - { prompt: "login", screen: "login", rendering_mode: "advanced", head_tags: [{}, {}] }, - { prompt: "login", screen: "login", rendering_mode: "advanced", head_tags: [{}, {}] }, + { prompt: "login", screen: "login" }, + { prompt: "login", screen: "login" }, ], }; const rawResponseBody = { key: "value" }; @@ -230,14 +226,10 @@ describe("RenderingClient", () => { { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}, {}], }, { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}, {}], }, ], }); @@ -249,8 +241,8 @@ describe("RenderingClient", () => { const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = { configs: [ - { prompt: "login", screen: "login", rendering_mode: "advanced", head_tags: [{}, {}] }, - { prompt: "login", screen: "login", rendering_mode: "advanced", head_tags: [{}, {}] }, + { prompt: "login", screen: "login" }, + { prompt: "login", screen: "login" }, ], }; const rawResponseBody = { key: "value" }; @@ -269,14 +261,10 @@ describe("RenderingClient", () => { { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}, {}], }, { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}, {}], }, ], }); @@ -288,8 +276,8 @@ describe("RenderingClient", () => { const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = { configs: [ - { prompt: "login", screen: "login", rendering_mode: "advanced", head_tags: [{}, {}] }, - { prompt: "login", screen: "login", rendering_mode: "advanced", head_tags: [{}, {}] }, + { prompt: "login", screen: "login" }, + { prompt: "login", screen: "login" }, ], }; const rawResponseBody = { key: "value" }; @@ -308,14 +296,10 @@ describe("RenderingClient", () => { { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}, {}], }, { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}, {}], }, ], }); @@ -327,8 +311,8 @@ describe("RenderingClient", () => { const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = { configs: [ - { prompt: "login", screen: "login", rendering_mode: "advanced", head_tags: [{}, {}] }, - { prompt: "login", screen: "login", rendering_mode: "advanced", head_tags: [{}, {}] }, + { prompt: "login", screen: "login" }, + { prompt: "login", screen: "login" }, ], }; const rawResponseBody = { key: "value" }; @@ -347,14 +331,10 @@ describe("RenderingClient", () => { { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}, {}], }, { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}, {}], }, ], }); @@ -366,8 +346,8 @@ describe("RenderingClient", () => { const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = { configs: [ - { prompt: "login", screen: "login", rendering_mode: "advanced", head_tags: [{}, {}] }, - { prompt: "login", screen: "login", rendering_mode: "advanced", head_tags: [{}, {}] }, + { prompt: "login", screen: "login" }, + { prompt: "login", screen: "login" }, ], }; const rawResponseBody = { key: "value" }; @@ -386,14 +366,10 @@ describe("RenderingClient", () => { { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}, {}], }, { prompt: "login", screen: "login", - rendering_mode: "advanced", - head_tags: [{}, {}], }, ], }); @@ -575,7 +551,7 @@ describe("RenderingClient", () => { test("update (1)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { rendering_mode: "advanced", head_tags: [{}] }; + const rawRequestBody = {}; const rawResponseBody = { rendering_mode: "advanced", context_configuration: ["context_configuration"], @@ -598,10 +574,7 @@ describe("RenderingClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.prompts.rendering.update("login", "login", { - rendering_mode: "advanced", - head_tags: [{}], - }); + const response = await client.prompts.rendering.update("login", "login"); expect(response).toEqual({ rendering_mode: "advanced", context_configuration: ["context_configuration"], @@ -637,7 +610,7 @@ describe("RenderingClient", () => { test("update (2)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { rendering_mode: "advanced", head_tags: [{}, {}] }; + const rawRequestBody = {}; const rawResponseBody = { key: "value" }; server .mockEndpoint() @@ -649,17 +622,14 @@ describe("RenderingClient", () => { .build(); await expect(async () => { - return await client.prompts.rendering.update("login", "login", { - rendering_mode: "advanced", - head_tags: [{}, {}], - }); + return await client.prompts.rendering.update("login", "login"); }).rejects.toThrow(Management.BadRequestError); }); test("update (3)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { rendering_mode: "advanced", head_tags: [{}, {}] }; + const rawRequestBody = {}; const rawResponseBody = { key: "value" }; server .mockEndpoint() @@ -671,17 +641,14 @@ describe("RenderingClient", () => { .build(); await expect(async () => { - return await client.prompts.rendering.update("login", "login", { - rendering_mode: "advanced", - head_tags: [{}, {}], - }); + return await client.prompts.rendering.update("login", "login"); }).rejects.toThrow(Management.UnauthorizedError); }); test("update (4)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { rendering_mode: "advanced", head_tags: [{}, {}] }; + const rawRequestBody = {}; const rawResponseBody = { key: "value" }; server .mockEndpoint() @@ -693,17 +660,14 @@ describe("RenderingClient", () => { .build(); await expect(async () => { - return await client.prompts.rendering.update("login", "login", { - rendering_mode: "advanced", - head_tags: [{}, {}], - }); + return await client.prompts.rendering.update("login", "login"); }).rejects.toThrow(Management.PaymentRequiredError); }); test("update (5)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { rendering_mode: "advanced", head_tags: [{}, {}] }; + const rawRequestBody = {}; const rawResponseBody = { key: "value" }; server .mockEndpoint() @@ -715,17 +679,14 @@ describe("RenderingClient", () => { .build(); await expect(async () => { - return await client.prompts.rendering.update("login", "login", { - rendering_mode: "advanced", - head_tags: [{}, {}], - }); + return await client.prompts.rendering.update("login", "login"); }).rejects.toThrow(Management.ForbiddenError); }); test("update (6)", async () => { const server = mockServerPool.createServer(); const client = new ManagementClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { rendering_mode: "advanced", head_tags: [{}, {}] }; + const rawRequestBody = {}; const rawResponseBody = { key: "value" }; server .mockEndpoint() @@ -737,10 +698,7 @@ describe("RenderingClient", () => { .build(); await expect(async () => { - return await client.prompts.rendering.update("login", "login", { - rendering_mode: "advanced", - head_tags: [{}, {}], - }); + return await client.prompts.rendering.update("login", "login"); }).rejects.toThrow(Management.TooManyRequestsError); }); }); diff --git a/src/management/tests/wire/tenants/settings.test.ts b/src/management/tests/wire/tenants/settings.test.ts index e22a95cd7..aa1da093c 100644 --- a/src/management/tests/wire/tenants/settings.test.ts +++ b/src/management/tests/wire/tenants/settings.test.ts @@ -72,6 +72,7 @@ describe("SettingsClient", () => { pushed_authorization_requests_supported: true, authorization_response_iss_parameter_supported: true, skip_non_verifiable_callback_uri_confirmation_prompt: true, + resource_parameter_profile: "audience", }; server.mockEndpoint().get("/tenants/settings").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); @@ -170,6 +171,7 @@ describe("SettingsClient", () => { pushed_authorization_requests_supported: true, authorization_response_iss_parameter_supported: true, skip_non_verifiable_callback_uri_confirmation_prompt: true, + resource_parameter_profile: "audience", }); }); @@ -288,6 +290,7 @@ describe("SettingsClient", () => { pushed_authorization_requests_supported: true, authorization_response_iss_parameter_supported: true, skip_non_verifiable_callback_uri_confirmation_prompt: true, + resource_parameter_profile: "audience", }; server .mockEndpoint() @@ -390,6 +393,7 @@ describe("SettingsClient", () => { pushed_authorization_requests_supported: true, authorization_response_iss_parameter_supported: true, skip_non_verifiable_callback_uri_confirmation_prompt: true, + resource_parameter_profile: "audience", }); }); diff --git a/yarn.lock b/yarn.lock index f5603a022..a19ef2391 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3254,7 +3254,7 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== -package-manager-detector@^1.3.0: +package-manager-detector@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/package-manager-detector/-/package-manager-detector-1.6.0.tgz#70d0cf0aa02c877eeaf66c4d984ede0be9130734" integrity sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA== @@ -3387,12 +3387,12 @@ psl@^1.1.33: punycode "^2.3.1" publint@^0.3.12: - version "0.3.15" - resolved "https://registry.yarnpkg.com/publint/-/publint-0.3.15.tgz#1f14793fb0cea14ad1dce2c524e9de6f6d64c311" - integrity sha512-xPbRAPW+vqdiaKy5sVVY0uFAu3LaviaPO3pZ9FaRx59l9+U/RKR1OEbLhkug87cwiVKxPXyB4txsv5cad67u+A== + version "0.3.16" + resolved "https://registry.yarnpkg.com/publint/-/publint-0.3.16.tgz#f35af34c0a94c284568de65b09de44fbec651d2a" + integrity sha512-MFqyfRLAExPVZdTQFwkAQELzA8idyXzROVOytg6nEJ/GEypXBUmMGrVaID8cTuzRS1U5L8yTOdOJtMXgFUJAeA== dependencies: "@publint/pack" "^0.1.2" - package-manager-detector "^1.3.0" + package-manager-detector "^1.6.0" picocolors "^1.1.1" sade "^1.8.1"