-
Notifications
You must be signed in to change notification settings - Fork 55
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
Improve CamundaCloudTokenProvider to work with SM #625
Merged
ChrisKujawa
merged 21 commits into
main
from
jacob-elektronik-503-adding-oauth2-token-provider
Dec 15, 2023
Merged
Improve CamundaCloudTokenProvider to work with SM #625
ChrisKujawa
merged 21 commits into
main
from
jacob-elektronik-503-adding-oauth2-token-provider
Dec 15, 2023
Conversation
This file contains 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
ChrisKujawa
force-pushed
the
jacob-elektronik-503-adding-oauth2-token-provider
branch
2 times, most recently
from
December 15, 2023 14:38
9a24d33
to
4a296ef
Compare
…espace and folder
…uth2TokenProvider
…ion tests with camunda identity stack
AccessTokenCache takes care of caching an AccessToken, and as well of storing to and reading from disk.
Currently not able to compile, nor get dotnet 8.0 on fedora 37
Instead of using the base class, use the new PersistedAccessTokenCache which gives us all necessary functionality and simplifies the TokenProvider a lot. Additionally add a new method to set the path were the credentials are stored
Most of the logic is already tested in Cache tests
This should allow to use the CamundaCloudTokenProvider for SaaS but also with keycloak in SM
SaaS and SM can be handled with old CamundaCloudTokenProvider
Use CamundaCloudTokenProvider with OAuth SM test Refactor a bit the ZeebeIntegrationTestHelper, remove booleans and make it more explicit
ChrisKujawa
force-pushed
the
jacob-elektronik-503-adding-oauth2-token-provider
branch
from
December 15, 2023 14:44
4a296ef
to
d44b524
Compare
ChrisKujawa
deleted the
jacob-elektronik-503-adding-oauth2-token-provider
branch
December 15, 2023 15:40
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.
Note
This PR is based on #607
Hey @LennartKleymann
first of all thank you very much for your time and the great contribution! 🙇🏼
I had a look at your PR, and since it is coming from our fork I was not able to modify it directly, so I created a new one based on yours.
Short description of what I did and why:
I had a look at your PR and felt that introducing the base class might not be optimal. It felt complex, and there were still some responsibilities lying in the sub-classes (like writing the caches, etc) and we had still some duplications between the classes.
In general, I favor composition over inheritance so I introduced a new interface and implementation for caching an AccessToken. The access token is persisted within the PersistedAccessTokenCache. The cache class has full responsibility, for caching and persisting.
It makes the unit tests, in this case much easier, and also the classes that use the cache.
Furthermore, I realized that our authentication API also supports form-url-encoding (I tried it manually), so I migrated from sending JSON content to form-url-x-encoding. This should help to support Keycloak as well. Since this was the only difference in these classes I removed the newer ones (I couldn't remove the old TokenProvider to not break earlier clients).
Thank you very much for providing the integration tests! 🎉 I adjusted them to use the CamundaCloudTokenProvider, and it worked without any issues. Furthermore, I tried again manually with the changes to run against SaaS, which worked as well.
closes #503
closes #607