Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

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
@S7evinK
Copy link
Contributor

S7evinK commented Nov 14, 2024

Thanks for contributing to Dendrite!

The repo has been cloned into element-hq/dendrite and made the switch to AGPL as per https://matrix.org/blog/2023/11/06/future-of-synapse-dendrite/.
For more information, feel free to read this and this

If you still wish to contribute under the new license, feel free to create a new PR over at element-hq/dendrite.

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

Successfully merging this pull request may close these issues.

2 participants