mirror of
https://github.com/bitwarden/server.git
synced 2025-01-06 19:28:08 +01:00
Add default interface implementation
This commit is contained in:
parent
71629047ad
commit
22500e4222
@ -25,7 +25,7 @@ public interface IPolicyDefinition
|
||||
/// <param name="currentPolicy">The current policy, if any</param>
|
||||
/// <param name="modifiedPolicy">The modified policy to be saved</param>
|
||||
/// <returns>A sequence of validation errors if validation was unsuccessful</returns>
|
||||
public Task<string?> ValidateAsync(Policy? currentPolicy, Policy modifiedPolicy);
|
||||
public Task<string?> ValidateAsync(Policy? currentPolicy, Policy modifiedPolicy) => Task.FromResult<string?>(null);
|
||||
|
||||
/// <summary>
|
||||
/// Optionally performs side effects after a policy is validated but before it is saved.
|
||||
@ -33,5 +33,5 @@ public interface IPolicyDefinition
|
||||
/// </summary>
|
||||
/// <param name="currentPolicy">The current policy, if any</param>
|
||||
/// <param name="modifiedPolicy">The modified policy to be saved</param>
|
||||
public Task OnSaveSideEffectsAsync(Policy? currentPolicy, Policy modifiedPolicy);
|
||||
public Task OnSaveSideEffectsAsync(Policy? currentPolicy, Policy modifiedPolicy) => Task.FromResult(0);
|
||||
}
|
||||
|
@ -30,14 +30,4 @@ public class FakeRequireSsoPolicyDefinition : IPolicyDefinition
|
||||
{
|
||||
public PolicyType Type => PolicyType.RequireSso;
|
||||
public IEnumerable<PolicyType> RequiredPolicies => [PolicyType.SingleOrg];
|
||||
|
||||
public Task<string?> ValidateAsync(Policy? currentPolicy, Policy modifiedPolicy)
|
||||
{
|
||||
return Task.FromResult((string)null);
|
||||
}
|
||||
|
||||
public Task OnSaveSideEffectsAsync(Policy? currentPolicy, Policy modifiedPolicy)
|
||||
{
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user