-
Notifications
You must be signed in to change notification settings - Fork 4
🐞 Datafix API: replace-pin sets temporary true #3135
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -181,6 +181,10 @@ pub struct PasswordPolicy { | |
| base: BasePolicy, | ||
| size: usize, | ||
| characters: CharactersPolicy, | ||
| /// Whether the generated PIN is a Keycloak temporary credential (forcing | ||
| /// a change on next login). `None` when the annotation omits it; callers | ||
| /// decide their own default rather than relying on Keycloak's. | ||
| pub temporary: Option<bool>, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift Model the temporary credential policy with an enum.
As per coding guidelines: “Model policies and configuration options with enums rather than booleans in Rust.” 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| } | ||
|
|
||
| impl PasswordPolicy { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Default an omitted
temporarysetting totrue.When
temporaryis absent, this branch passesSome(false)toedit_user. Existing annotations without the new field therefore do not create a temporary replacement PIN. This conflicts with the PR objective thatreplace-pinsetstemporarytotrue. UseSome(true)forNoneand preserve explicitSome(false)as the opt-out.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents