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 1 commit 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.

- 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 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?

Comment on lines +110 to +112

mutex sync.RWMutex
sessions map[string][]string
Copy link
Contributor

Choose a reason for hiding this comment

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

We've lost the comment for sessions here.

completed := u.sessions[sessionID]
u.mutex.RUnlock()

flows := u.flows
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nit: No need to create flows when we can use u.flows below directly.

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