Class ConnectionIdentity

Namespace
Cratis.Arc.Connections
Assembly
Cratis.Arc.Core.dll

Represents the identity a connection authenticates with.

public record ConnectionIdentity : IEquatable<ConnectionIdentity>
Inheritance
ConnectionIdentity
Implements
Inherited Members
Extension Methods

Remarks

Set either a user name and password, or an access token. An access token is used as an Entra ID token for SQL Server, as the password for PostgreSQL and as an OIDC token for MongoDB.

Constructors

ConnectionIdentity(ConnectionIdentity)

protected ConnectionIdentity(ConnectionIdentity original)

Parameters

original ConnectionIdentity

ConnectionIdentity(string?, string?, string?)

Represents the identity a connection authenticates with.

public ConnectionIdentity(string? UserName = null, string? Password = null, string? AccessToken = null)

Parameters

UserName string

Optional user name.

Password string

Optional password.

AccessToken string

Optional access token.

Remarks

Set either a user name and password, or an access token. An access token is used as an Entra ID token for SQL Server, as the password for PostgreSQL and as an OIDC token for MongoDB.

Properties

AccessToken

Optional access token.

public string? AccessToken { get; init; }

Property Value

string

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Password

Optional password.

public string? Password { get; init; }

Property Value

string

UserName

Optional user name.

public string? UserName { get; init; }

Property Value

string

Methods

Deconstruct(out string?, out string?, out string?)

public void Deconstruct(out string? UserName, out string? Password, out string? AccessToken)

Parameters

UserName string
Password string
AccessToken string

Equals(ConnectionIdentity?)

public virtual bool Equals(ConnectionIdentity? other)

Parameters

other ConnectionIdentity

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Remarks

Never includes the password or the access token, so an identity can be logged.

Operators

operator ==(ConnectionIdentity?, ConnectionIdentity?)

public static bool operator ==(ConnectionIdentity? left, ConnectionIdentity? right)

Parameters

left ConnectionIdentity
right ConnectionIdentity

Returns

bool

operator !=(ConnectionIdentity?, ConnectionIdentity?)

public static bool operator !=(ConnectionIdentity? left, ConnectionIdentity? right)

Parameters

left ConnectionIdentity
right ConnectionIdentity

Returns

bool