Class ApiKeyImportRequest
- Namespace
- Stratara.Abstractions.ApiKeys
- Assembly
- Stratara.Abstractions.dll
Parameters for importing a machine key whose raw value the caller already holds — the bootstrap counterpart to ApiKeyIssueRequest.
[ExcludeFromCodeCoverage]
public sealed record ApiKeyImportRequest : IEquatable<ApiKeyImportRequest>
- Inheritance
-
ApiKeyImportRequest
- Implements
- Inherited Members
- Extension Methods
Remarks
There is deliberately no UserId: a personal access token acts as its bound user and is
issued interactively by that user, so a caller-supplied value has no meaning there. Import is a
machine-key path only.
Constructors
ApiKeyImportRequest(string, Guid, string, IReadOnlyCollection<string>, DateTimeOffset?)
Parameters for importing a machine key whose raw value the caller already holds — the bootstrap counterpart to ApiKeyIssueRequest.
public ApiKeyImportRequest(string RawKey, Guid TenantId, string Name, IReadOnlyCollection<string> Roles, DateTimeOffset? ExpiresAt = null)
Parameters
RawKeystringThe key value to store, in the canonical format (see ApiKeyFormat). Generate it with CreateRawKey() — hand-written values are rejected.
TenantIdGuidThe tenant to bind the key to.
NamestringDisplay name for administration.
RolesIReadOnlyCollection<string>Tenant-scoped roles for the key.
ExpiresAtDateTimeOffset?Optional expiry.
Remarks
There is deliberately no UserId: a personal access token acts as its bound user and is
issued interactively by that user, so a caller-supplied value has no meaning there. Import is a
machine-key path only.
Properties
ExpiresAt
Optional expiry.
public DateTimeOffset? ExpiresAt { get; init; }
Property Value
Name
Display name for administration.
public string Name { get; init; }
Property Value
RawKey
The key value to store, in the canonical format (see ApiKeyFormat). Generate it with CreateRawKey() — hand-written values are rejected.
public string RawKey { get; init; }
Property Value
Roles
Tenant-scoped roles for the key.
public IReadOnlyCollection<string> Roles { get; init; }
Property Value
TenantId
The tenant to bind the key to.
public Guid TenantId { get; init; }