added some interface documentation

This commit is contained in:
David Sparer
2019-01-27 18:01:34 -06:00
parent 1f296f2f72
commit ba62c17ea2
3 changed files with 84 additions and 2 deletions

View File

@@ -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; }
}
}

View File

@@ -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;
}
}

View File

@@ -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; }
}
}