Skip to content

Commit

Permalink
Override for AclWithAadAuthenticator added. Earlier it would only use…
Browse files Browse the repository at this point in the history
… IsAuthenticated from base class i.e. GarnetAclAuthenticator which would not abide by IsAuthenticated from aad authenticator which sets token validity.
  • Loading branch information
Xizt committed Dec 10, 2024
1 parent 4ebe239 commit a44aeb4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/server/Auth/GarnetACLAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public GarnetACLAuthenticator(AccessControlList accessControlList, ILogger logge
/// <summary>
/// Check if the user is authorized to execute commands.
/// </summary>
public bool IsAuthenticated => _user != null;
public virtual bool IsAuthenticated => _user != null;

/// <summary>
/// ACL authenticator is can use ACL.
Expand Down
9 changes: 9 additions & 0 deletions libs/server/Auth/GarnetAclWithAadAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,14 @@ protected override bool AuthenticateInternal(User user, ReadOnlySpan<byte> usern
}
return false;
}

public override bool IsAuthenticated
{
get
{
return this._garnetAuthenticator.IsAuthenticated
&& base.IsAuthenticated;
}
}
}
}

0 comments on commit a44aeb4

Please sign in to comment.