Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit 858869b

Browse files
committed
new tests
1 parent 6c04846 commit 858869b

File tree

9 files changed

+348
-105
lines changed

9 files changed

+348
-105
lines changed

src/Backend/Jp.Domain/Validations/Client/ClientValidations.cs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected void ValidateGrantType()
2020

2121
private bool ValidateGrantCombination(ICollection<string> grantTypes, string message)
2222
{
23-
23+
2424

2525
// would allow response_type downgrade attack from code to token
2626
if (DisallowGrantTypeCombination(GrantType.Implicit, GrantType.AuthorizationCode, grantTypes))
@@ -64,5 +64,31 @@ protected void ValidateClientName()
6464
RuleFor(c => c.Client.ClientName).NotEmpty().WithMessage("Client Name must be set");
6565
}
6666

67+
protected void ValidateIdentityTokenLifetime()
68+
{
69+
RuleFor(c => c.Client.IdentityTokenLifetime).GreaterThan(0).WithMessage("Identity Token Lifetime must be greatter than 0");
70+
}
71+
72+
73+
protected void ValidateAccessTokenLifetime()
74+
{
75+
RuleFor(c => c.Client.AccessTokenLifetime).GreaterThan(0).WithMessage("Access Token Lifetime must be greatter than 0");
76+
}
77+
protected void ValidateAuthorizationCodeLifetime()
78+
{
79+
RuleFor(c => c.Client.AuthorizationCodeLifetime).GreaterThan(0).WithMessage("Authorization Code Lifetime must be greatter than 0");
80+
}
81+
protected void ValidateAbsoluteRefreshTokenLifetime()
82+
{
83+
RuleFor(c => c.Client.AbsoluteRefreshTokenLifetime).GreaterThan(0).WithMessage("Absolute Refresh Token Lifetime must be greatter than 0");
84+
}
85+
protected void ValidateSlidingRefreshTokenLifetime()
86+
{
87+
RuleFor(c => c.Client.SlidingRefreshTokenLifetime).GreaterThan(0).WithMessage("Sliding Refresh Token Lifetime must be greatter than 0");
88+
}
89+
protected void ValidateDeviceCodeLifetime()
90+
{
91+
RuleFor(c => c.Client.DeviceCodeLifetime).GreaterThan(0).WithMessage("Device Code Lifetime must be greatter than 0");
92+
}
6793
}
6894
}

src/Backend/Jp.Domain/Validations/Client/UpdateClientCommandValidation.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ public UpdateClientCommandValidation()
88
{
99
ValidateGrantType();
1010
ValidateOldClientId();
11+
ValidateIdentityTokenLifetime();
12+
ValidateAccessTokenLifetime();
13+
ValidateAuthorizationCodeLifetime();
14+
ValidateSlidingRefreshTokenLifetime();
15+
ValidateDeviceCodeLifetime();
16+
ValidateAbsoluteRefreshTokenLifetime();
1117
}
1218
}
1319
}

src/Backend/Jp.UserManagement/appsettings.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/Frontend/Jp.AdminUI/src/app/shared/layout/header/header.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { UserblockService } from "../sidebar/userblock/userblock.service";
77
import { SettingsService } from "@core/settings/settings.service";
88
import { MenuService } from "@core/menu/menu.service";
99
import { Router } from "@angular/router";
10-
import { environment } from "@env/environment.prod";
10+
import { environment } from "@env/environment";
1111

1212

1313
@Component({

src/Frontend/Jp.UI.SSO/appsettings.json

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)