feat: update impact js client to utilize api gateway authentication #32
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.
What?
BREAKING CHANGE: This change drops support for token based authentication. The exchange happens in the api gateway on the modelon impact server. From now on you will need to use either authentication cookie in the browser OR impact-api-key to utilize the client via:
Client.fromImpactApiKey
or
Client.fromImpactSession
Why?
Following changes in coming authentication updates in Modelon Impact "API Gateway". JH-tokens are no longer needed to authenticate. Also, the exchange for the access token happens in the api gateway, meaning that we only need api-key or impact-session cookie to be present to authenticate.
How?
Removing:
Client.fromImpactToken()
Token exchange via /login
Also:
Updating how user-path is extracted
Adding check that impact-session cookie exists when using that as auth-method.
Testing?
Test suite has been updated to reflect changes
Dropped jhToken failure test
What is not in this MR
Missing:
A good way to test the cookie based authentication path
Convenience functions to re-establish impact session in the case of a logout.
Anything Else?
We should maybe wait to merge these changes until api-gateway work is done from cap-side.