Skip to main content
Table of Contents

Class ApiKeyIssueRequest

Namespace
Stratara.Abstractions.ApiKeys
Assembly
Stratara.Abstractions.dll

Parameters for issuing a new API key.

[ExcludeFromCodeCoverage]
public sealed record ApiKeyIssueRequest : IEquatable<ApiKeyIssueRequest>
Inheritance
ApiKeyIssueRequest
Implements
Inherited Members
Extension Methods

Constructors

ApiKeyIssueRequest(Guid, string, IReadOnlyCollection<string>, Guid?, DateTimeOffset?)

Parameters for issuing a new API key.

public ApiKeyIssueRequest(Guid TenantId, string Name, IReadOnlyCollection<string> Roles, Guid? UserId = null, DateTimeOffset? ExpiresAt = null)

Parameters

TenantId Guid

The tenant to bind the key to.

Name string

Display name for administration.

Roles IReadOnlyCollection<string>

Tenant-scoped roles for a machine key. Must be empty when UserId is set — a personal access token acts as the bound user and inherits that user's roles instead.

UserId Guid?

Bind the key to a user to issue a personal access token; null issues a machine key.

ExpiresAt DateTimeOffset?

Optional expiry.

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

Roles

Tenant-scoped roles for a machine key. Must be empty when UserId is set — a personal access token acts as the bound user and inherits that user's roles instead.

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

UserId

Bind the key to a user to issue a personal access token; null issues a machine key.

public Guid? UserId { get; init; }

Property Value

Guid?