[DO NOT MERGE] feat!: remove Authentication layer (v7.0.0), delegate Management token to @auth0/auth0-auth-js - #1390
Draft
tusharpandey13 wants to merge 4 commits into
Draft
[DO NOT MERGE] feat!: remove Authentication layer (v7.0.0), delegate Management token to @auth0/auth0-auth-js#1390tusharpandey13 wants to merge 4 commits into
tusharpandey13 wants to merge 4 commits into
Conversation
…uth-js BREAKING CHANGE: removes AuthenticationClient and UserInfoClient from the auth0 package. Management API token acquisition now delegates to @auth0/auth0-auth-js AuthClient.getTokenByClientCredentials. mTLS now requires an explicit fetch option. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…p any cast
Match published TelemetryConfig ({enabled:false} | {enabled?:true,name,version});
drop unsupported env field; type options as AuthClientOptions.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ent token tests - Delete obsolete tests/auth/**, tests/userinfo/**, tests/lib/runtime.test.ts - Rewrite token-provider test to mock @auth0/auth0-auth-js AuthClient (8 cases: both credential modes, cache hit, leeway refresh with expiresAt*1000 boundary, in-flight dedup, error propagation, error-not-cached, expiry) - Add export-surface test asserting AuthenticationClient/UserInfoClient removed - jest: map @auth0/auth0-auth-js to CJS stub for unit/wire (avoids ESM openid-client under Jest CJS runtime); allow openid-client/oauth4webapi transform in root-tests ESM project Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- README: replace AuthenticationClient/UserInfoClient sections with pointers to @auth0/auth0-auth-js; add 'Migrating from v6 to v7' with method-mapping table and mTLS note; preserve auth0/legacy docs - CHANGELOG: v7.0.0 breaking-change entry - token-provider: doc comment on @auth0/auth0-auth-js delegation + expiresAt seconds-to-ms conversion Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP
Summary
Removes the Authentication layer from
node-auth0, reducing the main entrypoint to a Management-API-only SDK (v7.0.0). TheManagementClientcontinues to work: its internal Management API token acquisition now delegates to@auth0/auth0-auth-jsinstead of the removed in-packageAuthenticationClient.This is the node-auth0 side of the auth-separation initiative. It assumes
@auth0/auth0-auth-jsDX-parity and gap features are already published (targeting^1.12.1).What changed
src/auth/(9 files) andsrc/userinfo/—AuthenticationClientandUserInfoClientno longer exported from the main entrypoint.TokenProvidernow uses@auth0/auth0-auth-jsAuthClient.getTokenByClientCredentials(). Preserves the 10s leeway refresh, in-flight de-duplication, and both client-secret and client-assertion credential modes.src/lib/runtime.ts(BaseAPI, auth-only) and auth-onlysrc/utils.tshelpers (mtlsPrefix,resolveValueToPromise). KeptgenerateClientInfofor Management telemetry.@auth0/auth0-auth-js ^1.12.1; removeduuid(auth-only).6.2.0→7.0.0.@auth0/auth0-auth-js; added a "Migrating from v6 to v7" section with a method-mapping table; CHANGELOG v7.0.0 entry.Breaking changes
AuthenticationClientandUserInfoClientare gone from theauth0main entrypoint. Use@auth0/auth0-auth-js(AuthClient) for authentication, OAuth, token exchange, passwordless, database, and userinfo operations. Theauth0/legacyentrypoint (delegating toauth0-legacyv4) still ships them.fetchoption.@auth0/auth0-auth-jsrequires acustomFetchwhenuseMtlsis set; the previous DNS-prefix-only behavior no longer applies to token acquisition.Implementation notes
TokenResponse.expiresAtfrom@auth0/auth0-auth-jsis an absolute Unix timestamp in seconds;TokenProviderconverts it to milliseconds (expiresAt * 1000) before comparing againstDate.now(). Getting this wrong would cause refresh storms or stale-token 401s — covered by tests.node-auth0via theAuthClienttelemetryoption (matched to the publishedTelemetryConfigshape).Testing
src/management/tests/unit/token-provider.test.tsmocks@auth0/auth0-auth-jsand covers: both credential modes, cache hit, leeway refresh (with theexpiresAtseconds→ms boundary), in-flight de-dup, error propagation, error-not-cached, and expiry.tests/lib/export-surface.test.tsassertsAuthenticationClient/UserInfoClientare absent from the main entrypoint.tests/auth/**,tests/userinfo/**,tests/lib/runtime.test.ts.@auth0/auth0-auth-jsmaps to a lightweight CJS stub in theunit/wireprojects (the package's CJS bundle pulls in ESM-onlyopenid-client, which Jest's CJS runtime cannot load); the ESMroot-testsproject allows transformingopenid-client/oauth4webapi.yarn buildandyarn lint:checkpass; unit suite 545/545.Validation status
v6.2.0), unrelated to this change; needs a run on a supported Node version in CIOpen questions
@auth0/auth0-auth-js, or only ongetTokenByClientCredentials(the only method node-auth0 itself needs)?fetchacceptable, or should node-auth0 construct an mTLS-capable fetch to hand over?🤖 Generated with Claude Code