fix: require auth0/version so client construction works and correct rest-client changelog note - #790
Open
kishore7snehil wants to merge 1 commit into
Open
Conversation
…est-client changelog note Require auth0/version in headers.rb before referencing Auth0::VERSION, so a plain require "auth0" followed by Auth0::Client.new no longer raises NameError. Correct the v6 changelog note: only the Management API client moved to net/http, the Authentication API still uses rest-client.
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.
Changes
Two fixes reported against v6.
lib/auth0/mixins/headers.rbnow requiresauth0/versionbefore referencingAuth0::VERSION. The telemetry header is built during every client construction (Initializer#initialize->client_headers->telemetry), and the gem entrypoint never loaded the version file, so a plainrequire "auth0"followed byAuth0::Client.new(...)raisedNameError: uninitialized constant Auth0::VERSION. The require lives inheaders.rb(a.fernignore-protected file) so it survives Fern regeneration.rest-clientdependency was removed. Only the Management API client moved tonet/http. The Authentication API still usesrest-client, and it remains a declared dependency in the gemspec.References
Testing
require "auth0"with norequire "auth0/version"), confirmed theNameError, applied the fix, and confirmed construction succeeds withAuth0::VERSIONresolving to6.1.0.require "auth0".Checklist