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

refactoring user interactive auth #3380

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hkohlsaat
Copy link

  • making members of auth.UserInteractive private as they aren't used outside of the package and in order to protect from concurrent writes
  • making the mutex protect the sessions only as only they are written to concurrently

This prepares future contributions I plan, in particular adding functionality for multi-stage flows.

Pull Request Checklist

  • I have justified why this PR doesn't need tests: No functionality added or removed, only refactoring tested behaviour.
  • I have already signed off privately.

@hkohlsaat hkohlsaat requested a review from a team as a code owner May 26, 2024 16:55
Copy link
Contributor

@S7evinK S7evinK left a comment

Choose a reason for hiding this comment

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

Other than the minor nits, looks fine to me.

Can we test the changes? Or do you plan to add tests when adding multi-stage flows?

clientapi/auth/user_interactive.go Outdated Show resolved Hide resolved
clientapi/auth/user_interactive.go Outdated Show resolved Hide resolved
- making members private as they aren't used outside of the package and in order to protect from concurrent writes
- make the mutex protect the sessions only as they are written to concurrently
@hkohlsaat hkohlsaat force-pushed the refactor-user-interactive-auth-member-visibility-and-mutex branch from a616e37 to 7f53e66 Compare October 9, 2024 19:16
@hkohlsaat
Copy link
Author

hkohlsaat commented Oct 9, 2024

Can we test the changes?

As I wrote in the description, I only refactored internals of a tested module.
Almost all behavior of this file is tested. Especially the lines I changed are tested already as far as I checked. All I did is slightly refactoring the internals with tests passing before and after - without any intent to change behaviour. I don't see how one would add more tests without overdoing it, given the overseeable amount of changes. Is this okay with you? If not, could you give me an example of what you would like to have tested, additionally?
(Of course, conversely, I would add tests for multi-stage flows when I work on them, because that would be a change in behaviour. But I guess that's beside the point of these changes and your comment?)

@hkohlsaat hkohlsaat marked this pull request as draft October 10, 2024 07:42
@hkohlsaat hkohlsaat marked this pull request as ready for review October 12, 2024 09:50
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.

2 participants