Class RemoteCredentialRepository
- Namespace
- Core.CliniCore.Repositories.Remote
- Assembly
- Core.CliniCore.dll
Remote repository implementation that calls the API for credential operations. Unlike other remote repos, credentials require special auth endpoints. Uses ApiRoutes for all endpoint paths (single source of truth).
public class RemoteCredentialRepository : RemoteRepositoryBase, ICredentialRepository, IRepository<UserCredential>
- Inheritance
-
RemoteCredentialRepository
- Implements
- Inherited Members
Constructors
RemoteCredentialRepository(HttpClient)
public RemoteCredentialRepository(HttpClient httpClient)
Parameters
httpClientHttpClient
Methods
Add(UserCredential)
public void Add(UserCredential entity)
Parameters
entityUserCredential
ChangePassword(string, string, string)
Changes a user's password via the API.
public bool ChangePassword(string username, string currentPassword, string newPassword)
Parameters
Returns
Delete(Guid)
public void Delete(Guid id)
Parameters
idGuid
Exists(string)
Checks if a username already exists.
public bool Exists(string username)
Parameters
usernamestring
Returns
GetAll()
public IEnumerable<UserCredential> GetAll()
Returns
GetById(Guid)
public UserCredential? GetById(Guid id)
Parameters
idGuid
Returns
GetByUsername(string)
Gets a credential by username (the natural key for authentication).
public UserCredential? GetByUsername(string username)
Parameters
usernamestring
Returns
LockAccount(string)
Locks a user account.
public bool LockAccount(string username)
Parameters
usernamestring
Returns
Register(Guid, string, string, string)
Registers new credentials via the API.
public UserCredential? Register(Guid profileId, string username, string password, string role)
Parameters
Returns
Search(string)
public IEnumerable<UserCredential> Search(string query)
Parameters
querystring
Returns
UnlockAccount(string)
Unlocks a user account.
public bool UnlockAccount(string username)
Parameters
usernamestring
Returns
Update(UserCredential)
public void Update(UserCredential entity)
Parameters
entityUserCredential
ValidateCredentials(string, string)
Validates credentials against the API. Returns the credential if valid, null if invalid.
public UserCredential? ValidateCredentials(string username, string password)