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

Add withdraw authorization command in auth interface #992

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Pietfried
Copy link
Contributor

@Pietfried Pietfried commented Dec 13, 2024

Describe your changes

This PR adds a withdraw_authorization command in the auth interface and the Auth module.

Issue ticket number and link

#978

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@Pietfried Pietfried force-pushed the refactor/auth-module-mutex-usage branch 2 times, most recently from 564c9ec to 887138e Compare December 16, 2024 17:45
Base automatically changed from refactor/auth-module-mutex-usage to main December 17, 2024 10:30
@Pietfried Pietfried force-pushed the feature/978-withdraw-authorization branch 3 times, most recently from 1a9c491 to 692e61a Compare December 19, 2024 21:30
@Pietfried Pietfried marked this pull request as ready for review December 20, 2024 14:36
std::mutex event_mutex;
std::mutex withdraw_mutex;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could probably also use the event_mutex now, or am I mistaken?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I thought so too. If we only use the event_mutex multiple withdraw requests could run in parallel and they could override this->withdraw_request in that case, because the event_mutex is released here while waiting for the targeted processing threads to finish. It ensures that only one withdraw_request can run at a time. Since a withdraw request should not block for a significant amount of time this seems to be the best solution to me

@Pietfried Pietfried linked an issue Jan 6, 2025 that may be closed by this pull request
@Pietfried Pietfried force-pushed the feature/978-withdraw-authorization branch 2 times, most recently from adc0be8 to 7dac05d Compare January 9, 2025 17:53
@Pietfried Pietfried requested a review from SebaLukas as a code owner January 13, 2025 09:21
* added operator overloading for ProvidedIdToken and IdToken types
* Changed tokens_in_process from set of strings to set of ProvidedIdToken to be able to access the referenced connectors
* Introduced processing_finished_cv in AuthHandler to be able to notify a withdraw request waiting thread that the processing of a token has finished
* Implemented handle_withdraw_authorization function
* Added test cases for new functionality
* Move Deuathorized event in EvseManager so that its only published in case session is currently active

Signed-off-by: Piet Gömpel <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
@Pietfried Pietfried force-pushed the feature/978-withdraw-authorization branch from 53d86a8 to 929afb3 Compare January 13, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Withdraw authorization
3 participants