Table of Contents

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

httpClient HttpClient

Methods

Add(UserCredential)

public void Add(UserCredential entity)

Parameters

entity UserCredential

ChangePassword(string, string, string)

Changes a user's password via the API.

public bool ChangePassword(string username, string currentPassword, string newPassword)

Parameters

username string
currentPassword string
newPassword string

Returns

bool

Delete(Guid)

public void Delete(Guid id)

Parameters

id Guid

Exists(string)

Checks if a username already exists.

public bool Exists(string username)

Parameters

username string

Returns

bool

GetAll()

public IEnumerable<UserCredential> GetAll()

Returns

IEnumerable<UserCredential>

GetById(Guid)

public UserCredential? GetById(Guid id)

Parameters

id Guid

Returns

UserCredential

GetByUsername(string)

Gets a credential by username (the natural key for authentication).

public UserCredential? GetByUsername(string username)

Parameters

username string

Returns

UserCredential

LockAccount(string)

Locks a user account.

public bool LockAccount(string username)

Parameters

username string

Returns

bool

Register(Guid, string, string, string)

Registers new credentials via the API.

public UserCredential? Register(Guid profileId, string username, string password, string role)

Parameters

profileId Guid
username string
password string
role string

Returns

UserCredential

Search(string)

public IEnumerable<UserCredential> Search(string query)

Parameters

query string

Returns

IEnumerable<UserCredential>

UnlockAccount(string)

Unlocks a user account.

public bool UnlockAccount(string username)

Parameters

username string

Returns

bool

Update(UserCredential)

public void Update(UserCredential entity)

Parameters

entity UserCredential

ValidateCredentials(string, string)

Validates credentials against the API. Returns the credential if valid, null if invalid.

public UserCredential? ValidateCredentials(string username, string password)

Parameters

username string
password string

Returns

UserCredential