-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for async auth provider #147
base: master
Are you sure you want to change the base?
Conversation
this.axiosInstance.interceptors.request.use(async (config: any) => { | ||
config.headers.common["X-API-Key"] = await this.authProvider.getApiKey(); | ||
config.headers.common["User-Agent"] = this.getUserAgent(); | ||
return config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should we run this on every request? These header don't change. But if we already have an interceptor, let's move signJwt()
into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you suggest calculating it if not here? It's an async function, can't execute it in the constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree.
We should move sign_jwt() in here as well.
This way the consumer can use the same SDK instance to run commands on multiple accounts. Because the API Key and the JWT are coupled it makes little sense to allow changing only one.
Hi, any updates on this PR? Is this going to be merged eventually? Seems that progress/discussion has stopped. |
Pull Request Description
Resolves #77
Type of change
How Has This Been Tested?
Checklist: