Please delay requesting an API token until one is needed
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ruby
- Domain
- api, authentication
Research direction
Start by tracing Auth0::Client.new to the synchronous token request and inspect the existing tests and WebMock setup around client instantiation. The change is done when constructing a client makes no network request, while operations that require a token still request one and are covered by tests.
Written by the indexing model from the issue text.
Description
Checklist
- I have looked into the Readme and Examples, and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved
Whenever a new Auth0::Client is instantiated a synchronous call is made to auth0 to fetch a token. This causes headaches in specs because any time that we instantiate it we have to mock it out with webmock to prevent actual requests. If it were only fetched when required we could focus our mocks to just the areas of code that require it rather than anything that happens to trigger an object instantiation.
Describe the ideal solution
When I do Auth0::Client.new there are zero network requests made.
Alternatives and current workarounds
We are considering putting a global mock in for this which we are not happy with.
Additional context
No response
- Dominant language
- Ruby
- Stars
- 205
- Forks
- 148
- Avg merge
- 13h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from auth0/ruby-auth0
-
Model#initialize drops every `false` value — booleans are silently lost on requests and responsesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
auth0/ruby-auth0#800 · 1 comment ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 50/100
auth0/ruby-auth0#610 · 1 comment ·
-
feature request
Difficulty 5/5 Over a week Newbie friendliness 32/100
auth0/ruby-auth0#606 · 2 comments · 1 reaction ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
auth0/ruby-auth0#556 · 2 comments ·
-
feature request
Difficulty 3/5 1-2 days Newbie friendliness 35/100
auth0/ruby-auth0#500 · 1 comment ·
All issues in auth0/ruby-auth0
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
mastodon/mastodon#40755 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
L: docker L: elm L: github:actions L: helm L: ruby:bundler
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
dependabot/dependabot-core#16425 ·
Maintainers usually reply within 2 days