refactor(user-info-fetcher): move initialization into backends #782
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.
Description
Optional follow-up for #779:
As @adwk67 mentioned in his comment, there were comments in the code about some necessary refactoring that might make sense once we add LDAP support. This is the PR that refactors the mentioned TODO items. In general, initialization logic was moved from
main.rsinto the specific backend, basically two things per backend:We now have
resolvefunctions that enrich the basic backend configuration from the CRD with the resolved data so we have it available as shared state in theget_user_infofunctions.I ran the tests for Keycloak, OpenLDAP and AAS, they were all successful. There was no test for Entra as far as I know.
I couldn't find out how to run the ActiveDirectory integration test but I did not need to touch the AD backend anyway, because it doesn't need to resolve credentials. We could add a
resolvefunction there as well that just copies the data, so the code looks more consistent with the other backends, but since I did not know how to run the integration test I preferred to leave it as it is. It's probably also fine this way.The diff looks bigger than it is in the Github UI, the
get_user_infofunctions for example were barely changed.Definition of Done Checklist
Author
Reviewer
Acceptance
type/deprecationlabel & add to the deprecation scheduletype/experimentallabel & add to the experimental features tracker