Skip to main content
Table of Contents

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

RawKey string

The key value to store, in the canonical format (see ApiKeyFormat). Generate it with CreateRawKey() — hand-written values are rejected.

TenantId Guid

The tenant to bind the key to.

Name string

Display name for administration.

Roles IReadOnlyCollection<string>

Tenant-scoped roles for the key.

ExpiresAt DateTimeOffset?

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

DateTimeOffset?

Name

Display name for administration.

public string Name { get; init; }

Property Value

string

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

string

Roles

Tenant-scoped roles for the key.

public IReadOnlyCollection<string> Roles { get; init; }

Property Value

IReadOnlyCollection<string>

TenantId

The tenant to bind the key to.

public Guid TenantId { get; init; }

Property Value

Guid