mirror of
https://github.com/bitwarden/server.git
synced 2025-01-07 19:37:51 +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="currentPolicy">The current policy, if any</param>
|
||||||
/// <param name="modifiedPolicy">The modified policy to be saved</param>
|
/// <param name="modifiedPolicy">The modified policy to be saved</param>
|
||||||
/// <returns>A sequence of validation errors if validation was unsuccessful</returns>
|
/// <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>
|
/// <summary>
|
||||||
/// Optionally performs side effects after a policy is validated but before it is saved.
|
/// Optionally performs side effects after a policy is validated but before it is saved.
|
||||||
@ -33,5 +33,5 @@ public interface IPolicyDefinition
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="currentPolicy">The current policy, if any</param>
|
/// <param name="currentPolicy">The current policy, if any</param>
|
||||||
/// <param name="modifiedPolicy">The modified policy to be saved</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 PolicyType Type => PolicyType.RequireSso;
|
||||||
public IEnumerable<PolicyType> RequiredPolicies => [PolicyType.SingleOrg];
|
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