Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth0",
"version": "5.10.0",
"version": "5.10.1",
"private": false,
"repository": {
"type": "git",
Expand Down Expand Up @@ -73,7 +73,7 @@
"dependencies": {
"uuid": "^11.1.1",
"jose": "^4.13.2",
"auth0-legacy": "npm:auth0@^4.27.0"
"auth0-legacy": "npm:auth0@^4.37.1"
},
"devDependencies": {
"webpack": "^5.105.4",
Expand All @@ -84,7 +84,7 @@
"ts-jest": "^29.3.4",
"jest-environment-jsdom": "^29.7.0",
"msw": "2.11.2",
"@types/node": "^18.19.70",
"@types/node": "^20.0.0",
"typescript": "~5.9.3",
"prettier": "3.8.1",
"typedoc": "^0.28.7",
Expand Down
4,336 changes: 3,021 additions & 1,315 deletions reference.md

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions src/management/BaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import * as core from "./core/index.js";
import type { AuthProvider } from "./core/auth/index.js";
import * as environments from "./environments.js";

export type AuthOption =
| false
| core.AuthProvider["getAuthRequest"]
| core.AuthProvider
| BearerAuthProvider.AuthOptions;

export type BaseClientOptions = {
environment?: core.Supplier<environments.ManagementEnvironment | string>;
/** Specify a custom URL to connect the client to. */
Expand All @@ -20,6 +26,8 @@ export type BaseClientOptions = {
fetcher?: core.FetchFunction;
/** Configure logging for the client. */
logging?: core.logging.LogConfig | core.logging.Logger;
/** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
auth?: AuthOption;
} & BearerAuthProvider.AuthOptions;

export interface BaseRequestOptions {
Expand Down Expand Up @@ -58,6 +66,23 @@ export function normalizeClientOptionsWithAuth<T extends BaseClientOptions = Bas
options: T,
): NormalizedClientOptionsWithAuth<T> {
const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth<T>;

if (options.auth === false) {
normalized.authProvider = new core.NoOpAuthProvider();
return normalized;
}
if (options.auth != null) {
if (typeof options.auth === "function") {
normalized.authProvider = { getAuthRequest: options.auth };
return normalized;
}
if (core.isAuthProvider(options.auth)) {
normalized.authProvider = options.auth;
return normalized;
}
Object.assign(normalized, options.auth);
}

const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
normalized.authProvider ??= new BearerAuthProvider(normalizedWithNoOpAuthProvider);
return normalized;
Expand Down
6 changes: 6 additions & 0 deletions src/management/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { LogStreamsClient } from "./api/resources/logStreams/client/Client.js";
import { NetworkAclsClient } from "./api/resources/networkAcls/client/Client.js";
import { OrganizationsClient } from "./api/resources/organizations/client/Client.js";
import { PromptsClient } from "./api/resources/prompts/client/Client.js";
import { RateLimitPoliciesClient } from "./api/resources/rateLimitPolicies/client/Client.js";
import { RefreshTokensClient } from "./api/resources/refreshTokens/client/Client.js";
import { ResourceServersClient } from "./api/resources/resourceServers/client/Client.js";
import { RiskAssessmentsClient } from "./api/resources/riskAssessments/client/Client.js";
Expand Down Expand Up @@ -79,6 +80,7 @@ export class ManagementClient {
protected _networkAcls: NetworkAclsClient | undefined;
protected _organizations: OrganizationsClient | undefined;
protected _prompts: PromptsClient | undefined;
protected _rateLimitPolicies: RateLimitPoliciesClient | undefined;
protected _refreshTokens: RefreshTokensClient | undefined;
protected _resourceServers: ResourceServersClient | undefined;
protected _roles: RolesClient | undefined;
Expand Down Expand Up @@ -194,6 +196,10 @@ export class ManagementClient {
return (this._prompts ??= new PromptsClient(this._options));
}

public get rateLimitPolicies(): RateLimitPoliciesClient {
return (this._rateLimitPolicies ??= new RateLimitPoliciesClient(this._options));
}

public get refreshTokens(): RefreshTokensClient {
return (this._refreshTokens ??= new RefreshTokensClient(this._options));
}
Expand Down
Loading
Loading