-
Notifications
You must be signed in to change notification settings - Fork 175
feat: Add password enrollment to MyAccount API #1003
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
886be06
feat : Add password enrollment to MyAccount API
pmathew92 cc978f6
Updated the Examples.md file
pmathew92 8cf2971
Updated few minor test cases
pmathew92 594ff78
Made properties non optional
pmathew92 f6dce7a
Minor doc change update
pmathew92 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
auth0/src/main/java/com/auth0/android/result/PasswordPolicy.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| package com.auth0.android.result | ||
|
|
||
| import com.google.gson.annotations.SerializedName | ||
|
|
||
| /** | ||
| * Describes the password policy that a new password must satisfy, as returned by the My Account API | ||
| * when starting a password enrollment. Use it to build a UI that guides the user toward a compliant | ||
| * password. | ||
| */ | ||
| public data class PasswordPolicy( | ||
| /** | ||
| * Rules governing the structural complexity of the password (length, character types, etc.). | ||
| */ | ||
| @SerializedName("complexity") | ||
| public val complexity: PasswordComplexity, | ||
| /** | ||
| * Rules that prevent the password from containing personal information taken from the user profile. | ||
| */ | ||
| @SerializedName("profile_data") | ||
| public val profileData: PasswordProfileData, | ||
| /** | ||
| * Rules that prevent reuse of previously used passwords. | ||
| */ | ||
| @SerializedName("history") | ||
| public val history: PasswordHistory, | ||
| /** | ||
| * Rules that prevent the use of common dictionary words as passwords. | ||
| */ | ||
| @SerializedName("dictionary") | ||
| public val dictionary: PasswordDictionary | ||
| ) | ||
|
|
||
| /** | ||
| * Structural complexity requirements for a password. | ||
| */ | ||
| public data class PasswordComplexity( | ||
| /** | ||
| * The minimum number of characters the password must contain. | ||
| */ | ||
| @SerializedName("min_length") | ||
| public val minLength: Int?, | ||
| /** | ||
| * The character classes the password may be required to include. | ||
| * Possible values: `uppercase`, `lowercase`, `number`, `special`. | ||
| */ | ||
| @SerializedName("character_types") | ||
| public val characterTypes: List<String>?, | ||
| /** | ||
| * How the [characterTypes] requirement is enforced. | ||
| * Possible values: `all` (every listed type is required), `three_of_four`. | ||
| */ | ||
| @SerializedName("character_type_rule") | ||
| public val characterTypeRule: String?, | ||
| /** | ||
| * Whether identical consecutive characters are permitted. | ||
| * Possible values: `allow`, `block`. | ||
| */ | ||
| @SerializedName("identical_characters") | ||
| public val identicalCharacters: String?, | ||
| /** | ||
| * Whether sequential characters (e.g. `abc`, `123`) are permitted. | ||
| * Possible values: `allow`, `block`. | ||
| */ | ||
| @SerializedName("sequential_characters") | ||
| public val sequentialCharacters: String?, | ||
| /** | ||
| * How a password that exceeds the maximum allowed length is handled. | ||
| * Possible values: `truncate`, `error`. | ||
| */ | ||
| @SerializedName("max_length_exceeded") | ||
| public val maxLengthExceeded: String? | ||
| ) | ||
|
|
||
| /** | ||
| * Rules that block the use of personal information from the user profile within a password. | ||
| */ | ||
| public data class PasswordProfileData( | ||
| /** | ||
| * Whether blocking of personal information is enabled. | ||
| */ | ||
| @SerializedName("active") | ||
| public val active: Boolean?, | ||
| /** | ||
| * The user profile fields whose values must not appear in the password | ||
| * (e.g. `name`, `email`, `user_metadata.first`). | ||
| */ | ||
| @SerializedName("blocked_fields") | ||
| public val blockedFields: List<String>? | ||
| ) | ||
|
|
||
| /** | ||
| * Rules that prevent reuse of previously used passwords. | ||
| */ | ||
| public data class PasswordHistory( | ||
| /** | ||
| * Whether password history enforcement is enabled. | ||
| */ | ||
| @SerializedName("active") | ||
| public val active: Boolean?, | ||
| /** | ||
| * The number of previous passwords that cannot be reused. | ||
| */ | ||
| @SerializedName("size") | ||
| public val size: Int? | ||
| ) | ||
|
|
||
| /** | ||
| * Rules that prevent the use of common dictionary words as passwords. | ||
| */ | ||
| public data class PasswordDictionary( | ||
| /** | ||
| * Whether dictionary checking is enabled. | ||
| */ | ||
| @SerializedName("active") | ||
| public val active: Boolean?, | ||
| /** | ||
| * The default dictionary used for the check. | ||
| * Possible values: `en_10k`, `en_100k`. | ||
| */ | ||
| @SerializedName("default") | ||
| public val default: String? | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.