@fiado/type-kit 3.142.0 → 3.143.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -86,9 +86,10 @@ describe('CreateTenantRequest', () => {
86
86
  });
87
87
 
88
88
  it('falla si securityPolicy.methodsAllowed tiene un método fuera del value-set', async () => {
89
+ // DEC-RBAC-085: 'SMS' pasó a ser válido; usamos un valor realmente fuera del set.
89
90
  const dto = plainToInstance(CreateTenantRequest, {
90
91
  ...valid,
91
- securityPolicy: { methodsAllowed: ['SMS'] },
92
+ securityPolicy: { methodsAllowed: ['PUSH'] },
92
93
  });
93
94
  const errors = await validate(dto);
94
95
  expect(errors.some(e => e.property === 'securityPolicy')).toBe(true);
@@ -9,7 +9,7 @@ export interface LevelDef {
9
9
  }
10
10
  export interface ApplicationSecurityPolicyDefault {
11
11
  mfaEnabled?: boolean;
12
- methodsAllowed?: Array<'TOTP' | 'EMAIL'>;
12
+ methodsAllowed?: Array<'TOTP' | 'EMAIL' | 'SMS'>;
13
13
  }
14
14
  export interface ApplicationBrandingDefault {
15
15
  logoUrl?: string;
@@ -9,7 +9,7 @@ import { TokenValidationMode } from '../enums/TokenValidationMode';
9
9
  * (@ArrayNotEmpty); en el create es opcional.
10
10
  */
11
11
  export declare class CreateTenantSecurityPolicy {
12
- methodsAllowed?: ('EMAIL' | 'TOTP')[];
12
+ methodsAllowed?: ('EMAIL' | 'TOTP' | 'SMS')[];
13
13
  mfaEnabled?: boolean;
14
14
  }
15
15
  /**
@@ -29,7 +29,7 @@ __decorate([
29
29
  (0, class_transformer_1.Expose)(),
30
30
  (0, class_validator_1.IsOptional)(),
31
31
  (0, class_validator_1.IsArray)(),
32
- (0, class_validator_1.IsIn)(['EMAIL', 'TOTP'], { each: true }),
32
+ (0, class_validator_1.IsIn)(['EMAIL', 'TOTP', 'SMS'], { each: true }),
33
33
  __metadata("design:type", Array)
34
34
  ], CreateTenantSecurityPolicy.prototype, "methodsAllowed", void 0);
35
35
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.142.0",
3
+ "version": "3.143.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -12,7 +12,8 @@ export interface LevelDef {
12
12
  export interface ApplicationSecurityPolicyDefault {
13
13
  // DEC-RBAC-045: 2FA master switch por tenant. Ausente ⇒ habilitado (secure-by-default).
14
14
  mfaEnabled?: boolean;
15
- methodsAllowed?: Array<'TOTP' | 'EMAIL'>;
15
+ // DEC-RBAC-085: 'SMS' se suma como 3er método de MFA tenant-controlado.
16
+ methodsAllowed?: Array<'TOTP' | 'EMAIL' | 'SMS'>;
16
17
  // DEC-RBAC-051: purgados mfaRequired / defaultPreferred / sessionTimeoutMin (write-only sin enforcement).
17
18
  // DEC-RBAC-052: passwordPolicy deja de ser per-tenant → política global por env vars (Cognito enforce).
18
19
  }
@@ -22,8 +22,9 @@ import { TokenValidationMode } from '../enums/TokenValidationMode';
22
22
  * (@ArrayNotEmpty); en el create es opcional.
23
23
  */
24
24
  export class CreateTenantSecurityPolicy {
25
- @Expose() @IsOptional() @IsArray() @IsIn(['EMAIL', 'TOTP'], { each: true })
26
- methodsAllowed?: ('EMAIL' | 'TOTP')[];
25
+ // DEC-RBAC-085: 'SMS' se suma como 3er método de MFA tenant-controlado.
26
+ @Expose() @IsOptional() @IsArray() @IsIn(['EMAIL', 'TOTP', 'SMS'], { each: true })
27
+ methodsAllowed?: ('EMAIL' | 'TOTP' | 'SMS')[];
27
28
 
28
29
  @Expose() @IsOptional() @IsBoolean()
29
30
  mfaEnabled?: boolean;