feat: allow custom telemetry for SDKs built on auth0-java - #916
Open
tanya732 wants to merge 2 commits into
Open
Conversation
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.
Description
Summary
Restores the ability for SDKs built on top of
auth0-javato identify themselves in theAuth0-Clienttelemetry header, while still reportingauth0-javaas the underlying library.Adds a
withTelemetry(name, version)builder hook to both the Authentication and Management API clients so telemetry is consistent regardless of which API a wrapping SDK calls. Previously, even if the Auth side were addressed, Management API requests remained hardcoded toauth0-java.Changes
DefaultHttpClient.Builder.withTelemetry(name, version); applied to the existingTelemetryInterceptorviasetTelemetry(...).ManagementApiBuilder.withTelemetry(name, version), threaded throughClientOptionsso theAuth0-Clientheader honors the custom telemetry when set.name/versionof the wrapper withauth0-javanested underenv.auth0-java.Behavior
Decoded
Auth0-Clientheader:{ "name": "my-wrapper-sdk", "version": "1.2.3", "env": { "java": "17", "auth0-java": "4.2.0" } }Test Plan
ManagementApiTelemetryTestAuthAPITestAuth0-Clientheader./gradlew test --rerun-taskspasses for the targeted tests.