You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-31 09:24:31 +03:00
Implement the client credentials grant
This commit is contained in:
@ -314,7 +314,7 @@ impl Policy {
|
||||
user: &User,
|
||||
) -> Result<EvaluationResult, EvaluationError> {
|
||||
let input = AuthorizationGrantInput {
|
||||
user,
|
||||
user: Some(user),
|
||||
client,
|
||||
scope: &authorization_grant.scope,
|
||||
grant_type: GrantType::AuthorizationCode,
|
||||
@ -338,7 +338,6 @@ impl Policy {
|
||||
fields(
|
||||
input.scope = %scope,
|
||||
input.client.id = %client.id,
|
||||
input.user.id = %user.id,
|
||||
),
|
||||
err,
|
||||
)]
|
||||
@ -346,10 +345,9 @@ impl Policy {
|
||||
&mut self,
|
||||
scope: &Scope,
|
||||
client: &Client,
|
||||
user: &User,
|
||||
) -> Result<EvaluationResult, EvaluationError> {
|
||||
let input = AuthorizationGrantInput {
|
||||
user,
|
||||
user: None,
|
||||
client,
|
||||
scope,
|
||||
grant_type: GrantType::ClientCredentials,
|
||||
|
@ -107,9 +107,9 @@ pub enum GrantType {
|
||||
pub struct AuthorizationGrantInput<'a> {
|
||||
#[cfg_attr(
|
||||
feature = "jsonschema",
|
||||
schemars(with = "std::collections::HashMap<String, serde_json::Value>")
|
||||
schemars(with = "Option<std::collections::HashMap<String, serde_json::Value>>")
|
||||
)]
|
||||
pub user: &'a User,
|
||||
pub user: Option<&'a User>,
|
||||
|
||||
#[cfg_attr(
|
||||
feature = "jsonschema",
|
||||
|
Reference in New Issue
Block a user