mirror of
https://github.com/bitwarden/server.git
synced 2026-02-05 16:43:14 +08:00
[PM-20592] [PM-22737] [PM-22738] Send grant validator (#6151)
**feat**: create `SendGrantValidator` and initial `SendPasswordValidator` for Send access grants **feat**: add feature flag to toggle Send grant validation logic **feat**: add Send client to Identity and update `ApiClient` to generic `Client` **feat**: register Send services in DI pipeline **feat**: add claims management support to `ProfileService` **feat**: distinguish between invalid grant and invalid request in `SendAccessGrantValidator` **fix**: update parsing of `send_id` from request **fix**: add early return when feature flag is disabled **fix**: rename and organize Send access scope and grant type **fix**: dotnet format **test**: add unit and integration tests for `SendGrantValidator` **test**: update OpenID configuration and API resource claims **doc**: move documentation to interfaces and update inline comments **chore**: add TODO for future support of `CustomGrantTypes`
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using Bit.Core.Tools.Models.Data;
|
||||
using Duende.IdentityServer.Validation;
|
||||
|
||||
namespace Bit.Identity.IdentityServer.RequestValidators.SendAccess;
|
||||
|
||||
public interface ISendPasswordRequestValidator
|
||||
{
|
||||
/// <summary>
|
||||
/// Validates the send password hash against the client hashed password.
|
||||
/// If this method fails then it will automatically set the context.Result to an invalid grant result.
|
||||
/// </summary>
|
||||
/// <param name="context">request context</param>
|
||||
/// <param name="resourcePassword">resource password authentication method containing the hash of the Send being retrieved</param>
|
||||
/// <returns>returns the result of the validation; A failed result will be an error a successful will contain the claims and a success</returns>
|
||||
GrantValidationResult ValidateSendPassword(ExtensionGrantValidationContext context, ResourcePassword resourcePassword, Guid sendId);
|
||||
}
|
||||
Reference in New Issue
Block a user