mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
added some interface documentation
This commit is contained in:
@@ -2,16 +2,37 @@
|
||||
using System.ComponentModel;
|
||||
using System.Security;
|
||||
|
||||
|
||||
namespace mRemoteNG.Credential
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a named set of username/domain/password information.
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(CredentialRecordTypeConverter))]
|
||||
public interface ICredentialRecord : INotifyPropertyChanged
|
||||
{
|
||||
/// <summary>
|
||||
/// An Id which uniquely identifies this credential record.
|
||||
/// </summary>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A friendly name for this credential record.
|
||||
/// </summary>
|
||||
string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The username portion of the credential.
|
||||
/// </summary>
|
||||
string Username { get; set; }
|
||||
SecureString Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The domain portion of the credential.
|
||||
/// </summary>
|
||||
string Domain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The password
|
||||
/// </summary>
|
||||
SecureString Password { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -9,14 +9,52 @@ namespace mRemoteNG.Credential
|
||||
{
|
||||
public interface ICredentialRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// The configuration information for this credential repository.
|
||||
/// </summary>
|
||||
ICredentialRepositoryConfig Config { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of the <see cref="ICredentialRecord"/>s provided by this repository.
|
||||
/// </summary>
|
||||
IList<ICredentialRecord> CredentialRecords { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A friendly name for this repository.
|
||||
/// </summary>
|
||||
string Title { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not this repository has been unlocked and is able to provide
|
||||
/// credentials.
|
||||
/// </summary>
|
||||
bool IsLoaded { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Unlock the repository with the given key and load all available credentials.
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
void LoadCredentials(SecureString key);
|
||||
|
||||
/// <summary>
|
||||
/// Save all credentials provided by this repository.
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
void SaveCredentials(SecureString key);
|
||||
|
||||
/// <summary>
|
||||
/// Lock and unload all credentials provided by this repository.
|
||||
/// </summary>
|
||||
void UnloadCredentials();
|
||||
|
||||
/// <summary>
|
||||
/// This event is raised when any changes are made to the assigned <see cref="Config"/>.
|
||||
/// </summary>
|
||||
event EventHandler RepositoryConfigUpdated;
|
||||
|
||||
/// <summary>
|
||||
/// This event is raised when a credential is added or removed from this repository.
|
||||
/// </summary>
|
||||
event EventHandler<CollectionUpdatedEventArgs<ICredentialRecord>> CredentialsUpdated;
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,33 @@ namespace mRemoteNG.Credential.Repositories
|
||||
{
|
||||
public interface ICredentialRepositoryConfig : INotifyPropertyChanged
|
||||
{
|
||||
/// <summary>
|
||||
/// An Id which uniquely identifies this credential repository.
|
||||
/// </summary>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A friendly name for this credential repository
|
||||
/// </summary>
|
||||
string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A name which uniquely identifies the type of credential repository this
|
||||
/// config represents. This is used for determining which <see cref="ICredentialRepositoryFactory"/>
|
||||
/// to use to create the <see cref="ICredentialRepository"/>.
|
||||
/// </summary>
|
||||
string TypeName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A string representing how to access the persisted credential records.
|
||||
/// This may be a file path, URL, database connection string, etc. depending
|
||||
/// on the implementation of the <see cref="ICredentialRepository"/>.
|
||||
/// </summary>
|
||||
string Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The password necessary to unlock and access the underlying repository.
|
||||
/// </summary>
|
||||
SecureString Key { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user