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

Extend examplebroker with MFA, password resets and max attempts #23

Merged
merged 4 commits into from
Aug 30, 2023

Conversation

denisonbarbosa
Copy link
Member

After some API refinements, we added support for password changes and multifactor authentication, but the examplebroker did not have those functionalities to show yet. This PR does some adjustments to the broker and adds those functionalities.

UDENG-1151

internal/brokers/examplebroker/broker.go Outdated Show resolved Hide resolved
internal/brokers/examplebroker/broker.go Outdated Show resolved Hide resolved
internal/brokers/examplebroker/broker.go Outdated Show resolved Hide resolved
internal/brokers/examplebroker/dbus.go Outdated Show resolved Hide resolved
Copy link
Member

@didrocks didrocks left a comment

Choose a reason for hiding this comment

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

Disclaimer: I didn’t test it live yet, I have some suggestions for both code maintainance improvements and avoid down the line being puzzled by "why does this user don’t ask me for reset because I didn’t choose password first" for instance.

Once those are resolve, I will move to some manual testing.

The global idea is here, just need a little bit of refinement IMHO :)

internal/brokers/examplebroker/broker.go Outdated Show resolved Hide resolved
"id": id,
"label": authMode["selection_label"],
})
if authMode, exists := supportedModes["fidodevice1"]; exists && info.selectedMode != "fidodevice1" {
Copy link
Member

Choose a reason for hiding this comment

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

it seems those 3 could be in a for loop (which can be named allModeIDs), no? :)

internal/brokers/examplebroker/broker.go Show resolved Hide resolved
internal/brokers/examplebroker/broker.go Outdated Show resolved Hide resolved
internal/brokers/examplebroker/broker.go Show resolved Hide resolved
internal/brokers/examplebroker/broker.go Outdated Show resolved Hide resolved
internal/brokers/examplebroker/broker.go Show resolved Hide resolved
internal/brokers/examplebroker/broker.go Outdated Show resolved Hide resolved
Copy link
Member

@didrocks didrocks left a comment

Choose a reason for hiding this comment

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

One last small changes to remove one variable, and then, feel free to rebase and merge! Nice work :)

internal/brokers/examplebroker/broker.go Outdated Show resolved Hide resolved
We were using this a couple of times in the code, so I think it deserves
its own function to check if there's an active session with the
specified ID before updating it.
We used to do this inside the the GetAuthenticationModes func, but it
will be easier to understand what is happening with MFA and Password
Resets if this is in a separate function, specially since it involves a
lot of map handling.
@denisonbarbosa denisonbarbosa merged commit 7a77fd2 into main Aug 30, 2023
3 checks passed
@denisonbarbosa denisonbarbosa deleted the extend-example-broker branch August 30, 2023 15:08
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.

3 participants