Skip to content

Commit 61cee0a

Browse files
authored
fix: Remove config validation in constructors (#63)
1 parent 860ef46 commit 61cee0a

File tree

4 files changed

+0
-32
lines changed

4 files changed

+0
-32
lines changed

src/Authoring/Configs/ForwardRequestConfig.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,4 @@ public record ForwardRequestConfig
5252
/// When set to true, triggers on-error section for response codes in the range from 400 to 599 inclusive. Policy expressions aren't allowed.
5353
/// </summary>
5454
public bool? FailOnErrorStatusCode { get; init; }
55-
56-
public ForwardRequestConfig()
57-
{
58-
if (Timeout.HasValue && TimeoutMs.HasValue)
59-
{
60-
throw new ArgumentException("You can specify either timeout or timeout-ms but not both.");
61-
}
62-
}
6355
}

src/Authoring/Configs/RateLimitConfig.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,4 @@ public abstract record EntityLimitConfig
3232
public string? Id { get; init; }
3333
public required int Calls { get; init; }
3434
public required int RenewalPeriod { get; init; }
35-
36-
public EntityLimitConfig()
37-
{
38-
if (Name is null && Id is null)
39-
{
40-
throw new ArgumentNullException("Name or Id need to be specified");
41-
}
42-
}
4335
}

src/Authoring/Configs/SetBackendServiceConfig.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,4 @@ public record SetBackendServiceConfig
1111
public string? SfServiceInstanceName { get; init; }
1212
public string? SfPartitionKey { get; init; }
1313
public string? SfListenerName { get; init; }
14-
15-
public SetBackendServiceConfig()
16-
{
17-
if (BaseUrl == null && BackendId == null || BaseUrl != null && BackendId != null)
18-
{
19-
throw new ArgumentException("You need to specify either base-url or backend-id but not both.");
20-
}
21-
}
2214
}

src/Authoring/Configs/ValidateJwtConfig.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ public record ValidateJwtConfig
2323
public string[]? Audiences { get; init; }
2424
public string[]? Issuers { get; init; }
2525
public ClaimConfig[]? RequiredClaims { get; init; }
26-
27-
public ValidateJwtConfig()
28-
{
29-
if (new[] { HeaderName, QueryParameterName, TokenValue }.Count(string.IsNullOrEmpty) != 1)
30-
{
31-
throw new ArgumentException("Only one of HeaderName, QueryParameterName and TokenValue must be set");
32-
}
33-
}
3426
}
3527

3628
public record OpenIdConfig

0 commit comments

Comments
 (0)