Skip to content

Commit 4382a2d

Browse files
committed
Remove custom strength options separate type
1 parent 1ea6337 commit 4382a2d

File tree

4 files changed

+43
-36
lines changed

4 files changed

+43
-36
lines changed

common/api-review/auth.api.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,14 @@ export interface ParsedToken {
565565
// @public
566566
export interface PasswordPolicy {
567567
readonly allowedNonAlphanumericCharacters?: string[];
568-
// Warning: (ae-forgotten-export) The symbol "PasswordPolicyCustomStrengthOptions" needs to be exported by the entry point index.d.ts
569-
readonly customStrengthOptions: PasswordPolicyCustomStrengthOptions;
568+
readonly customStrengthOptions: {
569+
readonly minPasswordLength?: number;
570+
readonly maxPasswordLength?: number;
571+
readonly containsLowercaseLetter?: boolean;
572+
readonly containsUppercaseLetter?: boolean;
573+
readonly containsNumericCharacter?: boolean;
574+
readonly containsNonAlphanumericCharacter?: boolean;
575+
};
570576
}
571577

572578
// @public

docs-devsite/auth.passwordpolicy.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface PasswordPolicy
2323
| Property | Type | Description |
2424
| --- | --- | --- |
2525
| [allowedNonAlphanumericCharacters](./auth.passwordpolicy.md#passwordpolicyallowednonalphanumericcharacters) | string\[\] | List of characters that are considered non-alphanumeric during validation. |
26-
| [customStrengthOptions](./auth.passwordpolicy.md#passwordpolicycustomstrengthoptions) | PasswordPolicyCustomStrengthOptions | Requirements enforced by this password policy. |
26+
| [customStrengthOptions](./auth.passwordpolicy.md#passwordpolicycustomstrengthoptions) | { readonly minPasswordLength?: number; readonly maxPasswordLength?: number; readonly containsLowercaseLetter?: boolean; readonly containsUppercaseLetter?: boolean; readonly containsNumericCharacter?: boolean; readonly containsNonAlphanumericCharacter?: boolean; } | Requirements enforced by this password policy. |
2727

2828
## PasswordPolicy.allowedNonAlphanumericCharacters
2929

@@ -42,5 +42,12 @@ Requirements enforced by this password policy.
4242
<b>Signature:</b>
4343

4444
```typescript
45-
readonly customStrengthOptions: PasswordPolicyCustomStrengthOptions;
45+
readonly customStrengthOptions: {
46+
readonly minPasswordLength?: number;
47+
readonly maxPasswordLength?: number;
48+
readonly containsLowercaseLetter?: boolean;
49+
readonly containsUppercaseLetter?: boolean;
50+
readonly containsNumericCharacter?: boolean;
51+
readonly containsNonAlphanumericCharacter?: boolean;
52+
};
4653
```

packages/auth/src/model/password_policy.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,6 @@
1717

1818
import { PasswordPolicy, PasswordValidationStatus } from './public_types';
1919

20-
/**
21-
* Custom strength options supported in the password policy.
22-
*/
23-
export interface PasswordPolicyCustomStrengthOptions {
24-
/**
25-
* Minimum password length.
26-
*/
27-
readonly minPasswordLength?: number;
28-
/**
29-
* Maximum password length.
30-
*/
31-
readonly maxPasswordLength?: number;
32-
/**
33-
* Whether the password should contain a lowercase letter.
34-
*/
35-
readonly containsLowercaseLetter?: boolean;
36-
/**
37-
* Whether the password should contain an uppercase letter.
38-
*/
39-
readonly containsUppercaseLetter?: boolean;
40-
/**
41-
* Whether the password should contain a numeric character.
42-
*/
43-
readonly containsNumericCharacter?: boolean;
44-
/**
45-
* Whether the password should contain a non-alphanumeric character.
46-
*/
47-
readonly containsNonAlphanumericCharacter?: boolean;
48-
}
49-
5020
/**
5121
* Internal typing of password policy that includes the schema version and methods for
5222
* validating that a password meets the policy. The developer does not need access to

packages/auth/src/model/public_types.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import {
3232
OperationType as OperationTypeMap,
3333
ActionCodeOperation as ActionCodeOperationMap
3434
} from './enum_maps';
35-
import { PasswordPolicyCustomStrengthOptions } from './password_policy';
3635

3736
export { CompleteFn, ErrorFn, NextFn, Unsubscribe };
3837

@@ -1263,7 +1262,32 @@ export interface PasswordPolicy {
12631262
/**
12641263
* Requirements enforced by this password policy.
12651264
*/
1266-
readonly customStrengthOptions: PasswordPolicyCustomStrengthOptions;
1265+
readonly customStrengthOptions: {
1266+
/**
1267+
* Minimum password length.
1268+
*/
1269+
readonly minPasswordLength?: number;
1270+
/**
1271+
* Maximum password length.
1272+
*/
1273+
readonly maxPasswordLength?: number;
1274+
/**
1275+
* Whether the password should contain a lowercase letter.
1276+
*/
1277+
readonly containsLowercaseLetter?: boolean;
1278+
/**
1279+
* Whether the password should contain an uppercase letter.
1280+
*/
1281+
readonly containsUppercaseLetter?: boolean;
1282+
/**
1283+
* Whether the password should contain a numeric character.
1284+
*/
1285+
readonly containsNumericCharacter?: boolean;
1286+
/**
1287+
* Whether the password should contain a non-alphanumeric character.
1288+
*/
1289+
readonly containsNonAlphanumericCharacter?: boolean;
1290+
};
12671291
/**
12681292
* List of characters that are considered non-alphanumeric during validation.
12691293
*/

0 commit comments

Comments
 (0)