Struct KeyringReference
- Namespace
- Kuestenlogik.Bowire.Keyring
- Assembly
- Kuestenlogik.Bowire.Keyring.dll
A parsed {{keyring.service/account}} reference. The text after
the keyring. prefix is split on the first slash into a
mandatory Service and an optional Account;
a bare {{keyring.service}} leaves Account null,
which each backend maps to "any account under this service".
public readonly struct KeyringReference : IEquatable<KeyringReference>
- Implements
- Inherited Members
Remarks
Splitting on the first slash (rather than the last) keeps the common
service/account shape unambiguous while still allowing a service
name that itself contains slashes — e.g.
{{keyring.https://api.example.com/deploy-bot}} parses to service
https://api.example.com, account deploy-bot. Callers that
need a slash in the account can percent-encode it; the store lookups
treat the decoded strings opaquely.
Constructors
KeyringReference(string, string?)
A parsed {{keyring.service/account}} reference. The text after
the keyring. prefix is split on the first slash into a
mandatory Service and an optional Account;
a bare {{keyring.service}} leaves Account null,
which each backend maps to "any account under this service".
public KeyringReference(string Service, string? Account)
Parameters
Remarks
Splitting on the first slash (rather than the last) keeps the common
service/account shape unambiguous while still allowing a service
name that itself contains slashes — e.g.
{{keyring.https://api.example.com/deploy-bot}} parses to service
https://api.example.com, account deploy-bot. Callers that
need a slash in the account can percent-encode it; the store lookups
treat the decoded strings opaquely.
Properties
Account
public string? Account { get; init; }
Property Value
Service
public string Service { get; init; }
Property Value
Methods
Deconstruct(out string, out string?)
public void Deconstruct(out string Service, out string? Account)
Parameters
Equals(KeyringReference)
public bool Equals(KeyringReference other)
Parameters
otherKeyringReference
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
TryParse(string, out KeyringReference)
Parse the portion of a placeholder key that follows the
keyring. prefix. Returns false for an empty or
whitespace-only reference so the caller leaves the placeholder
intact instead of issuing a meaningless empty-service lookup.
public static bool TryParse(string reference, out KeyringReference parsed)
Parameters
referencestringparsedKeyringReference
Returns
Operators
operator ==(KeyringReference, KeyringReference)
public static bool operator ==(KeyringReference left, KeyringReference right)
Parameters
leftKeyringReferencerightKeyringReference
Returns
operator !=(KeyringReference, KeyringReference)
public static bool operator !=(KeyringReference left, KeyringReference right)
Parameters
leftKeyringReferencerightKeyringReference