Method ReadCredentialsAsync
- Namespace
- MailFathom.Application.Access.Credentials
- Assembly
- MailFathom.Application.dll
ReadCredentialsAsync(UserId, CancellationToken)
Reads the credentials one user holds, of every method, beside what the user currently holds.
public Task<UserCredentialListing> ReadCredentialsAsync(UserId user, CancellationToken cancellationToken)
Parameters
userUserIdThe user being asked about.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<UserCredentialListing>
The credentials, oldest first and empty when the user holds none, with the user's grant each one narrows.
Remarks
A user this deployment holds no record for is answered with an empty listing and a grant holding nothing rather than a refusal, because "which credentials does this user hold" has the same answer either way and telling the two apart would report which user identifiers exist. A user outside the caller's scope is answered the same way for the same reason. The grant travels with the listing because a credential's narrowing alone does not say what it admits: a listed name the user does not hold yields nothing.
Exceptions
- ArgumentException
Thrown when
usernames nobody.- PrincipalNotAuthorizedException
Thrown when the caller holds AdminRead at no scope.