Skip to content
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

Feature/auth backend integration #389

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Kanakanajm
Copy link
Collaborator

Description

Added trigger in application menu for toy endpoint at the new backend to demonstrate authorization functionality.
A custom request header X-Realm is embedded to every request in scenario API service. Because of the OAuth2.0 adapter (react-oauth2-code-pkce ) I chose, the authentication context is limited to be stored in a native react context which its content cannot be accessed when defining RTKQuery APIs (only function components can have hooks). The issue is addressed here which can be improved by migrating to keycloak-js, a native Keycloak adapter and writing our own store for persisting authentication context. As a result, token as to be passed every time a request is called.

I don't know why I am not passing the ParameterEditor test. Locally, it is not showing on the browser either. Maybe I didn't specify a working backend URI?

Also fixed bug that logout button only clearing authentication context locally but not logout through IdP. Now after logout locally the page will redirect to Keycloak's logout endpoint.

Related Issues

I guess #206 ?

Design Decisions

Performance & Quality

Checklist

I, the author of this PR checked the following requirements for good software quality:

  • [*] The code is properly formatted (I ran the formatter)
  • [*] The code is written with our software quality standards (I ran the linter)
  • [*] The code is written using our code style
  • [*] Extensive in source documentation has been added
  • Unit and/or integration tests have been added
  • All texts have been internationalized with at least the following languages:
    • English
    • German
  • I tried addressing all new accessibility problems displayed in the console and documented if they can't be fixed
  • I attached performance measurements to prevent performance degradation
  • I added the changes to the next release section of the changelog

I, the reviewer checked the following things:

  • I ran the software once and tried all new and related functionality to this PR
  • I looked at all new and changed lines of code and commented on possible problems
  • I read the added documentation and checked if it is understandable and clear
  • I checked the added tests for completeness
  • I checked the internationalized strings for spelling errors
  • I checked the performance metrics for problems or unexplained degradation
  • I checked that the changes are noted in the changelog

Copy link

github-actions bot commented Dec 2, 2024

Test Results

104 tests  ±0   103 ✅  - 1   23s ⏱️ ±0s
 38 suites ±0     0 💤 ±0 
  1 files   ±0     1 ❌ +1 

For more details on these failures, see this check.

Results for commit 333a915. ± Comparison against base commit 5f4708b.

@Kanakanajm Kanakanajm requested a review from JonasGilg December 6, 2024 09:11
@Kanakanajm Kanakanajm self-assigned this Dec 6, 2024
@Kanakanajm
Copy link
Collaborator Author

I'm failing the ParameterEditor test. The ParameterEditor in my case, will always jump over this condition and render the 'no-parameters' template because my backend is not setup so scenario lists are not fetched which makes scenarioId always null according to here. The develop branch is not failing this test so I'm guessing, it is fixed after I branched out? (Since I haven't touched any code related to this) Any Idea? @JonasGilg

@JonasGilg
Copy link
Collaborator

I'm failing the ParameterEditor test. The ParameterEditor in my case, will always jump over this condition and render the 'no-parameters' template because my backend is not setup so scenario lists are not fetched which makes scenarioId always null according to here. The develop branch is not failing this test so I'm guessing, it is fixed after I branched out? (Since I haven't touched any code related to this) Any Idea? @JonasGilg

Most of the components are being reworked for the switch of the API, so this might resolve itself. We have to see, when we integrate the new API with the migrated ESID.

@JonasGilg
Copy link
Collaborator

Thank you for this PR, I will most likely copy this over onto this branch: https://github.com/DLR-SC/ESID/tree/feature/migrate-to-new-backend as this already has reworked most of the components and API-Requests to work with the new API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants