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
TenantIdGuidThe tenant to bind the key to.
NamestringDisplay name for administration.
RolesIReadOnlyCollection<string>Tenant-scoped roles for a machine key. Must be empty when
UserIdis set — a personal access token acts as the bound user and inherits that user's roles instead.UserIdGuid?Bind the key to a user to issue a personal access token;
nullissues a machine key.ExpiresAtDateTimeOffset?Optional expiry.
Properties
ExpiresAt
Optional expiry.
public DateTimeOffset? ExpiresAt { get; init; }
Property Value
Name
Display name for administration.
public string Name { get; init; }
Property Value
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
TenantId
The tenant to bind the key to.
public Guid TenantId { get; init; }
Property Value
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?