Bundle: redb-identity / src/redb.Identity.Contracts (src.redb.Identity.Contracts.txt), 129 files
Snapshot: development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Index: https://redbase.app/src/dev-2026-12-06/redb-identity/_index.txt
====
Path: redb-identity/src/redb.Identity.Contracts/Applications/ApplicationResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Applications/ApplicationResponse.cs
----
using System.Text.Json.Serialization;
using redb.Identity.Contracts.Common;
namespace redb.Identity.Contracts.Applications;
public sealed class ApplicationResponse
{
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("clientId")]
public string? ClientId { get; set; }
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("clientType")]
public string? ClientType { get; set; }
[JsonPropertyName("consentType")]
public string? ConsentType { get; set; }
[JsonPropertyName("applicationType")]
public string? ApplicationType { get; set; }
[JsonPropertyName("permissions")]
public string[]? Permissions { get; set; }
[JsonPropertyName("redirectUris")]
public string[]? RedirectUris { get; set; }
[JsonPropertyName("postLogoutRedirectUris")]
public string[]? PostLogoutRedirectUris { get; set; }
[JsonPropertyName("requirements")]
public string[]? Requirements { get; set; }
[JsonPropertyName("passwordResetUris")]
public string[]? PasswordResetUris { get; set; }
[JsonPropertyName("emailVerifyUris")]
public string[]? EmailVerifyUris { get; set; }
[JsonPropertyName("changeEmailUris")]
public string[]? ChangeEmailUris { get; set; }
[JsonPropertyName("concurrencyToken")]
public string? ConcurrencyToken { get; set; }
///
/// OIDC Back-Channel Logout 1.0 §2.2 endpoint. Absolute HTTPS (or http for
/// localhost/dev) URL the server POSTs a signed logout_token to when
/// the user's session is terminated. Null/empty disables back-channel
/// logout for this client.
///
[JsonPropertyName("backchannelLogoutUri")]
public string? BackchannelLogoutUri { get; set; }
///
/// OIDC Back-Channel Logout 1.0 §2.2 — when true, the dispatched
/// logout_token includes a sid claim so the RP can
/// invalidate the matching session. Defaults to true (RFC-recommended).
///
[JsonPropertyName("backchannelLogoutSessionRequired")]
public bool? BackchannelLogoutSessionRequired { get; set; }
///
/// OAuth 2.1 §4.4 / RFC 9126 PAR mandatory flag. When true, this client's
/// authorization requests must come via /connect/par first; direct calls to
/// /connect/authorize are rejected with par_required. Null is false.
///
[JsonPropertyName("requirePushedAuthorizationRequests")]
public bool? RequirePushedAuthorizationRequests { get; set; }
///
/// RFC 7517 JWKS document attached to this client. Used for (a) verifying
/// the JWT bearer assertion when this client authenticates with
/// client_secret_jwt / private_key_jwt, and (b) encrypting
/// the issued id_token when ID-Token encryption is enabled.
///
[JsonPropertyName("jsonWebKeySet")]
public string? JsonWebKeySet { get; set; }
///
/// Per-client access-token lifetime in seconds. Null means "use the global
///
/// default" (1 h). Set to override only for this client — matches WSO2 IS 7.x
/// "User access token expiry time".
///
[JsonPropertyName("accessTokenLifetimeSeconds")]
public int? AccessTokenLifetimeSeconds { get; set; }
///
/// Per-client refresh-token lifetime in seconds. Null = global default (14 d).
///
[JsonPropertyName("refreshTokenLifetimeSeconds")]
public int? RefreshTokenLifetimeSeconds { get; set; }
///
/// Per-client id_token lifetime in seconds. Null = global default (5 min).
/// Matches WSO2 IS 7.x "ID Token expiry time".
///
[JsonPropertyName("identityTokenLifetimeSeconds")]
public int? IdentityTokenLifetimeSeconds { get; set; }
///
/// Extra audiences appended to issued id_tokens. The client's own
/// client_id is always included as an audience by default (OIDC core §2);
/// these entries broaden the audience set so federated downstream resource
/// servers can also accept the id_token. Matches WSO2 IS 7.x "Audience".
///
[JsonPropertyName("idTokenAudiences")]
public string[]? IdTokenAudiences { get; set; }
///
/// Resource indicators carried by issued access_tokens as aud values
/// (RFC 9068 §2.2), in addition to the Resources of the granted scopes. When neither
/// names a resource the server's default audience ({issuer}/resources unless
/// configured) is used.
///
[JsonPropertyName("accessTokenAudiences")]
public string[]? AccessTokenAudiences { get; set; }
/// OIDC Dynamic Client Registration 1.0 §2 request_uris: registered JAR request_uri values.
[JsonPropertyName("requestUris")]
public string[]? RequestUris { get; set; }
/// A.6: RFC 9101 — JWT signing alg for the request object. Advisory.
[JsonPropertyName("requestObjectSigningAlg")]
public string? RequestObjectSigningAlg { get; set; }
/// A.6: JWE alg for the request object. Advisory.
[JsonPropertyName("requestObjectEncryptionAlg")]
public string? RequestObjectEncryptionAlg { get; set; }
/// A.6: JWE enc for the request object. Advisory.
[JsonPropertyName("requestObjectEncryptionEnc")]
public string? RequestObjectEncryptionEnc { get; set; }
///
/// A.7: client JWKS endpoint URL (RFC 7591 §2). Mutually exclusive with the
/// inline field at the UI layer.
///
[JsonPropertyName("jwksUri")]
public string? JwksUri { get; set; }
///
/// A.8: RFC 9449 — per-client opt-in to strict DPoP mode at the token endpoint.
/// Null is treated as false.
///
[JsonPropertyName("requireDpop")]
public bool? RequireDpop { get; set; }
/// A.10: skip RP-initiated logout consent prompt for this app.
[JsonPropertyName("skipLogoutConsent")]
public bool? SkipLogoutConsent { get; set; }
/// A.10: mark application as a FIDO trusted relying party.
[JsonPropertyName("isFidoTrusted")]
public bool? IsFidoTrusted { get; set; }
///
/// β: whitelist of group names allowed to authenticate against this app.
/// Null/empty = any authenticated user.
///
[JsonPropertyName("allowedGroups")]
public string[]? AllowedGroups { get; set; }
///
/// Plaintext client secret. Populated only by the rotate-secret endpoint
/// (the one-time response that displays the freshly generated secret). All other
/// list / read / create / update responses leave this null by design —
/// secrets are stored as BCrypt hashes and cannot be recovered. Callers must
/// persist the value immediately; subsequent reads will never expose it again.
///
[OneTimeSecret]
[JsonPropertyName("newSecret")]
public string? NewSecret { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Applications/CreateApplicationRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Applications/CreateApplicationRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Applications;
public sealed class CreateApplicationRequest
{
[Required(AllowEmptyStrings = false, ErrorMessage = "clientId is required.")]
[StringLength(200, MinimumLength = 1)]
[JsonPropertyName("clientId")]
public string ClientId { get; set; } = string.Empty;
[JsonPropertyName("clientSecret")]
public string? ClientSecret { get; set; }
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("clientType")]
public string? ClientType { get; set; }
[JsonPropertyName("consentType")]
public string? ConsentType { get; set; }
[JsonPropertyName("applicationType")]
public string? ApplicationType { get; set; }
[JsonPropertyName("permissions")]
public string[]? Permissions { get; set; }
[JsonPropertyName("redirectUris")]
public string[]? RedirectUris { get; set; }
[JsonPropertyName("postLogoutRedirectUris")]
public string[]? PostLogoutRedirectUris { get; set; }
[JsonPropertyName("requirements")]
public string[]? Requirements { get; set; }
///
/// OIDC Back-Channel Logout 1.0 §2.2 endpoint. Absolute HTTPS (or http for
/// localhost/dev) URL the server POSTs a signed logout_token to when
/// the user's session is terminated. Stored on the application as the
/// backchannel_logout_uri custom property.
///
[JsonPropertyName("backchannelLogoutUri")]
public string? BackchannelLogoutUri { get; set; }
///
/// OIDC Back-Channel Logout 1.0 §2.2 — when true, the dispatched
/// logout_token includes a sid claim so the RP can
/// invalidate the matching session. Defaults to true (RFC-recommended)
/// when is set without an explicit
/// value.
///
[JsonPropertyName("backchannelLogoutSessionRequired")]
public bool? BackchannelLogoutSessionRequired { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Applications/UpdateApplicationRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Applications/UpdateApplicationRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Applications;
public sealed class UpdateApplicationRequest
{
[Required(AllowEmptyStrings = false, ErrorMessage = "id is required.")]
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("clientType")]
public string? ClientType { get; set; }
[JsonPropertyName("consentType")]
public string? ConsentType { get; set; }
[JsonPropertyName("permissions")]
public string[]? Permissions { get; set; }
[JsonPropertyName("redirectUris")]
public string[]? RedirectUris { get; set; }
[JsonPropertyName("postLogoutRedirectUris")]
public string[]? PostLogoutRedirectUris { get; set; }
[JsonPropertyName("requirements")]
public string[]? Requirements { get; set; }
///
/// N-4 (Session C): allowed password-reset landing URIs. The callerResetUrl
/// on /api/v1/identity/password/forgot must exactly match one of these
/// (string compare). null/empty disables the password-recovery flow for this client.
///
[JsonPropertyName("passwordResetUris")]
public string[]? PasswordResetUris { get; set; }
///
/// N-4 (Session C, N4-6): allowed e-mail-verification landing URIs. Same shape as
/// but for the verify-email flow.
///
[JsonPropertyName("emailVerifyUris")]
public string[]? EmailVerifyUris { get; set; }
///
/// N-4 (Session E, N4-7): allowed change-of-e-mail confirmation landing URIs. Same
/// shape as but for the change-email flow.
///
[JsonPropertyName("changeEmailUris")]
public string[]? ChangeEmailUris { get; set; }
[JsonPropertyName("concurrencyToken")]
public string? ConcurrencyToken { get; set; }
///
/// OIDC Back-Channel Logout 1.0 §2.2 endpoint. Empty string clears the
/// existing value; null leaves it unchanged (PATCH semantics).
///
[JsonPropertyName("backchannelLogoutUri")]
public string? BackchannelLogoutUri { get; set; }
///
/// OIDC Back-Channel Logout 1.0 §2.2 — sid inclusion flag. Null leaves
/// the existing value unchanged.
///
[JsonPropertyName("backchannelLogoutSessionRequired")]
public bool? BackchannelLogoutSessionRequired { get; set; }
///
/// OAuth 2.1 §4.4 / RFC 9126 PAR mandatory flag. Null leaves the existing
/// value unchanged.
///
[JsonPropertyName("requirePushedAuthorizationRequests")]
public bool? RequirePushedAuthorizationRequests { get; set; }
///
/// RFC 7517 JWKS document attached to this client. Empty string clears the
/// stored JWKS; null leaves it unchanged.
///
[JsonPropertyName("jsonWebKeySet")]
public string? JsonWebKeySet { get; set; }
///
/// Per-client access-token lifetime in seconds. PATCH semantics: null leaves
/// unchanged, 0 (or negative) clears the override and reverts to the global
/// default, positive sets the new lifetime.
///
[JsonPropertyName("accessTokenLifetimeSeconds")]
public int? AccessTokenLifetimeSeconds { get; set; }
///
/// Per-client refresh-token lifetime in seconds. Same semantics as
/// .
///
[JsonPropertyName("refreshTokenLifetimeSeconds")]
public int? RefreshTokenLifetimeSeconds { get; set; }
///
/// Per-client id_token lifetime in seconds. Same semantics as
/// .
///
[JsonPropertyName("identityTokenLifetimeSeconds")]
public int? IdentityTokenLifetimeSeconds { get; set; }
///
/// Extra audiences appended to issued id_tokens. Null leaves the
/// existing list unchanged; an empty array clears all extra audiences
/// (the client_id default still applies).
///
[JsonPropertyName("idTokenAudiences")]
public string[]? IdTokenAudiences { get; set; }
///
/// Resource indicators for issued access_tokens (RFC 9068 aud). Null
/// leaves the existing list unchanged; an empty array clears it (scope Resources and
/// the server default still apply).
///
[JsonPropertyName("accessTokenAudiences")]
public string[]? AccessTokenAudiences { get; set; }
///
/// A.6: RFC 9101 — JWT signing alg for the request object. Empty string clears,
/// null leaves unchanged. Advisory until JAR enforcement handler ships.
///
///
/// OIDC Dynamic Client Registration 1.0 §2 request_uris: the addresses this client may pass as JAR
/// request_uri, matched exactly (whole value, fragment included). Empty array clears, null leaves unchanged.
/// With Jar.RequireRequestUriRegistration (default) a client without values cannot use request_uri.
///
[JsonPropertyName("requestUris")]
public string[]? RequestUris { get; set; }
[JsonPropertyName("requestObjectSigningAlg")]
public string? RequestObjectSigningAlg { get; set; }
/// A.6: JWE alg for the request object. Same PATCH semantics.
[JsonPropertyName("requestObjectEncryptionAlg")]
public string? RequestObjectEncryptionAlg { get; set; }
/// A.6: JWE enc for the request object. Same PATCH semantics.
[JsonPropertyName("requestObjectEncryptionEnc")]
public string? RequestObjectEncryptionEnc { get; set; }
///
/// A.7: client JWKS endpoint URL. Empty string clears, null leaves alone.
///
[JsonPropertyName("jwksUri")]
public string? JwksUri { get; set; }
///
/// A.8: RFC 9449 — per-client strict DPoP opt-in. Null leaves alone.
///
[JsonPropertyName("requireDpop")]
public bool? RequireDpop { get; set; }
/// A.10: skip RP-initiated logout consent. Null leaves alone.
[JsonPropertyName("skipLogoutConsent")]
public bool? SkipLogoutConsent { get; set; }
/// A.10: FIDO trusted flag. Null leaves alone.
[JsonPropertyName("isFidoTrusted")]
public bool? IsFidoTrusted { get; set; }
///
/// β: AllowedGroups whitelist (group names). Null leaves alone; empty array
/// clears the whitelist (any user can use the app again).
///
[JsonPropertyName("allowedGroups")]
public string[]? AllowedGroups { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Audit/AuditQueryRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Audit/AuditQueryRequest.cs
----
using redb.Identity.Contracts.Routes;
namespace redb.Identity.Contracts.Audit;
///
/// H9 (v1.0 DoD): Audit log query request for GET /api/v1/identity/audit.
/// All filter fields are optional — omitting narrows are logically ANDed.
///
public class AuditQueryRequest
{
/// Filter by exact event type (see IdentityAuditEventIds). Null = all.
public string? EventType { get; set; }
/// Filter by semantic category (authentication, admin, ...). Null = all.
public string? Category { get; set; }
/// Filter by user identifier. Null = all.
public string? UserId { get; set; }
///
/// Filter by user login. OR'd against on the server
/// — useful for per-user audit timelines where the emitting processor
/// stamped Login on the event payload but not the internal user_id
/// header. Null = all.
///
public string? Login { get; set; }
/// Filter by OAuth client identifier. Null = all.
public string? ClientId { get; set; }
/// Inclusive lower bound on event timestamp.
public DateTimeOffset? From { get; set; }
/// Exclusive upper bound on event timestamp.
public DateTimeOffset? To { get; set; }
/// Page offset (rows to skip). Must be >= 0.
public int Offset { get; set; }
/// Page size. Clamped to [1..500] server-side.
public int Count { get; set; } = 50;
}
/// A single audit row in .
public class AuditQueryItem
{
public string EventId { get; set; } = "";
public string EventType { get; set; } = "";
public string Category { get; set; } = "";
public DateTimeOffset Timestamp { get; set; }
public string? UserId { get; set; }
public string? ClientId { get; set; }
/// Subject of the access token that made a management change; null for other events and for rows written before it was recorded.
public string? ActorSubject { get; set; }
public string? Login { get; set; }
public string? IpAddress { get; set; }
public string? UserAgent { get; set; }
public Dictionary? Details { get; set; }
}
/// Paged result of .
public class AuditQueryResponse
{
public int Total { get; set; }
public int Offset { get; set; }
public int Count { get; set; }
public List Items { get; set; } = [];
}
Path: redb-identity/src/redb.Identity.Contracts/ClaimDefinitions/ClaimDefinitionResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/ClaimDefinitions/ClaimDefinitionResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.ClaimDefinitions;
///
/// S2 — admin read DTO for a claim definition. See
/// redb.Identity.Core.Models.ClaimDefinitionProps for the schema
/// rationale and the three-mechanism overview (mappers + per-user storage +
/// definitions).
///
public sealed class ClaimDefinitionResponse
{
[JsonPropertyName("id")]
public long Id { get; set; }
[JsonPropertyName("claimName")]
public string ClaimName { get; set; } = "";
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("type")]
public string Type { get; set; } = "string";
[JsonPropertyName("required")]
public bool Required { get; set; }
[JsonPropertyName("defaultValue")]
public string? DefaultValue { get; set; }
[JsonPropertyName("validationPattern")]
public string? ValidationPattern { get; set; }
[JsonPropertyName("scope")]
public string Scope { get; set; } = "global";
[JsonPropertyName("applicationId")]
public long? ApplicationId { get; set; }
[JsonPropertyName("emitOnIdToken")]
public bool EmitOnIdToken { get; set; } = true;
[JsonPropertyName("emitOnAccessToken")]
public bool EmitOnAccessToken { get; set; } = true;
[JsonPropertyName("createdAt")]
public DateTimeOffset CreatedAt { get; set; }
[JsonPropertyName("modifiedAt")]
public DateTimeOffset ModifiedAt { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/ClaimDefinitions/CreateClaimDefinitionRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/ClaimDefinitions/CreateClaimDefinitionRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.ClaimDefinitions;
///
/// S2 — admin create DTO. The (ClaimName, Scope, ApplicationId) triplet is
/// the uniqueness key; the server returns 409 on conflict.
///
public sealed class CreateClaimDefinitionRequest
{
[Required(AllowEmptyStrings = false)]
[StringLength(120, MinimumLength = 1)]
[JsonPropertyName("claimName")]
public required string ClaimName { get; set; }
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
/// "string" (default) / "int" / "long" / "bool" / "datetime" / "url" / "email".
[JsonPropertyName("type")]
public string Type { get; set; } = "string";
[JsonPropertyName("required")]
public bool Required { get; set; }
[JsonPropertyName("defaultValue")]
public string? DefaultValue { get; set; }
/// Regex pattern; ignored for non-string types.
[JsonPropertyName("validationPattern")]
public string? ValidationPattern { get; set; }
/// "global" (default) or "application".
[JsonPropertyName("scope")]
public string Scope { get; set; } = "global";
/// Required when Scope = "application"; null for global.
[JsonPropertyName("applicationId")]
public long? ApplicationId { get; set; }
[JsonPropertyName("emitOnIdToken")]
public bool EmitOnIdToken { get; set; } = true;
[JsonPropertyName("emitOnAccessToken")]
public bool EmitOnAccessToken { get; set; } = true;
}
Path: redb-identity/src/redb.Identity.Contracts/ClaimDefinitions/UpdateClaimDefinitionRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/ClaimDefinitions/UpdateClaimDefinitionRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.ClaimDefinitions;
///
/// S2 — admin update DTO. Null fields leave the existing stored value
/// unchanged (PATCH semantics). ClaimName + Scope + ApplicationId are
/// IMMUTABLE post-create — rename / re-scope = delete + re-create.
///
public sealed class UpdateClaimDefinitionRequest
{
[Required]
[JsonPropertyName("id")]
public long Id { get; set; }
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("type")]
public string? Type { get; set; }
[JsonPropertyName("required")]
public bool? Required { get; set; }
[JsonPropertyName("defaultValue")]
public string? DefaultValue { get; set; }
[JsonPropertyName("validationPattern")]
public string? ValidationPattern { get; set; }
[JsonPropertyName("emitOnIdToken")]
public bool? EmitOnIdToken { get; set; }
[JsonPropertyName("emitOnAccessToken")]
public bool? EmitOnAccessToken { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/ClaimMappers/AssignClaimScopeRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/ClaimMappers/AssignClaimScopeRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.ClaimMappers;
/// H5: Assign a Client Scope to an Application.
public sealed class AssignClaimScopeRequest
{
[Required(AllowEmptyStrings = false, ErrorMessage = "applicationId is required.")]
[JsonPropertyName("applicationId")]
public string ApplicationId { get; set; } = string.Empty;
[Required(AllowEmptyStrings = false, ErrorMessage = "scopeId is required.")]
[JsonPropertyName("scopeId")]
public string ScopeId { get; set; } = string.Empty;
}
public sealed class ClaimScopeAssignmentResponse
{
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("applicationId")]
public string ApplicationId { get; set; } = string.Empty;
[JsonPropertyName("scopeId")]
public string ScopeId { get; set; } = string.Empty;
[JsonPropertyName("scopeName")]
public string? ScopeName { get; set; }
[JsonPropertyName("assignedAt")]
public DateTimeOffset AssignedAt { get; set; }
[JsonPropertyName("assignedBy")]
public string? AssignedBy { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/ClaimMappers/ClaimMapperResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/ClaimMappers/ClaimMapperResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.ClaimMappers;
public sealed class ClaimMapperResponse
{
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("name")]
public string? Name { get; set; }
[JsonPropertyName("claimType")]
public string? ClaimType { get; set; }
[JsonPropertyName("sourceKind")]
public string? SourceKind { get; set; }
[JsonPropertyName("sourcePath")]
public string? SourcePath { get; set; }
[JsonPropertyName("constantValue")]
public string? ConstantValue { get; set; }
[JsonPropertyName("requiredScopes")]
public string[]? RequiredScopes { get; set; }
[JsonPropertyName("destinations")]
public string[]? Destinations { get; set; }
[JsonPropertyName("required")]
public bool Required { get; set; }
[JsonPropertyName("order")]
public int Order { get; set; }
[JsonPropertyName("enabled")]
public bool Enabled { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
///
/// Resolved owner: "global", "application:{id}" or "scope:{id}".
///
[JsonPropertyName("owner")]
public string Owner { get; set; } = "global";
}
Path: redb-identity/src/redb.Identity.Contracts/ClaimMappers/ClaimScopeDeletedResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/ClaimMappers/ClaimScopeDeletedResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.ClaimMappers;
/// The answer of deleting a claim scope, with what the deletion removed along with it.
public sealed class ClaimScopeDeletedResponse
{
[JsonPropertyName("success")]
public bool Success { get; init; } = true;
/// Assignments of the scope to applications, removed.
[JsonPropertyName("cascadedAssignments")]
public int CascadedAssignments { get; init; }
/// Claim mappers of the scope, removed.
[JsonPropertyName("cascadedMappers")]
public int CascadedMappers { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/ClaimMappers/ClaimScopeResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/ClaimMappers/ClaimScopeResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.ClaimMappers;
public sealed class ClaimScopeResponse
{
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("name")]
public string? Name { get; set; }
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("enabled")]
public bool Enabled { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/ClaimMappers/CreateClaimMapperRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/ClaimMappers/CreateClaimMapperRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.ClaimMappers;
///
/// H5: Create a new identity.claim_mapper PROPS row. Scope is determined by
/// : null for global; ApplicationId for per-app overlay;
/// ClaimScopeId for a Client Scope rule.
///
public sealed class CreateClaimMapperRequest
{
/// Administrator-facing label (stored in name).
[Required(AllowEmptyStrings = false, ErrorMessage = "name is required.")]
[StringLength(200, MinimumLength = 1)]
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// Claim type emitted into the token.
[Required(AllowEmptyStrings = false, ErrorMessage = "claimType is required.")]
[StringLength(200, MinimumLength = 1)]
[JsonPropertyName("claimType")]
public string ClaimType { get; set; } = string.Empty;
/// Source kind. One of: Constant, CustomClaim, UserProps.
[Required(AllowEmptyStrings = false, ErrorMessage = "sourceKind is required.")]
[JsonPropertyName("sourceKind")]
public string SourceKind { get; set; } = string.Empty;
/// Path or key into the source. Required for CustomClaim / UserProps.
[JsonPropertyName("sourcePath")]
public string? SourcePath { get; set; }
/// Constant value emitted when = Constant.
[JsonPropertyName("constantValue")]
public string? ConstantValue { get; set; }
/// Required scopes (subset) for the mapper to fire.
[JsonPropertyName("requiredScopes")]
public string[]? RequiredScopes { get; set; }
/// Token destinations: access_token, id_token. Empty defaults to both.
[JsonPropertyName("destinations")]
public string[]? Destinations { get; set; }
/// When true, missing source value rejects token issuance with invalid_request.
[JsonPropertyName("required")]
public bool Required { get; set; }
/// Application order ascending; last-write-wins by claim type.
[JsonPropertyName("order")]
public int Order { get; set; }
/// When false, mapper is loaded but skipped at apply-time.
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } = true;
/// Free-form description.
[JsonPropertyName("description")]
public string? Description { get; set; }
///
/// Owner discriminator: null = global, application:{id} per-app overlay,
/// scope:{id} for a Client Scope. The processor parses this and sets
/// parent_id accordingly.
///
[JsonPropertyName("owner")]
public string? Owner { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/ClaimMappers/CreateClaimScopeRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/ClaimMappers/CreateClaimScopeRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.ClaimMappers;
/// H5: Create a reusable Client Scope (named bundle of claim mappers).
public sealed class CreateClaimScopeRequest
{
[Required(AllowEmptyStrings = false, ErrorMessage = "name is required.")]
[StringLength(200, MinimumLength = 1)]
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } = true;
}
Path: redb-identity/src/redb.Identity.Contracts/ClaimMappers/UpdateClaimMapperRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/ClaimMappers/UpdateClaimMapperRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.ClaimMappers;
/// H5: Update an existing claim mapper. Owner / scope is immutable post-creation.
public sealed class UpdateClaimMapperRequest
{
[Required(AllowEmptyStrings = false, ErrorMessage = "id is required.")]
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("name")]
public string? Name { get; set; }
[JsonPropertyName("claimType")]
public string? ClaimType { get; set; }
[JsonPropertyName("sourceKind")]
public string? SourceKind { get; set; }
[JsonPropertyName("sourcePath")]
public string? SourcePath { get; set; }
[JsonPropertyName("constantValue")]
public string? ConstantValue { get; set; }
[JsonPropertyName("requiredScopes")]
public string[]? RequiredScopes { get; set; }
[JsonPropertyName("destinations")]
public string[]? Destinations { get; set; }
[JsonPropertyName("required")]
public bool? Required { get; set; }
[JsonPropertyName("order")]
public int? Order { get; set; }
[JsonPropertyName("enabled")]
public bool? Enabled { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/ClaimMappers/UpdateClaimScopeRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/ClaimMappers/UpdateClaimScopeRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.ClaimMappers;
public sealed class UpdateClaimScopeRequest
{
[Required(AllowEmptyStrings = false, ErrorMessage = "id is required.")]
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("enabled")]
public bool? Enabled { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Common/Base64Canonical.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Common/Base64Canonical.cs
----
using System.Diagnostics.CodeAnalysis;
namespace redb.Identity.Contracts.Common;
///
/// Base64 decoding that accepts only the canonical spelling: padded, no whitespace, and zero
/// unused bits in the last character (RFC 4648 section 3.5). .NET 10 decodes a value whose last
/// character carries non-zero unused bits, .NET 11 refuses it; decoding through this type gives
/// one answer on every runtime, and a credential or ticket has exactly one spelling.
///
internal static class Base64Canonical
{
///
/// Decodes when it is canonical base64; otherwise returns false.
///
public static bool TryDecode(string? value, [NotNullWhen(true)] out byte[]? bytes)
{
bytes = null;
if (value is null || value.Length % 4 != 0)
return false;
var buffer = new byte[value.Length / 4 * 3];
if (!Convert.TryFromBase64String(value, buffer, out var written))
return false;
var decoded = buffer.AsSpan(0, written).ToArray();
if (!string.Equals(Convert.ToBase64String(decoded), value, StringComparison.Ordinal))
return false;
bytes = decoded;
return true;
}
///
/// Decodes when it is canonical base64; otherwise throws
/// , as does for malformed input.
///
public static byte[] Decode(string value) =>
TryDecode(value, out var bytes)
? bytes
: throw new FormatException("The value is not canonical base64.");
}
Path: redb-identity/src/redb.Identity.Contracts/Common/CleanupResults.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Common/CleanupResults.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Common;
/// The answer of the MFA one-time-code cleanup: {"prunedMfaOtp":3}.
public sealed class MfaOtpPruneResult
{
[JsonPropertyName("prunedMfaOtp")]
public int PrunedMfaOtp { get; init; }
}
/// The answer of the revoked session id (sid) cleanup: {"prunedRevokedSids":3}.
public sealed class RevokedSidsPruneResult
{
[JsonPropertyName("prunedRevokedSids")]
public int PrunedRevokedSids { get; init; }
}
/// The answer of the cleanup of consumed WebAuthn challenges: {"prunedWebAuthnChallenges":3}.
public sealed class WebAuthnChallengePruneResult
{
[JsonPropertyName("prunedWebAuthnChallenges")]
public int PrunedWebAuthnChallenges { get; init; }
}
/// The answer of the cleanup of expired idempotency records: {"prunedIdempotencyRecords":3}.
public sealed class IdempotencyRecordPruneResult
{
[JsonPropertyName("prunedIdempotencyRecords")]
public int PrunedIdempotencyRecords { get; init; }
}
///
/// The answer of the idempotency record cleanup asked as a dry run: how many expired records a run would remove now,
/// with nothing removed.
///
public sealed class IdempotencyRecordPrunePreview
{
/// Always true: marks the answer as a preview.
[JsonPropertyName("dryRun")]
public bool DryRun { get; init; } = true;
/// Expired idempotency records a run would remove.
[JsonPropertyName("wouldPruneIdempotencyRecords")]
public int WouldPruneIdempotencyRecords { get; init; }
/// Records whose time to live ended before this moment are expired.
[JsonPropertyName("threshold")]
public DateTimeOffset Threshold { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Common/ErrorResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Common/ErrorResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Common;
///
/// The error document a management or account route answers with when it refuses a request:
/// {"error":"not_found","error_description":"..."}. The HTTP and gRPC facades map
/// to the status of the answer (404 for not_found, 400 for validation_error, and so on).
///
public sealed class ErrorResponse
{
/// The error code, e.g. not_found, validation_error, invalid_operation.
[JsonPropertyName("error")]
public required string Error { get; init; }
/// A text for a person, naming what was refused. Written as null when there is none.
[JsonPropertyName("error_description")]
public required string? ErrorDescription { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Common/ListRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Common/ListRequest.cs
----
namespace redb.Identity.Contracts.Common;
///
/// Pagination parameters for list operations.
///
public class ListRequest
{
public int Offset { get; set; }
public int Count { get; set; } = 20;
}
Path: redb-identity/src/redb.Identity.Contracts/Common/OneTimeSecretAttribute.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Common/OneTimeSecretAttribute.cs
----
namespace redb.Identity.Contracts.Common;
///
/// Marks a result member that carries a value the caller is shown once: a generated secret, a bearer token
/// for later calls, an enrollment secret, recovery codes. An answer in which such a member is set is not kept
/// in the idempotency cache. A repeated request with the same Idempotency-Key is not carried out
/// again and answers with instead of the secret.
///
///
/// A member counts as set when it is not null, not an empty string and not an empty collection, so a
/// type that carries the secret only on some operations (a webhook subscription, which shows its HMAC secret
/// on create and rotation only) is kept in the cache whole on the other ones.
///
[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public sealed class OneTimeSecretAttribute : Attribute
{
}
Path: redb-identity/src/redb.Identity.Contracts/Common/PagedResult.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Common/PagedResult.cs
----
namespace redb.Identity.Contracts.Common;
///
/// Paginated result wrapper.
///
public class PagedResult
{
public required List Items { get; set; }
public int Total { get; set; }
public int Offset { get; set; }
public int Count { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Common/SecretWithheldReplayResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Common/SecretWithheldReplayResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Common;
///
/// The answer to a repeated request with an Idempotency-Key whose first answer carried a one-time
/// secret (a member marked ). The operation is not carried out again and
/// the secret is not shown again: it is not kept anywhere it could be shown from. The status code is the
/// one of the first answer, and the Idempotency-Replayed: true header is set as on every replay.
/// A client that lost the first answer rotates the secret again (or, for a created resource, reads the
/// resource and rotates its secret).
///
public sealed class SecretWithheldReplayResponse
{
/// Always true: this answer replays an operation already carried out.
[JsonPropertyName("replayed")]
public bool Replayed { get; init; } = true;
/// Always true: the first answer carried a secret that is not shown again.
[JsonPropertyName("secretWithheld")]
public bool SecretWithheld { get; init; } = true;
/// What happened, for a human reading the answer.
[JsonPropertyName("description")]
public string Description { get; init; } =
"The operation was already carried out for this Idempotency-Key. Its answer carried a secret that is shown only once, so it is not shown again.";
}
Path: redb-identity/src/redb.Identity.Contracts/Common/SuccessResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Common/SuccessResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Common;
///
/// The answer of a management operation that has nothing to return but its outcome, such as a deletion:
/// {"success":true}. Operations that also end sessions or revoke consents add the count; a member
/// that does not apply is left out of the JSON, not written as null.
///
public sealed class SuccessResponse
{
/// Always true: a refusal answers with instead.
[JsonPropertyName("success")]
public bool Success { get; init; } = true;
/// Sessions of the user ended by the operation (user deletion, administrative password reset).
[JsonPropertyName("sessionsRevoked")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? SessionsRevoked { get; init; }
/// Consents revoked by the operation.
[JsonPropertyName("revoked")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Revoked { get; init; }
/// true when the thing to delete was already gone, which the self-service deletion treats as done.
[JsonPropertyName("alreadyAbsent")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? AlreadyAbsent { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Configuration/FederationProviderConfig.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Configuration/FederationProviderConfig.cs
----
namespace redb.Identity.Contracts.Configuration;
///
/// Configuration for a single federated authentication provider (OIDC, etc.).
///
public class FederationProviderConfig
{
/// Provider ID used as dictionary key in ExternalIdentities. E.g. "google", "azure-ad".
public required string ProviderId { get; set; }
///
/// H8: provider kind. "oidc" (default) uses
/// OidcFederatedAuthProvider and requires a working
/// .well-known/openid-configuration at .
/// "github" uses GitHubFederatedAuthProvider (OAuth2 + REST,
/// not OIDC). For github the field is ignored.
///
public string Kind { get; set; } = "oidc";
/// Display name shown on the login page button. E.g. "Google", "Azure AD".
public required string DisplayName { get; set; }
/// OIDC issuer / authority URI. E.g. "https://accounts.google.com". Ignored for Kind=github.
public required string Authority { get; set; }
/// OAuth2 client_id registered with the external IdP.
public required string ClientId { get; set; }
/// OAuth2 client_secret registered with the external IdP.
public required string ClientSecret { get; set; }
/// Scopes to request. Default: openid, profile, email.
public string[] Scopes { get; set; } = ["openid", "profile", "email"];
/// Create a local user on first federated login. Default: true.
public bool AutoProvision { get; set; } = true;
/// Display order on login page. Lower = shown first. Default: 100.
public int Priority { get; set; } = 100;
/// Optional claim mappings: external claim type → internal claim type.
public Dictionary? ClaimMappings { get; set; }
///
/// Optional endpoint overrides for non-OIDC OAuth2 providers (e.g. GitHub Enterprise,
/// Gitea, self-hosted mock servers for testing). When = github:
/// the provider falls back to the public github.com URLs when this is null OR
/// any individual field is unset; setting them all repoints the entire flow at a
/// custom host without touching the provider implementation. Ignored for
/// Kind=oidc (those use the OIDC discovery document at ).
///
public OAuth2EndpointOverrides? Endpoints { get; set; }
}
///
/// Per-provider override of the well-known OAuth2 endpoints used by
/// = github (and future non-OIDC OAuth2
/// kinds). When any field is null the provider falls back to its built-in default for
/// the public github.com host.
///
public sealed class OAuth2EndpointOverrides
{
/// Authorization endpoint. Default for github: https://github.com/login/oauth/authorize.
public string? AuthorizeEndpoint { get; set; }
/// Token endpoint. Default for github: https://github.com/login/oauth/access_token.
public string? TokenEndpoint { get; set; }
/// User profile endpoint. Default for github: https://api.github.com/user.
public string? UserEndpoint { get; set; }
/// User emails endpoint (only used when profile email is private). Default for github: https://api.github.com/user/emails.
public string? EmailsEndpoint { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Configuration/IdentityCookieOptions.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Configuration/IdentityCookieOptions.cs
----
namespace redb.Identity.Contracts.Configuration;
///
/// SameSite cookie modes per RFC 6265bis. None requires Secure.
///
public enum CookieSameSiteMode
{
/// Strictest: cookie not sent on any cross-site request, even top-level navigation.
Strict,
/// Default for most identity flows: sent on top-level GET cross-site navigations
/// (needed for OAuth/OIDC redirects) but not on background sub-resource requests.
Lax,
/// Sent on all requests including third-party. Requires Secure.
None
}
///
/// C9 — cookie security defaults shared by every cookie Identity emits.
///
public sealed class IdentityCookieOptions
{
///
/// When true, applies the __Host- name prefix to identity cookies
/// (which forces Secure, Path=/, no Domain). When the
/// surrounding scheme is not https, the helper falls back to the bare name
/// to avoid emitting an invalid cookie that browsers would silently drop.
/// Default: false for backward compatibility — flipping it to true
/// invalidates all existing session cookies (forces re-login). Recommended
/// for new production deployments.
///
public bool UseHostPrefix { get; set; } = false;
///
/// SameSite mode for the main session cookie. Lax (default) is required
/// for cross-site OAuth / federation top-level redirects to carry the session.
/// Strict blocks those — set only if Identity is the sole entry point.
///
public CookieSameSiteMode SessionSameSite { get; set; } = CookieSameSiteMode.Lax;
///
/// SameSite mode for the per-flow federation browser-binding cookie. Must be
/// Lax (default) so the cookie returns with the IdP's callback redirect.
/// Strict would prevent the binding check from ever succeeding.
///
public CookieSameSiteMode BindingSameSite { get; set; } = CookieSameSiteMode.Lax;
///
/// Name of the encrypted session cookie. Default: redb.identity.session.
/// When is enabled and the request is over https,
/// the effective name becomes __Host-{value}.
///
public string SessionCookieName { get; set; } = "redb.identity.session";
}
Path: redb-identity/src/redb.Identity.Contracts/Configuration/IdentityFeatureFlags.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Configuration/IdentityFeatureFlags.cs
----
namespace redb.Identity.Contracts.Configuration;
///
/// Cross-module feature toggles for the Identity product surface.
///
/// Lives in redb.Identity.Contracts so that both redb.Identity.Core
/// (which gates DI registration, OpenIddict configuration, and direct-vm://
/// route registration on these flags) and redb.Identity.Http (which gates
/// HTTP endpoint mounting on the same flags) read from a single shared contract.
///
///
/// Configuration source: a single section Identity:Features:* in
/// context.json. Both module binders (IdentityModuleConfigBinder and
/// IdentityHttpConfigBinder) bind their own IOptions<IdentityFeatureFlags>
/// instance from the same path, so a flag set once is observed identically by both
/// modules — eliminating the previous Core/Http duplication smell.
///
///
/// Architectural invariant: installed ⇔ exposed. If a feature is enabled the
/// Core registers everything required to serve it (DI services, direct-vm routes,
/// OpenIddict capabilities) AND the Http facade mounts the corresponding endpoints.
/// This avoids the broken state where Core ran without HTTP exposure (or vice versa)
/// because the two flag families had drifted.
///
///
public sealed class IdentityFeatureFlags
{
///
/// SCIM 2.0 provisioning surface (RFC 7643/7644). When true:
/// Core registers SCIM mapper services + direct-vm://identity-scim-* routes;
/// Http mounts /scim/v2/Users and /scim/v2/Groups. Default: false.
///
public bool EnableScim { get; set; }
///
/// SCIM /Bulk endpoint (RFC 7644 §3.7). Has no effect unless
/// is also true. When true: Core registers the
/// bulk dispatcher direct-vm route; Http mounts /scim/v2/Bulk. Default: false.
///
public bool EnableScimBulk { get; set; }
///
/// External federated identity providers (Google / Microsoft / Keycloak / GitHub etc).
/// When true AND at least one provider is configured: Core advertises
/// acr_values_supported in discovery + registers federation handlers;
/// Http mounts the federation login + callback routes. Default: false.
///
public bool EnableFederation { get; set; }
///
/// OAuth 2.0 Dynamic Client Registration (RFC 7591) and management protocol (RFC 7592).
/// When true: Core registers DCR services + direct-vm://identity-dcr-*
/// routes; Http mounts /connect/register + per-client management endpoints.
/// Default: false.
///
public bool EnableDynamicRegistration { get; set; }
///
/// OAuth 2.0 Pushed Authorization Requests (RFC 9126). When true: Core enables
/// the OpenIddict PAR pipeline + direct-vm://identity-par; Http mounts
/// /connect/par. Default: false.
///
public bool EnablePushedAuthorization { get; set; }
///
/// OAuth 2.0 Device Authorization Grant (RFC 8628). When true: Core configures
/// OpenIddict to allow the device flow + registers the device-code direct-vm routes;
/// Http mounts /connect/deviceauthorization and /connect/device/verify.
/// Default: false.
///
public bool EnableDeviceCodeFlow { get; set; }
///
/// JWT-Secured Authorization Request — JAR (RFC 9101). When true, /connect/authorize
/// accepts a signed request object carrying the authorization parameters, verifies it
/// against the client's published keys, and uses the parameters from inside the JWT.
/// Default: false — the request parameter is rejected with request_not_supported,
/// which is the behaviour of every release before this flag existed.
///
/// Unsigned request objects (alg: none) are never accepted, flag or not: a request object
/// without a signature drops exactly the integrity guarantee JAR exists to provide. FAPI 2.0
/// forbids them as well.
///
///
public bool EnableJar { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Configuration/IdentityScopes.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Configuration/IdentityScopes.cs
----
namespace redb.Identity.Contracts.Configuration;
///
/// Central registry of OAuth scopes recognised by the management API.
///
///
/// Scope strings encode resource:action directly — RFC 6749 §3.3 stays the
/// transport, but each scope identifies WHICH admin surface it grants access to
/// and AT WHICH level (read vs write). Operators see a tree-shaped picker on
/// /admin/roles/{id} by parsing the colon; the token claim remains a flat
/// space-separated string, fully compatible with every OIDC consumer.
///
///
///
/// Action semantics (Option B — preview.1):
///
/// - :read — GET on the resource's collection / item.
/// - :write — POST / PUT / PATCH / DELETE. Includes DELETE on
/// purpose; granting "manage" semantics with two levels (read / write)
/// keeps the catalogue compact while still meaningfully separating
/// audit-reader machines from mutation-capable ones.
///
///
///
///
/// Authorisation precedence at the management gate (GranularScopeGuardProcessor):
///
/// - Token holds : pass (master admin).
/// - Token holds and path is /me/*: pass.
/// - Token holds and method is GET-class: pass.
/// - Token holds the resource's :read for GET, or :write
/// for mutations: pass.
/// - Otherwise: 403 insufficient_scope.
///
///
///
public static class IdentityScopes
{
// ── Universal scopes ──────────────────────────────────────────────────
/// Full administrative access — short-circuits the granular gate.
public const string Manage = "identity:manage";
/// Self-service — token may only target the owning user's /me/* endpoints.
public const string Account = "identity:account";
/// Read-only admin — GETs across every management endpoint succeed; mutations rejected.
public const string ReadOnly = "identity:read";
// ── Resource × action (read / write) ──────────────────────────────────
//
// Naming: 'identity::'. Resources are the noun the URL
// segment shows (/users → users, /federation-providers → federation, etc.);
// actions are 'read' (GET) and 'write' (everything else).
public const string UsersRead = "identity:users:read";
public const string UsersWrite = "identity:users:write";
public const string GroupsRead = "identity:groups:read";
public const string GroupsWrite = "identity:groups:write";
public const string ConsentsRead = "identity:consents:read";
public const string ConsentsWrite = "identity:consents:write";
public const string MfaRead = "identity:mfa:read";
public const string MfaWrite = "identity:mfa:write";
public const string ApplicationsRead = "identity:applications:read";
public const string ApplicationsWrite = "identity:applications:write";
public const string ScopesRead = "identity:scopes:read";
public const string ScopesWrite = "identity:scopes:write";
public const string RolesRead = "identity:roles:read";
public const string RolesWrite = "identity:roles:write";
/// Covers claim-mappers + claim-definitions + claim-scopes (the entire claims surface).
public const string ClaimsRead = "identity:claims:read";
public const string ClaimsWrite = "identity:claims:write";
public const string FederationRead = "identity:federation:read";
public const string FederationWrite = "identity:federation:write";
public const string WebhooksRead = "identity:webhooks:read";
public const string WebhooksWrite = "identity:webhooks:write";
public const string SigningKeysRead = "identity:signing-keys:read";
/// Includes the rotate operation — rotation is a write.
public const string SigningKeysWrite = "identity:signing-keys:write";
/// Read sessions (incl. across users) — backs the admin sessions browse.
public const string SessionsRead = "identity:sessions:read";
/// Revoke sessions and the revoked-sid list — revoke is a write.
public const string SessionsWrite = "identity:sessions:write";
/// Read OAuth tokens (admin browse / introspect).
public const string TokensRead = "identity:tokens:read";
/// Revoke / prune tokens.
public const string TokensWrite = "identity:tokens:write";
/// Read access to the audit log.
public const string AuditRead = "identity:audit:read";
/// Impersonate-as endpoint (RFC 8693 token exchange with act claim).
public const string Impersonate = "identity:impersonate";
// ── Composite arrays ──────────────────────────────────────────────────
/// Every scope registered by the identity server. OpenIddict
/// server.RegisterScopes(...) seed source.
public static readonly string[] All =
{
Manage, Account, ReadOnly,
UsersRead, UsersWrite,
GroupsRead, GroupsWrite,
ConsentsRead, ConsentsWrite,
MfaRead, MfaWrite,
ApplicationsRead, ApplicationsWrite,
ScopesRead, ScopesWrite,
RolesRead, RolesWrite,
ClaimsRead, ClaimsWrite,
FederationRead, FederationWrite,
WebhooksRead, WebhooksWrite,
SigningKeysRead, SigningKeysWrite,
SessionsRead, SessionsWrite,
TokensRead, TokensWrite,
AuditRead,
Impersonate,
};
/// Granular admin scopes (everything except /
/// ). The bearer-auth processor's any-of acceptable set.
public static readonly string[] GranularAdmin =
{
ReadOnly,
UsersRead, UsersWrite,
GroupsRead, GroupsWrite,
ConsentsRead, ConsentsWrite,
MfaRead, MfaWrite,
ApplicationsRead, ApplicationsWrite,
ScopesRead, ScopesWrite,
RolesRead, RolesWrite,
ClaimsRead, ClaimsWrite,
FederationRead, FederationWrite,
WebhooksRead, WebhooksWrite,
SigningKeysRead, SigningKeysWrite,
SessionsRead, SessionsWrite,
TokensRead, TokensWrite,
AuditRead,
Impersonate,
};
}
Path: redb-identity/src/redb.Identity.Contracts/Configuration/IdentitySharedOptions.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Configuration/IdentitySharedOptions.cs
----
namespace redb.Identity.Contracts.Configuration;
///
/// Cross-module shared options for the Identity product surface.
///
/// Lives in redb.Identity.Contracts so that both
/// -aware
/// modules — redb.Identity.Core (which gates DI registration, OpenIddict
/// configuration, and direct-vm:// route registration on shared values)
/// and redb.Identity.Http (which formats discovery URIs, drives cookie
/// Secure detection, and gates HTTP endpoint mounting) — read from a
/// single shared contract.
///
///
/// Configuration source: a single section Identity:* in context.json.
/// Both module binders (IdentityModuleConfigBinder and
/// IdentityHttpConfigBinder) bind their own
/// IOptions<IdentitySharedOptions> from the same path, so a value
/// set once is observed identically by both modules — eliminating the
/// Core/Http duplication smell for both and
/// in one shared root.
///
///
/// Both RedbIdentityOptions.Shared (Core) and
/// IdentityTransportOptions.Shared (Http) reference an instance of this
/// type; in-process test fixtures that need exact alignment can simply assign
/// transportOptions.Shared = identityOptions.Shared instead of mirroring
/// individual properties one by one.
///
///
public sealed class IdentitySharedOptions
{
///
/// Issuer URI for the identity server. Used by Core for OpenIddict
/// SetIssuer + id_token validation, and by Http for
/// discovery-document URL formatting (issuer, registration_endpoint, etc.)
/// + cookie Secure flag detection (https ⇒ Secure cookies).
/// Required for production; defaults to https://localhost/.
///
public System.Uri Issuer { get; set; } = new("https://localhost/");
///
/// Cross-module feature toggles. Single source of truth for both Core
/// (DI registration, OpenIddict configuration, direct-vm route
/// registration) and Http (HTTP endpoint mounting). Bound from the
/// Identity:Features:* section of context.json.
///
public IdentityFeatureFlags Features { get; set; } = new();
}
Path: redb-identity/src/redb.Identity.Contracts/Consents/ConsentRequiredResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Consents/ConsentRequiredResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Consents;
///
/// Machine-readable counterpart of the consent_required 302 redirect from
/// /connect/authorize. Returned with HTTP 400 + error=consent_required
/// when the caller signals X-Identity-Delegate-Consent: 1 on the authorize
/// request. Lets BFFs render a native consent UI instead of bouncing the browser
/// to the host's HTML fallback page.
///
public sealed class ConsentRequiredResponse
{
/// Standard OAuth error code — always consent_required for this DTO.
[JsonPropertyName("error")]
public string Error { get; set; } = "consent_required";
/// OAuth client_id of the relying application.
[JsonPropertyName("clientId")]
public string ClientId { get; set; } = "";
/// Human-readable application name for the consent dialog.
[JsonPropertyName("appName")]
public string AppName { get; set; } = "";
/// Scope identifiers the application is requesting.
[JsonPropertyName("scopes")]
public string[] Scopes { get; set; } = Array.Empty();
/// Subject (numeric user id as string) of the currently signed-in user.
[JsonPropertyName("userId")]
public string UserId { get; set; } = "";
/// Original authorize URL to resume after the user grants consent.
[JsonPropertyName("returnUrl")]
public string ReturnUrl { get; set; } = "";
}
Path: redb-identity/src/redb.Identity.Contracts/Consents/ConsentResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Consents/ConsentResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Consents;
///
/// Consent grant record returned by the management API.
///
public sealed class ConsentResponse
{
[JsonPropertyName("id")]
public long Id { get; set; }
[JsonPropertyName("userId")]
public long UserId { get; set; }
[JsonPropertyName("applicationId")]
public long ApplicationId { get; set; }
[JsonPropertyName("clientId")]
public string? ClientId { get; set; }
[JsonPropertyName("applicationName")]
public string? ApplicationName { get; set; }
[JsonPropertyName("scopes")]
public string[]? Scopes { get; set; }
[JsonPropertyName("status")]
public string? Status { get; set; }
[JsonPropertyName("createdAt")]
public DateTimeOffset CreatedAt { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Consents/GrantMyConsentRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Consents/GrantMyConsentRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Consents;
///
/// Self-service consent grant request for POST /me/consents. The caller's
/// user id is taken from the access-token subject — it is never accepted from the
/// request body. must be the exact set the user is approving
/// for the given client; the underlying ConsentService.GrantAsync performs a
/// union with any pre-existing valid permanent grant.
///
public sealed class GrantMyConsentRequest
{
/// OAuth client_id of the application receiving consent.
[Required]
public required string ClientId { get; set; }
/// Scope identifiers (e.g. openid, profile, email).
[Required]
public required string[] Scopes { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Consents/MeRevokeConsentRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Consents/MeRevokeConsentRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Consents;
///
/// Self-service consent revoke request for DELETE /me/consents/{clientId}.
/// Targets ALL consent grants for the given client_id owned by the caller.
///
public class MeRevokeConsentRequest
{
[Required]
public required string ClientId { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Consents/MyConsentResponses.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Consents/MyConsentResponses.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Consents;
/// The answer of granting a consent through the self-service API.
public sealed class MyConsentGrantedResponse
{
/// The authorization the consent is stored as.
[JsonPropertyName("id")]
public long Id { get; init; }
[JsonPropertyName("userId")]
public long UserId { get; init; }
[JsonPropertyName("clientId")]
public string? ClientId { get; init; }
[JsonPropertyName("applicationId")]
public long ApplicationId { get; init; }
[JsonPropertyName("scopes")]
public required string[] Scopes { get; init; }
}
/// The answer of revoking a consent through the self-service API: {"revoked":1}.
public sealed class MyConsentRevokedResponse
{
[JsonPropertyName("revoked")]
public int Revoked { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Cors/CorsCheckMessages.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Cors/CorsCheckMessages.cs
----
namespace redb.Identity.Contracts.Cors;
///
/// Phase 9d cross-context request DTO for direct-vm://identity-cors-check.
/// HTTP transport facade asks Core «is this browser Origin allowed for CORS?».
/// Carried as on the
/// wire so the Route message body stays JSON-friendly.
///
public sealed class CorsCheckRequest
{
/// Browser-supplied Origin request header value (raw, unnormalised).
public string? Origin { get; set; }
}
///
/// Reply DTO for direct-vm://identity-cors-check.
///
public sealed class CorsCheckResponse
{
/// True when matches a registered client.
public bool Allowed { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Cors/IRegisteredClientOriginRegistry.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Cors/IRegisteredClientOriginRegistry.cs
----
using System.Collections.Immutable;
namespace redb.Identity.Contracts.Cors;
///
/// In-memory registry of allowed CORS origins derived from registered OAuth clients'
/// RedirectUris and PostLogoutRedirectUris. This is the runtime data source
/// used by the HTTP transport's per-route CORS resolver to authorise browser-initiated
/// requests to OIDC endpoints (token, userinfo, revocation, ...).
///
/// The registry is invalidation-driven, not TTL-driven: management operations
/// (Create/Update/Delete on applications) call
/// to mark the snapshot stale, and the next read repopulates from the underlying store.
/// There is no background refresh.
///
///
/// Origins are normalised to {scheme}://{host}[:{port}]. URIs whose authority cannot
/// be parsed are silently skipped — they are management-API validation failures, not CORS
/// failures.
///
///
/// Lives in redb.Identity.Contracts so that transport facades (HTTP, gRPC, ...) can
/// consume it without taking a compile-time reference to the Core implementation assembly.
///
///
public interface IRegisteredClientOriginRegistry
{
///
/// Returns true if matches at least one registered client's
/// redirect or post-logout URI authority. Comparison is case-insensitive on host/scheme;
/// port and path components must match the URI exactly as registered.
///
/// The browser-supplied Origin request header value.
ValueTask IsAllowedAsync(string? origin, CancellationToken ct = default);
///
/// Returns the current snapshot of allowed origins. Useful for diagnostics and tests.
/// Triggers a refresh if the registry has been invalidated.
///
ValueTask> GetAllowedOriginsAsync(CancellationToken ct = default);
///
/// Marks the cached snapshot stale. The next call to will
/// rebuild from the underlying source. Cheap and idempotent; safe to call from
/// management-API processors after every mutation.
///
void Invalidate();
}
Path: redb-identity/src/redb.Identity.Contracts/Endpoints/BootstrapAdminMessages.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Endpoints/BootstrapAdminMessages.cs
----
using redb.Identity.Contracts.Common;
namespace redb.Identity.Contracts.Endpoints;
///
/// B1 — request DTO for POST /internal/bootstrap-admin
/// (direct-vm://identity-bootstrap-admin).
///
/// One-shot endpoint that atomically creates the very first admin user, the
/// identity-admins group, the identity:admin scope, the
/// canonical identity-web OIDC client and the
/// SystemFlag(name=bootstrap_completed) sentinel that gates further
/// invocations. Subsequent calls return 410 Gone.
///
///
/// Authenticated by an out-of-band shared secret in the
/// X-Bootstrap-Secret header (compared with
/// ).
///
///
public sealed class BootstrapAdminRequest
{
/// Login / email of the admin user to create. Required.
public string? Email { get; set; }
///
/// Initial password. Required. Must satisfy
/// .
/// The created user is flagged RequiresPasswordChange=true so a
/// password rotation is forced on first interactive login.
///
public string? Password { get; set; }
///
/// Group name to create / find and add the new admin to. When null,
/// defaults to
/// (identity-admins).
///
public string? GroupName { get; set; }
/// OIDC redirect_uri for the admin Web Console. Required.
public string? RedirectUri { get; set; }
/// OIDC post_logout_redirect_uri for the admin Web Console. Required.
public string? PostLogoutRedirectUri { get; set; }
///
/// OIDC Back-Channel Logout endpoint of the Web Console. Stored as a
/// custom backchannel_logout_uri property on the application
/// (OpenID Connect Back-Channel Logout 1.0 §2.2).
///
public string? BackchannelLogoutUri { get; set; }
}
///
/// B1 — reply DTO for POST /internal/bootstrap-admin.
///
/// is returned once and only once — in plain
/// text on the very first successful invocation. After that the secret is
/// only stored as a hash inside OpenIddict and cannot be recovered.
///
///
public sealed class BootstrapAdminResponse
{
/// PROPS id of the freshly-created admin user.
public long UserId { get; set; }
/// PROPS id of the freshly-created (or found) admin group.
public long GroupId { get; set; }
/// OIDC client_id of the canonical admin Web Console (identity-web).
public string ApplicationId { get; set; } = string.Empty;
///
/// OIDC client_secret in plain — copy this out of the response and
/// store it in your secret manager. The server only retains a hash.
///
[OneTimeSecret]
public string ClientSecret { get; set; } = string.Empty;
/// OAuth scope created / granted to the admin (identity:admin).
public string ScopeName { get; set; } = string.Empty;
}
Path: redb-identity/src/redb.Identity.Contracts/Endpoints/PostLogoutRedirectMessages.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Endpoints/PostLogoutRedirectMessages.cs
----
namespace redb.Identity.Contracts.Endpoints;
///
/// Phase 9d cross-context request DTO for direct-vm://identity-validate-post-logout.
/// HTTP /connect/logout processor needs to ensure an unauthenticated logout request
/// (no id_token_hint, expired session) does not redirect to an arbitrary URL — open-redirect
/// protection per RFC 8414 §4. Core scans OpenIddictApplications.PostLogoutRedirectUris
/// for any registered URI matching the supplied value.
///
public sealed class ValidatePostLogoutRedirectRequest
{
/// The post_logout_redirect_uri to validate. Null/empty returns false.
public string? RedirectUri { get; set; }
}
///
/// Reply DTO for direct-vm://identity-validate-post-logout.
///
public sealed class ValidatePostLogoutRedirectResponse
{
/// True when at least one registered application has the URI as a post-logout target.
public bool Allowed { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Events/IdentityEvent.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Events/IdentityEvent.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Events;
///
/// Base identity event — all events carry these fields.
///
public class IdentityEvent
{
[JsonPropertyName("eventId")]
public string EventId { get; set; } = Guid.NewGuid().ToString("N");
[JsonPropertyName("eventType")]
public string EventType { get; set; } = string.Empty;
[JsonPropertyName("timestamp")]
public DateTimeOffset Timestamp { get; set; } = DateTimeOffset.UtcNow;
[JsonPropertyName("userId")]
public string? UserId { get; set; }
[JsonPropertyName("clientId")]
public string? ClientId { get; set; }
///
/// Subject of the access token that made a management change: the client id for a client-credentials token,
/// the user's public subject for a user token. Null for events not made through the management API.
///
[JsonPropertyName("actorSubject")]
public string? ActorSubject { get; set; }
[JsonPropertyName("ipAddress")]
public string? IpAddress { get; set; }
[JsonPropertyName("userAgent")]
public string? UserAgent { get; set; }
[JsonPropertyName("details")]
public Dictionary? Details { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Federation/FederatedIdentitiesContracts.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Federation/FederatedIdentitiesContracts.cs
----
namespace redb.Identity.Contracts.Federation;
///
/// H8 (DoD §4 gap (b)): one entry returned by GET /me/federated-identities.
///
public sealed class FederatedIdentityResponse
{
/// Provider id (e.g. google).
public required string ProviderId { get; init; }
/// External subject reported by the IdP. May be useful to the user (e.g.
/// to identify which Google account is linked when they have several).
public required string ExternalSub { get; init; }
/// Email associated with the external identity at the time of the most recent
/// successful login through this link, if the IdP exposed it.
public string? ExternalEmail { get; init; }
/// Display name from the external IdP (e.g. Jane Doe), if available.
public string? ExternalDisplayName { get; init; }
/// UTC timestamp when the link was first established.
public required DateTimeOffset LinkedAt { get; init; }
/// UTC timestamp of the last successful login through this link.
public DateTimeOffset? LastLoginAt { get; init; }
}
///
/// H8 (DoD §4 gap (b)): self-service request to start a "link this provider to my
/// existing account" flow. Returns a redirect URL the front-end opens in a browser
/// window. The callback (sharing the same /federation/callback URI) interprets the
/// embedded encrypted state's LinkUserId and links instead of logging in.
///
public sealed class LinkFederatedIdentityRequest
{
/// Provider id to start the link flow for. Must match a registered provider.
public required string ProviderId { get; init; }
/// Optional return URL to redirect the user to after the link succeeds.
public string? ReturnUrl { get; init; }
}
/// H8: response from POST /me/federated-identities/link-challenge.
public sealed class LinkFederatedIdentityChallengeResponse
{
/// The URL the front-end must navigate to in order to start the OIDC dance.
public required string RedirectUri { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Federation/FederatedIdentityUnlinkedResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Federation/FederatedIdentityUnlinkedResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Federation;
/// The answer of unlinking an external identity from the caller's account.
public sealed class FederatedIdentityUnlinkedResponse
{
[JsonPropertyName("unlinked")]
public bool Unlinked { get; init; } = true;
[JsonPropertyName("providerId")]
public required string ProviderId { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Federation/FederationProviderContracts.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Federation/FederationProviderContracts.cs
----
using System.ComponentModel.DataAnnotations;
using redb.Identity.Contracts.Common;
namespace redb.Identity.Contracts.Federation;
///
/// H8 (DoD §4 gap (e)): admin-API DTO for an PROPS-stored federation provider config.
/// is write-only — the API never returns the plaintext, only
/// . To rotate, send a new ; to clear,
/// send the empty string.
///
public sealed class FederationProviderResponse
{
public required string Id { get; init; }
public required string ProviderId { get; init; }
public required string Kind { get; init; }
public required string DisplayName { get; init; }
public string? Authority { get; init; }
public required string ClientId { get; init; }
/// True iff a non-empty encrypted client secret is stored at rest.
public bool HasSecret { get; init; }
public required IReadOnlyList Scopes { get; init; }
public bool AutoProvision { get; init; }
public bool Enabled { get; init; }
public int Priority { get; init; }
public Dictionary? ClaimMappings { get; init; }
}
public sealed class CreateFederationProviderRequest
{
[Required, RegularExpression("^[a-z0-9][a-z0-9_-]*$",
ErrorMessage = "ProviderId must be lowercase, start with letter/digit, and contain only [a-z0-9_-].")]
public required string ProviderId { get; init; }
[Required, RegularExpression("^(oidc|github)$",
ErrorMessage = "Kind must be one of: oidc | github.")]
public required string Kind { get; init; }
[Required, StringLength(200, MinimumLength = 1)]
public required string DisplayName { get; init; }
[Url]
public string? Authority { get; init; }
[Required, StringLength(200, MinimumLength = 1)]
public required string ClientId { get; init; }
///
/// OAuth2 client_secret. Encrypted at rest via DataProtection. Write-only. Null or the empty string = no secret;
/// a value of white space only is refused (validation_error).
///
public string? ClientSecret { get; init; }
public string[]? Scopes { get; init; }
public bool AutoProvision { get; init; } = true;
public bool Enabled { get; init; } = true;
public int Priority { get; init; } = 100;
public Dictionary? ClaimMappings { get; init; }
}
public sealed class UpdateFederationProviderRequest
{
[Required] public string Id { get; set; } = string.Empty;
public string? Kind { get; init; }
public string? DisplayName { get; init; }
public string? Authority { get; init; }
public string? ClientId { get; init; }
///
/// Send a new value to rotate, or empty string to clear. Null = leave unchanged. A value of white space only is
/// refused (validation_error).
///
public string? ClientSecret { get; init; }
public string[]? Scopes { get; init; }
public bool? AutoProvision { get; init; }
public bool? Enabled { get; init; }
public int? Priority { get; init; }
public Dictionary? ClaimMappings { get; init; }
}
///
/// Public projection of a federation provider safe for unauthenticated callers (login
/// pages, third-party UIs). Carries only the fields needed to render a sign-in button —
/// never ClientSecret, Authority, ClaimMappings, or any other
/// secret/configuration detail.
///
/// Stable identifier echoed back to /connect/external-login?provider=.
/// Human-readable label, e.g. "Google".
/// Provider kind: oidc or github. Allows callers to pick brand-specific icons.
/// Display order. Lower = shown first.
public sealed record PublicFederationProviderDescriptor(
string ProviderId,
string DisplayName,
string Kind,
int Priority);
Path: redb-identity/src/redb.Identity.Contracts/Groups/AddMemberRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/AddMemberRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
public sealed class AddMemberRequest
{
[Range(1, long.MaxValue, ErrorMessage = "userId must be a positive integer.")]
[JsonPropertyName("userId")]
public long UserId { get; set; }
[JsonPropertyName("role")]
public string? Role { get; set; }
[JsonPropertyName("expiresAt")]
public DateTimeOffset? ExpiresAt { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/CreateGroupRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/CreateGroupRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
public sealed class CreateGroupRequest
{
[Required(AllowEmptyStrings = false, ErrorMessage = "name is required.")]
[StringLength(200, MinimumLength = 1)]
[JsonPropertyName("name")]
public string Name { get; set; } = null!;
[JsonPropertyName("groupType")]
public string? GroupType { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("parentGroupId")]
public long? ParentGroupId { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/GroupChangedResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/GroupChangedResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
/// The answer of a group update or deletion: {"success":true,"groupId":42}.
public sealed class GroupChangedResponse
{
[JsonPropertyName("success")]
public bool Success { get; init; } = true;
[JsonPropertyName("groupId")]
public long GroupId { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/GroupMemberAddedResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/GroupMemberAddedResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
/// The answer of adding a user to a group, with the id of the new membership.
public sealed class GroupMemberAddedResponse
{
[JsonPropertyName("success")]
public bool Success { get; init; } = true;
[JsonPropertyName("membershipId")]
public long MembershipId { get; init; }
[JsonPropertyName("groupId")]
public long GroupId { get; init; }
[JsonPropertyName("userId")]
public long UserId { get; init; }
[JsonPropertyName("role")]
public required string Role { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/GroupMemberChangedResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/GroupMemberChangedResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
/// The answer of changing a member's role in a group.
public sealed class GroupMemberChangedResponse
{
[JsonPropertyName("success")]
public bool Success { get; init; } = true;
[JsonPropertyName("groupId")]
public long GroupId { get; init; }
[JsonPropertyName("userId")]
public long UserId { get; init; }
[JsonPropertyName("role")]
public required string Role { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/GroupMemberRemovedResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/GroupMemberRemovedResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
/// The answer of removing a user from a group.
public sealed class GroupMemberRemovedResponse
{
[JsonPropertyName("success")]
public bool Success { get; init; } = true;
[JsonPropertyName("groupId")]
public long GroupId { get; init; }
[JsonPropertyName("userId")]
public long UserId { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/GroupMembershipCheckResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/GroupMembershipCheckResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
/// The answer of GET groups/{id}/members/{userId}/check.
public sealed class GroupMembershipCheckResponse
{
[JsonPropertyName("isMember")]
public bool IsMember { get; init; }
[JsonPropertyName("groupId")]
public long GroupId { get; init; }
[JsonPropertyName("userId")]
public long UserId { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/GroupMovedResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/GroupMovedResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
/// The answer of moving a group under another parent.
public sealed class GroupMovedResponse
{
[JsonPropertyName("success")]
public bool Success { get; init; } = true;
[JsonPropertyName("groupId")]
public long GroupId { get; init; }
[JsonPropertyName("newParentGroupId")]
public long NewParentGroupId { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/GroupResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/GroupResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
///
/// A group as the management API answers it. The members are declared in the order they are written.
///
public sealed class GroupResponse
{
[JsonPropertyName("id")]
public long Id { get; set; }
[JsonPropertyName("name")]
public string? Name { get; set; }
[JsonPropertyName("parentId")]
public long? ParentId { get; set; }
[JsonPropertyName("groupType")]
public string? GroupType { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("createdAt")]
public DateTimeOffset? CreatedAt { get; set; }
[JsonPropertyName("modifiedAt")]
public DateTimeOffset? ModifiedAt { get; set; }
///
/// B.2 — populated by the list-page search response with the count of
/// direct memberships, drives the per-row badge. Left out of the JSON when not requested.
///
[JsonPropertyName("memberCount")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? MemberCount { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/GroupTreeNodeResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/GroupTreeNodeResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
/// A group with its subtree: the answer of GET groups/{id}/tree.
public sealed class GroupTreeNodeResponse
{
[JsonPropertyName("id")]
public long Id { get; init; }
[JsonPropertyName("name")]
public string? Name { get; init; }
[JsonPropertyName("parentId")]
public long? ParentId { get; init; }
[JsonPropertyName("groupType")]
public string? GroupType { get; init; }
[JsonPropertyName("description")]
public string? Description { get; init; }
/// Depth below the root the tree was read from.
[JsonPropertyName("level")]
public int Level { get; init; }
[JsonPropertyName("children")]
public List Children { get; init; } = new();
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/MemberResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/MemberResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
public sealed class MemberResponse
{
[JsonPropertyName("membershipId")]
public long MembershipId { get; set; }
[JsonPropertyName("userId")]
public long UserId { get; set; }
[JsonPropertyName("groupId")]
public long GroupId { get; set; }
[JsonPropertyName("role")]
public string? Role { get; set; }
[JsonPropertyName("joinedAt")]
public DateTimeOffset? JoinedAt { get; set; }
[JsonPropertyName("expiresAt")]
public DateTimeOffset? ExpiresAt { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/MoveGroupRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/MoveGroupRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
public sealed class MoveGroupRequest
{
[Range(1, long.MaxValue, ErrorMessage = "newParentGroupId must be a positive integer.")]
[JsonPropertyName("newParentGroupId")]
public long NewParentGroupId { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/UpdateGroupRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/UpdateGroupRequest.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
public sealed class UpdateGroupRequest
{
[JsonPropertyName("name")]
public string? Name { get; set; }
[JsonPropertyName("groupType")]
public string? GroupType { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Groups/UpdateMemberRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Groups/UpdateMemberRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Groups;
public sealed class UpdateMemberRequest
{
[Required(AllowEmptyStrings = false, ErrorMessage = "role is required.")]
[JsonPropertyName("role")]
public string Role { get; set; } = null!;
}
Path: redb-identity/src/redb.Identity.Contracts/IdentityVerdict.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/IdentityVerdict.cs
----
using System.Globalization;
namespace redb.Identity.Contracts;
///
/// What the identity core decided about a request, said once in a form no transport owns.
///
/// Every facade has to answer the same question — was this refused, and why — in its own vocabulary:
/// HTTP with a status code, gRPC with a status, SOAP with a fault. The vocabularies cannot be shared;
/// the reading can, and it is the reading that kept being copied. Each facade maps
/// onto its own names with a switch of a few lines, and nothing else.
///
///
public enum IdentityVerdictKind
{
/// The request succeeded.
Ok,
/// The request is malformed, or asks for something that makes no sense.
BadRequest,
/// The caller could not be authenticated, or the credentials presented were refused.
Unauthenticated,
/// The caller is known but not allowed to do this.
Forbidden,
/// The thing addressed does not exist.
NotFound,
/// The operation is not supported here.
Unsupported,
/// The change conflicts with what already exists.
Conflict,
/// A precondition the caller stated does not hold.
PreconditionFailed,
/// The caller is sending too much, too fast, and should come back later.
RateLimited,
/// The scope asked for is not one this caller may have.
InvalidScope,
/// We are temporarily unable to serve this.
Unavailable,
/// The deadline passed before an answer was ready.
Timeout,
/// Our side failed.
ServerError,
///
/// Something was refused, and nothing in the answer says what kind of refusal it was. Kept distinct
/// from on purpose: claiming our own failure for an outcome we cannot read
/// is a guess, and a caller acts differently on «we broke» than on «we do not know».
///
Unknown,
}
///
/// Reads the identity core's verdict out of an answer.
///
/// Core states its verdict as an HTTP status code on redbHttp.ResponseCode, on every transport,
/// because that is the vocabulary its own processors speak. The OAuth error value in the body is
/// the second source and the weaker one: it is defined by RFC 6749, and Core answers plenty of things
/// that RFC never named. rate_limited is the standing example — read from the error string alone
/// it falls through to «bad request», which tells a caller to fix their request when what they must do
/// is wait.
///
///
/// This type holds no route, no exchange and no transport type on purpose: redb.Identity.Contracts
/// is dependency-free, and a facade passes in the two values it already has.
///
///
public static class IdentityVerdict
{
/// Header Core states its verdict on, the same on every transport.
public const string ResponseCodeHeader = "redbHttp.ResponseCode";
/// Header carrying how long to wait before retrying a rate-limited call.
public const string RetryAfterHeader = "Retry-After";
///
/// Parses a redbHttp.ResponseCode header value. Returns null when the header is absent or is
/// not a number, which are the same thing to a caller: Core stated nothing.
///
public static int? ParseResponseCode(object? rawHeaderValue)
{
var text = rawHeaderValue?.ToString();
if (string.IsNullOrWhiteSpace(text)) return null;
return int.TryParse(text, NumberStyles.Integer, CultureInfo.InvariantCulture, out var code)
? code
: null;
}
///
/// The verdict for a request, given what the answer carried. The status code wins where there is
/// one; the OAuth error is consulted only when Core stated no code.
///
/// Value of , already parsed, or null.
/// The error value from the answer body, or null.
public static IdentityVerdictKind Resolve(int? responseCode, string? oauthError)
{
if (responseCode is { } code)
{
var fromCode = FromStatusCode(code);
// A 2xx alongside an error document is contradictory, and the error document is the one that
// says a refusal happened. Falling through to the error keeps such an answer a refusal
// instead of a success carrying an explanation nobody reads.
if (fromCode != IdentityVerdictKind.Ok || string.IsNullOrEmpty(oauthError))
return fromCode;
}
return string.IsNullOrEmpty(oauthError)
? IdentityVerdictKind.Ok
: FromOAuthError(oauthError!);
}
/// The verdict an HTTP status code states.
public static IdentityVerdictKind FromStatusCode(int code) => code switch
{
>= 200 and <= 299 => IdentityVerdictKind.Ok,
400 or 422 => IdentityVerdictKind.BadRequest,
401 => IdentityVerdictKind.Unauthenticated,
403 => IdentityVerdictKind.Forbidden,
404 => IdentityVerdictKind.NotFound,
405 or 501 => IdentityVerdictKind.Unsupported,
409 => IdentityVerdictKind.Conflict,
412 or 428 => IdentityVerdictKind.PreconditionFailed,
429 => IdentityVerdictKind.RateLimited,
503 => IdentityVerdictKind.Unavailable,
504 => IdentityVerdictKind.Timeout,
>= 500 => IdentityVerdictKind.ServerError,
// A code outside every band above says a refusal happened and nothing more. Reading it as a bad
// request would tell the caller to fix something we never claimed was wrong.
_ => IdentityVerdictKind.Unknown,
};
///
/// The verdict an OAuth error value states, per RFC 6749 §5.2 and RFC 6750 §3.1.
///
/// This is the reading the HTTP and gRPC facades already applied, moved here rather than rewritten:
/// the point of this type is that the three transports agree, and «agree» means on what shipped, not
/// on a fresh opinion. RFC 6749 answers most of these with 400, so anything not named below is a
/// defect in the request — the reading that keeps an unknown error visible instead of reporting it
/// as our own failure.
///
///
/// This path runs only when Core stated no status code. Where Core did state one it is the code that
/// decides, and that is what keeps rate_limited — a value no RFC names — from reading as a
/// malformed request.
///
///
public static IdentityVerdictKind FromOAuthError(string error) => error switch
{
"" => IdentityVerdictKind.Ok,
"invalid_client" or "invalid_token" => IdentityVerdictKind.Unauthenticated,
"access_denied" or "unauthorized_client" => IdentityVerdictKind.Forbidden,
// Named separately from the generic bad request because WS-Trust has a fault for exactly this
// and would otherwise lose it. Transports without one render it as they render a bad request,
// which is what they did before this type existed.
"invalid_scope" or "insufficient_scope" => IdentityVerdictKind.InvalidScope,
"server_error" => IdentityVerdictKind.ServerError,
"temporarily_unavailable" => IdentityVerdictKind.Unavailable,
_ => IdentityVerdictKind.BadRequest,
};
/// Whether this verdict means the request was refused.
public static bool IsRefusal(this IdentityVerdictKind kind) => kind != IdentityVerdictKind.Ok;
}
Path: redb-identity/src/redb.Identity.Contracts/Mfa/IMfaStateInspector.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Mfa/IMfaStateInspector.cs
----
namespace redb.Identity.Contracts.Mfa;
///
/// Minimal read-only surface over the encrypted MFA challenge state for transport facades
/// (HTTP, gRPC, …) that need to render UI dependent on which MFA methods the user has
/// configured, without taking a project-reference on Core's full MfaStateProtector
/// + MfaState POCO (which carries 50+ fields including WebAuthn challenges that
/// belong to Core's domain).
///
/// Implemented by Core (MfaStateProtector) and registered in DI alongside the
/// concrete protector. HTTP UI processors lookup this interface only.
///
///
public interface IMfaStateInspector
{
///
/// Decrypts the supplied protected MFA-state token and returns the configured MFA
/// method identifiers (for example "totp", "sms", "email") that
/// the user can present at the verification step. Returns null when the token
/// is missing, tampered, expired, or otherwise undecryptable — callers should treat
/// that as "no methods known" and fall back to a default UI.
///
/// Base64-encoded DataProtection-protected state token.
/// Method identifiers, or null on any failure.
string[]? TryGetMethods(string? protectedState);
}
Path: redb-identity/src/redb.Identity.Contracts/Mfa/MfaManagementResponses.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Mfa/MfaManagementResponses.cs
----
using System.Collections.Generic;
using System.Text.Json.Serialization;
using redb.Identity.Contracts.Common;
namespace redb.Identity.Contracts.Mfa;
/// The MFA state of a user, answered by the management MFA status operation.
public sealed class MfaStatusResponse
{
[JsonPropertyName("enabled")]
public required bool Enabled { get; init; }
/// Ids of the enrolled methods, e.g. totp.
[JsonPropertyName("methods")]
public required string[] Methods { get; init; }
[JsonPropertyName("recovery_codes_remaining")]
public required int RecoveryCodesRemaining { get; init; }
}
///
/// The answer of starting an MFA enrollment. It carries what the user needs to finish it, shown this once:
/// the TOTP secret and its otpauth:// URI, and the setup token the confirm call sends back. A method
/// may add its own members (the masked destination of an e-mail or SMS method).
///
public sealed class MfaSetupResponse
{
[JsonPropertyName("method")]
public required string Method { get; init; }
/// TOTP: the base32 shared secret; null for the other methods.
[OneTimeSecret]
[JsonPropertyName("secret_base32")]
public string? SecretBase32 { get; init; }
/// TOTP: the otpauth:// URI for a QR code; it contains the secret.
[OneTimeSecret]
[JsonPropertyName("qr_uri")]
public string? QrUri { get; init; }
/// Opaque encrypted token the confirm call must send back with the first code.
[OneTimeSecret]
[JsonPropertyName("setup_token")]
public string? SetupToken { get; init; }
/// Members a method adds, written after the others, e.g. masked_email.
[JsonExtensionData]
public Dictionary? Extra { get; init; }
}
/// The answer of confirming an MFA enrollment: the recovery codes, shown this once.
public sealed class MfaConfirmedResponse
{
/// Always true: a wrong code answers with instead.
[JsonPropertyName("confirmed")]
public bool Confirmed { get; } = true;
[OneTimeSecret]
[JsonPropertyName("recovery_codes")]
public required string[] RecoveryCodes { get; init; }
}
/// The answer of disabling an MFA method.
public sealed class MfaDisabledResponse
{
/// Always true.
[JsonPropertyName("disabled")]
public bool Disabled { get; } = true;
}
/// The answer of regenerating the recovery codes: the new codes, shown this once.
public sealed class MfaRecoveryCodesResponse
{
[OneTimeSecret]
[JsonPropertyName("recovery_codes")]
public required string[] RecoveryCodes { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Mfa/MfaMethodsFromStateMessages.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Mfa/MfaMethodsFromStateMessages.cs
----
namespace redb.Identity.Contracts.Mfa;
///
/// Phase 9d cross-context request DTO for direct-vm://identity-mfa-methods-from-state.
/// HTTP UI renders the verification page; it must show which MFA methods (TOTP / SMS /
/// email) the user has configured. The configured-method list is embedded in the
/// encrypted mfa_state token issued by LoginProcessor; Core decrypts it
/// here so the HTTP transport never needs the DataProtection key-ring at compile time
/// (only at runtime for cookies, via the shared redb.Identity.DataProtection ring).
///
public sealed class MfaMethodsFromStateRequest
{
/// Encrypted mfa_state token (base64). Null/empty returns empty methods.
public string? MfaState { get; set; }
}
///
/// Reply DTO for direct-vm://identity-mfa-methods-from-state.
///
public sealed class MfaMethodsFromStateResponse
{
/// True when the token decrypted successfully and is not expired.
public bool Success { get; set; }
/// Configured method identifiers (subset of "totp", "sms", "email").
public string[] Methods { get; set; } = Array.Empty();
}
Path: redb-identity/src/redb.Identity.Contracts/Mfa/WebAuthnResponses.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Mfa/WebAuthnResponses.cs
----
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using redb.Identity.Contracts.Common;
namespace redb.Identity.Contracts.Mfa;
/// The WebAuthn state of the caller, answered by the self-service WebAuthn status operation.
public sealed class WebAuthnStatusResponse
{
/// true when the caller has at least one registered credential.
[JsonPropertyName("enabled")]
public required bool Enabled { get; init; }
/// The number of registered credentials.
[JsonPropertyName("credentials_count")]
public required int CredentialsCount { get; init; }
}
/// The start of a WebAuthn registration: the creation options for the browser and the setup token.
public sealed class WebAuthnRegistrationOptionsResponse
{
/// The PublicKeyCredentialCreationOptions to pass to navigator.credentials.create.
[JsonPropertyName("options")]
public required JsonElement Options { get; init; }
/// The opaque setup token to send back with the attestation.
[JsonPropertyName("setup_token")]
[OneTimeSecret]
public required string SetupToken { get; init; }
}
/// A completed WebAuthn registration.
public sealed class WebAuthnRegisteredResponse
{
/// Always true.
[JsonPropertyName("registered")]
public bool Registered { get; } = true;
/// The key of the new credential.
[JsonPropertyName("credential_key")]
public required string CredentialKey { get; init; }
/// Fresh recovery codes when this registration enabled MFA, otherwise empty.
[JsonPropertyName("recovery_codes")]
[OneTimeSecret]
public required string[] RecoveryCodes { get; init; }
}
/// The caller's registered WebAuthn credentials.
public sealed class WebAuthnCredentialList
{
/// The credentials, in registration order.
[JsonPropertyName("credentials")]
public required List Credentials { get; init; }
}
/// One registered WebAuthn credential.
public sealed class WebAuthnCredentialResponse
{
/// The credential key, used to rename or delete it.
[JsonPropertyName("key")]
public required string Key { get; init; }
/// The name the user gave it.
[JsonPropertyName("display_name")]
public string? DisplayName { get; init; }
/// The authenticator model identifier.
[JsonPropertyName("aaguid")]
public string? Aaguid { get; init; }
/// When it was registered.
[JsonPropertyName("registered_at")]
public required DateTimeOffset RegisteredAt { get; init; }
/// When it was last used to sign in.
[JsonPropertyName("last_used_at")]
public DateTimeOffset? LastUsedAt { get; init; }
/// Whether the authenticator verified the user at registration.
[JsonPropertyName("user_verified")]
public required bool UserVerified { get; init; }
/// Whether the credential may be backed up (a synced passkey).
[JsonPropertyName("backup_eligible")]
public required bool BackupEligible { get; init; }
/// Whether the credential is backed up.
[JsonPropertyName("backup_state")]
public required bool BackupState { get; init; }
}
/// A renamed WebAuthn credential.
public sealed class WebAuthnRenamedResponse
{
/// Always true.
[JsonPropertyName("renamed")]
public bool Renamed { get; } = true;
}
/// A deleted WebAuthn credential.
public sealed class WebAuthnDeletedResponse
{
/// Always true.
[JsonPropertyName("deleted")]
public bool Deleted { get; } = true;
}
Path: redb-identity/src/redb.Identity.Contracts/Protos/identity.management.v1.proto
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Protos/identity.management.v1.proto
----
// redb.Identity — management gRPC contract.
//
// The admin surface, for tooling rather than for relying parties. It sits on its own port
// (`ManagementPort`), behind bearer authentication and the same granular scope table the HTTP management
// API is checked against — one table in Core, so the same token yields the same verdict on both.
//
// Shape rule, and it differs from identity.v1.proto on purpose. There the messages are the RFC's own
// fields, fixed by standards that do not move. Here there are 159 operations over an admin surface that
// still grows, and typing every request and response would freeze it: every new field would be a contract
// change in a file consumers have to regenerate. So the *addresses* are the contract — one rpc per
// operation, named and stable — and the payloads are `google.protobuf.Struct` / `Value`, which carry
// arbitrary JSON while remaining real protobuf on the wire. A generated client works; the payload is
// documented by the REST API of the same name.
//
// Requests are always an object of named arguments. The names are the controller parameter names, the
// same ones the REST route and query parameters use — `id`, `offset`, `count` — and a body-shaped
// argument is simply the object itself.
syntax = "proto3";
package identity.management.v1;
option csharp_namespace = "redb.Identity.Grpc.Management.V1";
import "google/protobuf/struct.proto";
// ── shared envelopes ─────────────────────────────────────
message ManagementRequest {
// Named arguments for the operation. An operation that takes a request body puts that body's fields
// here directly; one that takes an id puts `id` here. Unknown keys are ignored.
google.protobuf.Struct arguments = 1;
}
message ManagementResponse {
// Whatever the operation returned: an object, a list, or nothing at all. `Value` rather than `Struct`
// because list endpoints answer with arrays and a Struct cannot hold one.
google.protobuf.Value result = 1;
}
// ── users ────────────────────────────────────────────────
service Users {
rpc List (ManagementRequest) returns (ManagementResponse);
rpc Search (ManagementRequest) returns (ManagementResponse);
rpc Get (ManagementRequest) returns (ManagementResponse);
rpc Create (ManagementRequest) returns (ManagementResponse);
rpc Update (ManagementRequest) returns (ManagementResponse);
rpc Delete (ManagementRequest) returns (ManagementResponse);
rpc ChangePassword (ManagementRequest) returns (ManagementResponse);
rpc AdminResetPassword (ManagementRequest) returns (ManagementResponse);
}
// ── applications ─────────────────────────────────────────
service Applications {
rpc List (ManagementRequest) returns (ManagementResponse);
rpc Get (ManagementRequest) returns (ManagementResponse);
rpc Create (ManagementRequest) returns (ManagementResponse);
rpc Update (ManagementRequest) returns (ManagementResponse);
rpc RotateSecret (ManagementRequest) returns (ManagementResponse);
rpc Delete (ManagementRequest) returns (ManagementResponse);
}
// ── groups ───────────────────────────────────────────────
service Groups {
rpc List (ManagementRequest) returns (ManagementResponse);
rpc Search (ManagementRequest) returns (ManagementResponse);
rpc Get (ManagementRequest) returns (ManagementResponse);
rpc Create (ManagementRequest) returns (ManagementResponse);
rpc CreateChild (ManagementRequest) returns (ManagementResponse);
rpc Update (ManagementRequest) returns (ManagementResponse);
rpc Delete (ManagementRequest) returns (ManagementResponse);
rpc Move (ManagementRequest) returns (ManagementResponse);
// Hierarchy reads. The group tree is the one place this API is not flat.
rpc Tree (ManagementRequest) returns (ManagementResponse);
rpc Path (ManagementRequest) returns (ManagementResponse);
rpc Children (ManagementRequest) returns (ManagementResponse);
// Membership.
rpc ListMembers (ManagementRequest) returns (ManagementResponse);
rpc AddMember (ManagementRequest) returns (ManagementResponse);
rpc UpdateMember (ManagementRequest) returns (ManagementResponse);
rpc RemoveMember (ManagementRequest) returns (ManagementResponse);
rpc UserGroups (ManagementRequest) returns (ManagementResponse);
rpc IsMember (ManagementRequest) returns (ManagementResponse);
}
// ── scopes ───────────────────────────────────────────────
service Scopes {
rpc List (ManagementRequest) returns (ManagementResponse);
rpc Get (ManagementRequest) returns (ManagementResponse);
rpc Create (ManagementRequest) returns (ManagementResponse);
rpc Update (ManagementRequest) returns (ManagementResponse);
rpc Delete (ManagementRequest) returns (ManagementResponse);
}
// ── tokens ───────────────────────────────────────────────
service Tokens {
rpc List (ManagementRequest) returns (ManagementResponse);
rpc Revoke (ManagementRequest) returns (ManagementResponse);
rpc RevokeBySubject (ManagementRequest) returns (ManagementResponse);
rpc Prune (ManagementRequest) returns (ManagementResponse);
}
Path: redb-identity/src/redb.Identity.Contracts/Protos/identity.v1.proto
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Protos/identity.v1.proto
----
// redb.Identity — service-to-service gRPC contract.
//
// Scope: the non-browser subset of OpenID Connect / OAuth 2.0. Browser flows (authorize, login, consent,
// MFA pages, device verification) are not here and never will be — they need a browser, redirects and a
// cookie session. DPoP (RFC 9449) is likewise absent: its proof is bound to an HTTP method and URL.
//
// This file is the published contract. It lives in redb.Identity.Contracts so consumers can take it
// without referencing any server-side package, and it is deliberately NOT compiled into that assembly —
// Contracts stays a dependency-free DTO package. Generate your own stubs from this file; the facade
// compiles it privately for its own message types.
//
// Shape rule: every request carries the parameters RFC 6749 / 7009 / 7662 / OIDC Core define as named
// fields, plus a string map for extensions. The wire form of these endpoints has always been
// form-encoded key/value, so a map is not a shortcut — it is the protocol. Responses type the fields the
// RFCs fix and carry everything else in a Struct, because userinfo claims and introspection extensions
// are open by design.
syntax = "proto3";
package identity.v1;
option csharp_namespace = "redb.Identity.Grpc.V1";
import "google/protobuf/struct.proto";
service Identity {
// RFC 6749 §3.2 — token endpoint. Client authentication is client_id/client_secret, either as fields
// here or as `authorization: Basic` metadata.
rpc Token (TokenRequest) returns (TokenResponse);
// RFC 7662 — token introspection.
rpc Introspect (IntrospectRequest) returns (IntrospectResponse);
// RFC 7009 — token revocation. A successful revocation carries no payload, per the RFC.
rpc Revoke (RevokeRequest) returns (RevokeResponse);
// OIDC Core §5.3 — userinfo. Bearer token in `authorization` metadata or in the field below.
rpc UserInfo (UserInfoRequest) returns (UserInfoResponse);
// OIDC Discovery 1.0. The document advertises the server's HTTP addresses — those are the real ones,
// and this facade does not rewrite them.
rpc Discovery (DiscoveryRequest) returns (DiscoveryResponse);
// The JSON Web Key Set backing token signatures.
rpc Jwks (JwksRequest) returns (JwksResponse);
}
// ── token ────────────────────────────────────────────────
message TokenRequest {
string grant_type = 1;
string client_id = 2;
string client_secret = 3;
string scope = 4;
// authorization_code
string code = 5;
string redirect_uri = 6;
string code_verifier = 7;
// refresh_token
string refresh_token = 8;
// password (ROPC)
string username = 9;
string password = 10;
// urn:ietf:params:oauth:grant-type:device_code
string device_code = 11;
// Any parameter this contract does not name — extension grants, vendor parameters, future RFCs.
map additional = 20;
}
message TokenResponse {
string access_token = 1;
string token_type = 2;
int64 expires_in = 3;
string refresh_token = 4;
string id_token = 5;
string scope = 6;
// Anything the server returned beyond the fields above.
google.protobuf.Struct extra = 20;
}
// ── introspection ────────────────────────────────────────
message IntrospectRequest {
string token = 1;
string token_type_hint = 2;
string client_id = 3;
string client_secret = 4;
map additional = 20;
}
message IntrospectResponse {
bool active = 1;
string scope = 2;
string client_id = 3;
string username = 4;
string token_type = 5;
int64 exp = 6;
int64 iat = 7;
int64 nbf = 8;
string sub = 9;
repeated string aud = 10;
string iss = 11;
string jti = 12;
// RFC 7662 §2.2 explicitly allows additional members.
google.protobuf.Struct extra = 20;
}
// ── revocation ───────────────────────────────────────────
message RevokeRequest {
string token = 1;
string token_type_hint = 2;
string client_id = 3;
string client_secret = 4;
map additional = 20;
}
// RFC 7009 §2.2: a successful revocation returns no content. Kept as a message because gRPC has no void.
message RevokeResponse {}
// ── userinfo ─────────────────────────────────────────────
message UserInfoRequest {
// Optional: the token normally travels as `authorization: Bearer ` metadata. This field exists
// for callers that prefer to carry it in the message, mirroring RFC 6750 §2.2.
string access_token = 1;
}
message UserInfoResponse {
string sub = 1;
// Every other claim. Which ones appear depends on the granted scopes and the server's claim mappers,
// so typing them here would be a lie.
google.protobuf.Struct claims = 20;
}
// ── discovery / jwks ─────────────────────────────────────
message DiscoveryRequest {}
message DiscoveryResponse {
// The discovery document verbatim, including the HTTP endpoint URLs it advertises.
google.protobuf.Struct document = 1;
}
message JwksRequest {}
message JwksResponse {
// The JWKS document verbatim: { "keys": [ … ] }.
google.protobuf.Struct document = 1;
}
Path: redb-identity/src/redb.Identity.Contracts/Registration/DynamicRegistrationRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Registration/DynamicRegistrationRequest.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Registration;
///
/// RFC 7591 §2 Client Metadata for Dynamic Client Registration.
///
public sealed class DynamicRegistrationRequest
{
[JsonPropertyName("redirect_uris")]
public string[]? RedirectUris { get; set; }
[JsonPropertyName("token_endpoint_auth_method")]
public string? TokenEndpointAuthMethod { get; set; }
[JsonPropertyName("grant_types")]
public string[]? GrantTypes { get; set; }
[JsonPropertyName("response_types")]
public string[]? ResponseTypes { get; set; }
[JsonPropertyName("client_name")]
public string? ClientName { get; set; }
[JsonPropertyName("client_uri")]
public string? ClientUri { get; set; }
[JsonPropertyName("logo_uri")]
public string? LogoUri { get; set; }
[JsonPropertyName("scope")]
public string? Scope { get; set; }
[JsonPropertyName("contacts")]
public string[]? Contacts { get; set; }
[JsonPropertyName("software_id")]
public string? SoftwareId { get; set; }
[JsonPropertyName("software_version")]
public string? SoftwareVersion { get; set; }
[JsonPropertyName("application_type")]
public string? ApplicationType { get; set; }
[JsonPropertyName("post_logout_redirect_uris")]
public string[]? PostLogoutRedirectUris { get; set; }
///
/// RFC 7591 §2 — JSON Web Key Set carrying the client's public keys for
/// private_key_jwt client authentication (RFC 7523). Required when
/// is private_key_jwt and
/// is not provided. Stored verbatim and consulted
/// when verifying the client assertion (RFC 7523) and request objects (RFC 9101). Accepted for every
/// ; must not be sent together with .
///
[JsonPropertyName("jwks")]
public System.Text.Json.JsonElement? JsonWebKeySet { get; set; }
///
/// RFC 7591 §2 — URL referencing the client's JSON Web Key Set. The server
/// MUST NOT host both jwks and jwks_uri. The keys published there are fetched and
/// cached (ClientKeys.CacheLifetime, ClientKeys.MinimumRefreshInterval) to verify client assertions
/// and request objects. Accepted for every .
///
[JsonPropertyName("jwks_uri")]
public string? JsonWebKeySetUri { get; set; }
///
/// OIDC Back-Channel Logout 1.0 §2.2 — absolute HTTPS (or http for
/// localhost/dev) URL the server POSTs the signed logout_token to
/// when the user's session is terminated. Stored as a custom property
/// (backchannel_logout_uri) on the registered application.
///
[JsonPropertyName("backchannel_logout_uri")]
public string? BackchannelLogoutUri { get; set; }
///
/// OIDC Back-Channel Logout 1.0 §2.2 — when true the dispatched
/// logout_token includes a sid claim. Defaults to true when
/// is set.
///
[JsonPropertyName("backchannel_logout_session_required")]
public bool? BackchannelLogoutSessionRequired { get; set; }
///
/// RFC 9126 §5 — opt this client into per-client PAR enforcement: any direct
/// /connect/authorize request without a request_uri issued by
/// /connect/par will be rejected with invalid_request. Layers
/// independently on top of the global RequirePushedAuthorizationRequests
/// server flag so a single client can demand PAR even if other clients don't.
///
[JsonPropertyName("require_pushed_authorization_requests")]
public bool? RequirePushedAuthorizationRequests { get; set; }
///
/// N-4 (Session C) — RFC 7591 §2 client_metadata extension:
/// allowed password-reset landing URIs. The caller-supplied callerResetUrl
/// on POST /api/v1/identity/password/forgot must exactly match one of these
/// (string compare, no normalization). null/empty disables password recovery
/// for this client. Use a list (not a single URI) so multi-environment BFFs can
/// register dev / staging / prod pages on the same client.
///
[JsonPropertyName("password_reset_uris")]
public string[]? PasswordResetUris { get; set; }
///
/// N-4 (Session C, N4-6) — RFC 7591 §2 client_metadata extension:
/// allowed e-mail-verification landing URIs. Same shape and matching rules as
/// .
///
[JsonPropertyName("email_verify_uris")]
public string[]? EmailVerifyUris { get; set; }
///
/// N-4 (Session E, N4-7) — RFC 7591 §2 client_metadata extension:
/// allowed change-of-e-mail confirmation landing URIs. Same shape and matching
/// rules as .
///
[JsonPropertyName("change_email_uris")]
public string[]? ChangeEmailUris { get; set; }
///
/// OIDC Dynamic Client Registration 1.0 §2 request_uris: the addresses this client may pass as JAR
/// request_uri, matched exactly (whole value, fragment included).
///
[JsonPropertyName("request_uris")]
public string[]? RequestUris { get; set; }
///
/// OIDC Dynamic Client Registration 1.0 §2 request_object_signing_alg: the algorithm this client signs
/// request objects with. One of the server's request_object_signing_alg_values_supported.
///
[JsonPropertyName("request_object_signing_alg")]
public string? RequestObjectSigningAlg { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Registration/DynamicRegistrationResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Registration/DynamicRegistrationResponse.cs
----
using System.Text.Json.Serialization;
using redb.Identity.Contracts.Common;
namespace redb.Identity.Contracts.Registration;
///
/// RFC 7591 §3.2.1 Client Information Response for Dynamic Client Registration.
///
public sealed class DynamicRegistrationResponse
{
[JsonPropertyName("client_id")]
public string ClientId { get; set; } = default!;
[OneTimeSecret]
[JsonPropertyName("client_secret")]
public string? ClientSecret { get; set; }
[JsonPropertyName("client_secret_expires_at")]
public long? ClientSecretExpiresAt { get; set; }
[JsonPropertyName("client_id_issued_at")]
public long? ClientIdIssuedAt { get; set; }
[JsonPropertyName("redirect_uris")]
public string[]? RedirectUris { get; set; }
[JsonPropertyName("token_endpoint_auth_method")]
public string? TokenEndpointAuthMethod { get; set; }
[JsonPropertyName("grant_types")]
public string[]? GrantTypes { get; set; }
[JsonPropertyName("response_types")]
public string[]? ResponseTypes { get; set; }
[JsonPropertyName("client_name")]
public string? ClientName { get; set; }
[JsonPropertyName("client_uri")]
public string? ClientUri { get; set; }
[JsonPropertyName("logo_uri")]
public string? LogoUri { get; set; }
[JsonPropertyName("scope")]
public string? Scope { get; set; }
[JsonPropertyName("contacts")]
public string[]? Contacts { get; set; }
[JsonPropertyName("software_id")]
public string? SoftwareId { get; set; }
[JsonPropertyName("software_version")]
public string? SoftwareVersion { get; set; }
[JsonPropertyName("application_type")]
public string? ApplicationType { get; set; }
[JsonPropertyName("post_logout_redirect_uris")]
public string[]? PostLogoutRedirectUris { get; set; }
/// RFC 7591 §3.2.1 — the inline JWKS as stored for this client.
[JsonPropertyName("jwks")]
public System.Text.Json.JsonElement? JsonWebKeySet { get; set; }
/// RFC 7591 §3.2.1 — the jwks_uri as stored for this client; its keys verify client assertions and request objects.
[JsonPropertyName("jwks_uri")]
public string? JsonWebKeySetUri { get; set; }
/// RFC 7592 §3: one-time bearer token granting access to the client configuration endpoint.
[OneTimeSecret]
[JsonPropertyName("registration_access_token")]
public string? RegistrationAccessToken { get; set; }
/// RFC 7592 §3: absolute URL of the client configuration endpoint for this client.
[JsonPropertyName("registration_client_uri")]
public string? RegistrationClientUri { get; set; }
/// RFC 9126 §5 — echoed per-client PAR-enforcement flag.
[JsonPropertyName("require_pushed_authorization_requests")]
public bool? RequirePushedAuthorizationRequests { get; set; }
/// N-4 (Session C) — echoed per-client password-reset URL whitelist.
[JsonPropertyName("password_reset_uris")]
public string[]? PasswordResetUris { get; set; }
/// N-4 (Session C, N4-6) — echoed per-client verify-email URL whitelist.
[JsonPropertyName("email_verify_uris")]
public string[]? EmailVerifyUris { get; set; }
/// N-4 (Session E, N4-7) — echoed per-client change-email URL whitelist.
[JsonPropertyName("change_email_uris")]
public string[]? ChangeEmailUris { get; set; }
/// OIDC Dynamic Client Registration 1.0 §2 request_uris, as stored.
[JsonPropertyName("request_uris")]
public string[]? RequestUris { get; set; }
///
/// OIDC Dynamic Client Registration 1.0 §2 request_object_signing_alg: the algorithm this client signs
/// request objects with. One of the server's request_object_signing_alg_values_supported.
///
[JsonPropertyName("request_object_signing_alg")]
public string? RequestObjectSigningAlg { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Roles/CreateRoleRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Roles/CreateRoleRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Roles;
public sealed class CreateRoleRequest
{
[Required(AllowEmptyStrings = false)]
[StringLength(60, MinimumLength = 1)]
[JsonPropertyName("name")]
public required string Name { get; set; }
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
/// "organization" (default) or "application".
[JsonPropertyName("audience")]
public string Audience { get; set; } = "organization";
/// Required when Audience='application'. Null for organization.
[JsonPropertyName("applicationId")]
public long? ApplicationId { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Roles/RoleAssignmentResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Roles/RoleAssignmentResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Roles;
///
/// B.3 — a single assignment row, surfaces both directions:
/// * "for role X, who has it?" — list assignees with kind='user'/'group';
/// * "what roles does user/group Y have?" — list roles with role + audience.
///
public sealed class RoleAssignmentResponse
{
[JsonPropertyName("roleId")]
public long RoleId { get; set; }
[JsonPropertyName("roleName")]
public string RoleName { get; set; } = "";
[JsonPropertyName("audience")]
public string Audience { get; set; } = "organization";
[JsonPropertyName("applicationId")]
public long? ApplicationId { get; set; }
/// "user" or "group".
[JsonPropertyName("subjectKind")]
public string SubjectKind { get; set; } = "user";
[JsonPropertyName("subjectId")]
public long SubjectId { get; set; }
[JsonPropertyName("subjectLabel")]
public string? SubjectLabel { get; set; }
[JsonPropertyName("assignedAt")]
public DateTimeOffset AssignedAt { get; set; }
[JsonPropertyName("assignedByUserId")]
public long? AssignedByUserId { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Roles/RoleResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Roles/RoleResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Roles;
public sealed class RoleResponse
{
[JsonPropertyName("id")]
public long Id { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; } = "";
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
/// "organization" or "application".
[JsonPropertyName("audience")]
public string Audience { get; set; } = "organization";
[JsonPropertyName("applicationId")]
public long? ApplicationId { get; set; }
[JsonPropertyName("applicationName")]
public string? ApplicationName { get; set; }
[JsonPropertyName("isSystem")]
public bool IsSystem { get; set; }
[JsonPropertyName("createdAt")]
public DateTimeOffset? CreatedAt { get; set; }
[JsonPropertyName("modifiedAt")]
public DateTimeOffset? ModifiedAt { get; set; }
///
/// B.3 list page — count of total assignments (users + groups). Null
/// when the response was returned by a non-list path.
///
[JsonPropertyName("assignmentCount")]
public int? AssignmentCount { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Roles/RoleScopeResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Roles/RoleScopeResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Roles;
///
/// One attached scope on a role's permission tab.
///
public sealed class RoleScopeResponse
{
[JsonPropertyName("roleId")]
public long RoleId { get; set; }
[JsonPropertyName("scopeId")]
public long ScopeId { get; set; }
[JsonPropertyName("scopeName")]
public string? ScopeName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("attachedAt")]
public DateTimeOffset AttachedAt { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Roles/UpdateRoleRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Roles/UpdateRoleRequest.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Roles;
///
/// Null fields preserve the existing value (PATCH semantics). Name +
/// Audience + ApplicationId are IMMUTABLE post-create — rename = delete +
/// re-create. IsSystem is server-managed.
///
public sealed class UpdateRoleRequest
{
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Routes/IdentityAuditEventIds.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Routes/IdentityAuditEventIds.cs
----
namespace redb.Identity.Contracts.Routes;
///
/// H9 (v1.0 DoD): Centralized audit event catalog.
///
/// Single source of truth for every identity-event-type emitted anywhere in the
/// redb.Identity pipeline. All processors emitting exchange.Properties["identity-event-type"]
/// MUST use a constant from this class — never a magic string.
///
///
/// resolves the semantic bucket stored in
/// the identity_audit_log.category column. Unknown event types resolve to
/// so forward-compatible custom events still land in storage.
///
///
public static class IdentityAuditEventIds
{
// ── authentication ──
public const string UserLoggedIn = "UserLoggedIn";
public const string UserLoggedOut = "UserLoggedOut";
public const string LoginFailed = "LoginFailed";
public const string PasswordChanged = "PasswordChanged";
/// N-4 (Session C): password-recovery initiation. Always emitted, even when
/// the e-mail does not resolve to a user (anti-enumeration). Payload carries the
/// supplied e-mail (hashed) so abuse can be traced without disclosing victim identity.
public const string PasswordResetRequested = "PasswordResetRequested";
/// N-4 (Session C): a single-use reset token was issued AND e-mail dispatched
/// (i.e. the request resolved to a real user with a whitelisted reset URL).
public const string PasswordResetTokenIssued = "PasswordResetTokenIssued";
/// N-4 (Session C): password-recovery completed successfully — token consumed,
/// new password persisted, sessions revoked.
public const string PasswordResetCompleted = "PasswordResetCompleted";
/// N-4 (Session C): password-recovery attempt failed (bad / expired / consumed
/// token, or policy violation). Used for guessing-attack telemetry.
public const string PasswordResetFailed = "PasswordResetFailed";
/// N-4 (Session C, N4-6): e-mail verification link was issued and dispatched
/// to the user's inbox. Payload carries UserId, ClientId, Jti, target e-mail (lowercase).
public const string EmailVerificationSent = "EmailVerificationSent";
/// N-4 (Session C, N4-6): user confirmed e-mail verification \u2014 token consumed,
/// UserProps.EmailVerified flipped to true.
public const string EmailVerificationCompleted = "EmailVerificationCompleted";
/// N-4 (Session C, N4-6): verify-email attempt failed (bad / expired / consumed
/// token, e-mail mismatch after change). Used for guessing-attack telemetry.
public const string EmailVerificationFailed = "EmailVerificationFailed";
/// N-4 (Session E, N4-7): the user initiated the strict change-of-e-mail flow.
/// Payload carries UserId, ClientId, OldEmail, NewEmail (both lowercase), Jti, ExpiresAt.
public const string EmailChangeRequested = "EmailChangeRequested";
/// N-4 (Session E, N4-7): change-of-e-mail confirmation succeeded — the user's
/// _users.email was swapped to the new address and UserProps.EmailVerified
/// was flipped to true.
public const string EmailChangeCompleted = "EmailChangeCompleted";
/// N-4 (Session E, N4-7): change-of-e-mail confirmation failed (bad / expired /
/// consumed token, race against another mutation path, address taken on commit).
public const string EmailChangeFailed = "EmailChangeFailed";
// ── authorization (OAuth/OIDC protocol) ──
public const string TokenIssued = "TokenIssued";
public const string TokenRevoked = "TokenRevoked";
/// H6 (RFC 7662): a token introspection request was processed (active or inactive).
public const string TokenIntrospected = "TokenIntrospected";
public const string AuthorizationGranted = "AuthorizationGranted";
public const string ConsentGranted = "ConsentGranted";
public const string ConsentRevoked = "ConsentRevoked";
public const string AllConsentsRevoked = "AllConsentsRevoked";
public const string DeviceCodeIssued = "DeviceCodeIssued";
public const string DeviceCodeVerified = "DeviceCodeVerified";
public const string DeviceCodeDenied = "DeviceCodeDenied";
/// Z6 (RFC 9126): a Pushed Authorization Request was successfully accepted and a request_uri issued.
public const string ParRequestAccepted = "ParRequestAccepted";
/// Z6 (RFC 9126): a Pushed Authorization Request was rejected (validation, auth, format).
public const string ParRequestRejected = "ParRequestRejected";
/// Z4 (RFC 9449): an access token was bound to a DPoP confirmation key (cnf.jkt issued).
public const string DpopBindingApplied = "DpopBindingApplied";
/// Z4 (RFC 9449 §11.1): a DPoP proof JTI replay was detected at the token / resource endpoint.
public const string DpopReplayDetected = "DpopReplayDetected";
// ── admin (management API mutations) ──
public const string ClientRegistered = "ClientRegistered";
public const string ClientUpdated = "ClientUpdated";
public const string ClientDeleted = "ClientDeleted";
///
/// A new signing key was minted via admin /signing-keys/rotate. Payload carries Kid
/// and Kind; previously-active keys of the same kind have their IsActive flag
/// cleared but remain in the JWKS until or NotAfter elapses.
///
public const string SigningKeyRotated = "SigningKeyRotated";
///
/// A signing key's validity window was ended via admin /signing-keys/{kid}/retire. Payload
/// carries Kid; the key disappears from JWKS on the next request.
///
public const string SigningKeyRetired = "SigningKeyRetired";
///
/// Confidential OAuth client's client_secret was rotated by an administrator.
/// Audit payload deliberately carries only ClientId — the new plaintext secret
/// is NEVER persisted in audit logs (only returned once in the HTTP response body).
///
public const string ClientSecretRotated = "ClientSecretRotated";
public const string ScopeCreated = "ScopeCreated";
public const string ScopeUpdated = "ScopeUpdated";
public const string ScopeDeleted = "ScopeDeleted";
/// H5: declarative claim mapper rule was created.
public const string ClaimMapperCreated = "ClaimMapperCreated";
/// H5: declarative claim mapper rule was updated (props or enabled flag).
public const string ClaimMapperUpdated = "ClaimMapperUpdated";
/// H5: declarative claim mapper rule was deleted.
public const string ClaimMapperDeleted = "ClaimMapperDeleted";
/// H5: a reusable Client Scope (mapper bundle) was created.
public const string ClaimScopeCreated = "ClaimScopeCreated";
/// H5: a Client Scope was updated.
public const string ClaimScopeUpdated = "ClaimScopeUpdated";
/// H5: a Client Scope was deleted (also cascades all assignments).
public const string ClaimScopeDeleted = "ClaimScopeDeleted";
/// H5: a Client Scope was assigned to an Application.
public const string ClaimScopeAssigned = "ClaimScopeAssigned";
/// H5: a Client Scope was unassigned from an Application.
public const string ClaimScopeUnassigned = "ClaimScopeUnassigned";
public const string UserCreated = "UserCreated";
public const string UserUpdated = "UserUpdated";
public const string UserDeleted = "UserDeleted";
/// N7-3: an admin opened an impersonation session ("view-as" overlay) targeting another user.
public const string UserImpersonationStarted = "UserImpersonationStarted";
/// N7-3: an admin closed an impersonation session, restoring their own context.
public const string UserImpersonationStopped = "UserImpersonationStopped";
public const string GroupCreated = "GroupCreated";
public const string GroupUpdated = "GroupUpdated";
public const string GroupDeleted = "GroupDeleted";
public const string GroupMoved = "GroupMoved";
public const string MemberAdded = "MemberAdded";
public const string MemberUpdated = "MemberUpdated";
public const string MemberRemoved = "MemberRemoved";
// ── federation ──
public const string FederationChallengeInitiated = "FederationChallengeInitiated";
public const string FederationStateValidationFailed = "FederationStateValidationFailed";
public const string FederatedUserLoggedIn = "FederatedUserLoggedIn";
/// H8 (DoD §4 gap (b)): a logged-in user added a federated identity to their existing account.
public const string FederatedIdentityLinked = "FederatedIdentityLinked";
/// H8 (DoD §4 gap (b)/(d)): a federated identity was removed from a user account.
public const string FederatedIdentityUnlinked = "FederatedIdentityUnlinked";
/// H8 (DoD §4 gap (c)): federated callback rejected because the external email matched an existing local user without an explicit link.
public const string FederatedEmailConflict = "FederatedEmailConflict";
/// H8 (DoD §4 gap (e)): an admin created/updated/deleted an PROPS-stored federation provider.
public const string FederationProviderCreated = "FederationProviderCreated";
public const string FederationProviderUpdated = "FederationProviderUpdated";
public const string FederationProviderDeleted = "FederationProviderDeleted";
// ── mfa ──
public const string MfaEnrolled = "MfaEnrolled";
public const string MfaDisabled = "MfaDisabled";
public const string MfaChallengeIssued = "MfaChallengeIssued";
public const string MfaVerifyFailed = "MfaVerifyFailed";
public const string MfaRecoveryCodeUsed = "MfaRecoveryCodeUsed";
/// MFA: user downloaded a fresh batch of recovery codes (UX wrap over regenerate-recovery).
public const string MfaRecoveryCodesDownloaded = "MfaRecoveryCodesDownloaded";
/// MFA-3: a WebAuthn credential was registered for the user.
public const string MfaWebAuthnRegistered = "MfaWebAuthnRegistered";
/// MFA-3: a WebAuthn credential successfully asserted (login or step-up).
public const string MfaWebAuthnAsserted = "MfaWebAuthnAsserted";
/// MFA-3: a WebAuthn credential was deleted by the user.
public const string MfaWebAuthnRevoked = "MfaWebAuthnRevoked";
/// MFA-3: detected a sign-counter rollback (possible credential cloning).
public const string MfaWebAuthnSignCounterAnomaly = "MfaWebAuthnSignCounterAnomaly";
// ── scim ──
public const string ScimUserCreated = "ScimUserCreated";
public const string ScimUserReplaced = "ScimUserReplaced";
public const string ScimUserPatched = "ScimUserPatched";
public const string ScimUserDeleted = "ScimUserDeleted";
public const string ScimGroupCreated = "ScimGroupCreated";
public const string ScimGroupReplaced = "ScimGroupReplaced";
public const string ScimGroupPatched = "ScimGroupPatched";
public const string ScimGroupDeleted = "ScimGroupDeleted";
/// H1 (RFC 7644 §3.7): a SCIM Bulk request was processed (≥ 1 inner operation).
public const string ScimBulkProcessed = "ScimBulkProcessed";
// ── system / housekeeping ──
public const string SessionRevoked = "SessionRevoked";
public const string AllSessionsRevoked = "AllSessionsRevoked";
public const string SessionsPruned = "SessionsPruned";
/// W6-0: a single sid (or sub) was published to the backchannel revoked-sids list.
public const string SidRevoked = "SidRevoked";
/// W6-0: cleanup route purged expired entries from the revoked-sids list.
public const string RevokedSidsPruned = "RevokedSidsPruned";
public const string MfaOtpPruned = "MfaOtpPruned";
/// The cleanup removed idempotency records whose time to live had ended.
public const string IdempotencyRecordsPruned = "IdempotencyRecordsPruned";
/// A dry run of counted the expired records (no mutation).
public const string IdempotencyRecordsPrunePreviewed = "IdempotencyRecordsPrunePreviewed";
public const string TokenCleanupRan = "TokenCleanupRan";
public const string TokensPruned = "TokensPruned";
public const string TokensRevokedByUser = "TokensRevokedByUser";
/// N7-4: admin requested a dry-run preview of (no mutation).
public const string AllSessionsRevocationPreviewed = "AllSessionsRevocationPreviewed";
/// N7-4: admin requested a dry-run preview of (no mutation).
public const string TokensPrunePreviewed = "TokensPrunePreviewed";
// ── B.3 role registry ────────────────────────────────────────────────
public const string RoleCreated = "RoleCreated";
public const string RoleUpdated = "RoleUpdated";
public const string RoleDeleted = "RoleDeleted";
public const string RoleAssignedUser = "RoleAssignedUser";
public const string RoleUnassignedUser = "RoleUnassignedUser";
public const string RoleAssignedGroup = "RoleAssignedGroup";
public const string RoleUnassignedGroup = "RoleUnassignedGroup";
public const string RoleScopeAttached = "RoleScopeAttached";
public const string RoleScopeDetached = "RoleScopeDetached";
// ── W1 webhook subscriptions ─────────────────────────────────────────
public const string WebhookSubscriptionCreated = "WebhookSubscriptionCreated";
public const string WebhookSubscriptionUpdated = "WebhookSubscriptionUpdated";
public const string WebhookSubscriptionDeleted = "WebhookSubscriptionDeleted";
public const string WebhookSubscriptionSecretRotated = "WebhookSubscriptionSecretRotated";
/// An operator sent a failed or cancelled outbox delivery (webhook or audit target) again.
public const string WebhookDeliveryRedelivered = "WebhookDeliveryRedelivered";
///
/// Maps event type to semantic bucket.
/// Returns for unknown types so third-party
/// emitters remain storable.
///
public static string CategoryOf(string eventType) => eventType switch
{
UserLoggedIn or UserLoggedOut or LoginFailed or PasswordChanged
or PasswordResetRequested or PasswordResetTokenIssued
or PasswordResetCompleted or PasswordResetFailed
or EmailVerificationSent or EmailVerificationCompleted or EmailVerificationFailed
or EmailChangeRequested or EmailChangeCompleted or EmailChangeFailed
=> IdentityAuditCategories.Authentication,
TokenIssued or TokenRevoked or TokenIntrospected or AuthorizationGranted or ConsentGranted or ConsentRevoked
or AllConsentsRevoked or DeviceCodeIssued or DeviceCodeVerified or DeviceCodeDenied
or ParRequestAccepted or ParRequestRejected or DpopBindingApplied or DpopReplayDetected
=> IdentityAuditCategories.Authorization,
ClientRegistered or ClientUpdated or ClientDeleted or ClientSecretRotated
or ScopeCreated or ScopeUpdated
or ScopeDeleted or UserCreated or UserUpdated or UserDeleted or GroupCreated
or UserImpersonationStarted or UserImpersonationStopped
or GroupUpdated or GroupDeleted or GroupMoved or MemberAdded or MemberUpdated
or MemberRemoved
or ClaimMapperCreated or ClaimMapperUpdated or ClaimMapperDeleted
or ClaimScopeCreated or ClaimScopeUpdated or ClaimScopeDeleted
or ClaimScopeAssigned or ClaimScopeUnassigned
or FederationProviderCreated or FederationProviderUpdated or FederationProviderDeleted
or RoleCreated or RoleUpdated or RoleDeleted
or RoleAssignedUser or RoleUnassignedUser
or RoleAssignedGroup or RoleUnassignedGroup
or RoleScopeAttached or RoleScopeDetached
or WebhookSubscriptionCreated or WebhookSubscriptionUpdated
or WebhookSubscriptionDeleted or WebhookSubscriptionSecretRotated
or WebhookDeliveryRedelivered
=> IdentityAuditCategories.Admin,
FederationChallengeInitiated or FederationStateValidationFailed or FederatedUserLoggedIn
or FederatedIdentityLinked or FederatedIdentityUnlinked or FederatedEmailConflict
=> IdentityAuditCategories.Federation,
MfaEnrolled or MfaDisabled or MfaChallengeIssued or MfaVerifyFailed or MfaRecoveryCodeUsed
or MfaRecoveryCodesDownloaded
or MfaWebAuthnRegistered or MfaWebAuthnAsserted or MfaWebAuthnRevoked
or MfaWebAuthnSignCounterAnomaly
=> IdentityAuditCategories.Mfa,
ScimUserCreated or ScimUserReplaced or ScimUserPatched or ScimUserDeleted
or ScimGroupCreated or ScimGroupReplaced or ScimGroupPatched or ScimGroupDeleted
or ScimBulkProcessed
=> IdentityAuditCategories.Scim,
_ => IdentityAuditCategories.System
};
}
/// Category constants stored in the identity_audit_log.category column.
public static class IdentityAuditCategories
{
public const string Authentication = "authentication";
public const string Authorization = "authorization";
public const string Admin = "admin";
public const string Federation = "federation";
public const string Mfa = "mfa";
public const string Scim = "scim";
public const string System = "system";
}
Path: redb-identity/src/redb.Identity.Contracts/Routes/IdentityEndpoints.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Routes/IdentityEndpoints.cs
----
namespace redb.Identity.Contracts.Routes;
///
/// All direct-vm:// endpoint URIs and RouteIds for the Identity Server.
/// Single source of truth — no magic strings anywhere else.
///
public static class IdentityEndpoints
{
// ── Protocol endpoints (OpenIddict pipeline) ──
public const string Token = "direct-vm://identity-token";
public const string Authorize = "direct-vm://identity-authorize";
/// Z6 (RFC 9126): Pushed Authorization Request endpoint.
public const string PushedAuthorization = "direct-vm://identity-par";
public const string Userinfo = "direct-vm://identity-userinfo";
public const string Introspect = "direct-vm://identity-introspect";
public const string Revoke = "direct-vm://identity-revoke";
public const string Discovery = "direct-vm://identity-discovery";
public const string Jwks = "direct-vm://identity-jwks";
public const string Logout = "direct-vm://identity-logout";
public const string Device = "direct-vm://identity-device";
public const string Verification = "direct-vm://identity-verification";
public const string Login = "direct-vm://identity-login";
public const string ConsentGrant = "direct-vm://identity-consent-grant";
public const string DynamicRegister = "direct-vm://identity-dynamic-register";
/// Z2 (RFC 7592): Dynamic Client Registration management endpoint.
public const string DynamicRegisterManage = "direct-vm://identity-dynamic-register-manage";
public const string MfaVerify = "direct-vm://identity-mfa-verify";
public const string MfaRecovery = "direct-vm://identity-mfa-recovery";
public const string MfaChallenge = "direct-vm://identity-mfa-challenge";
/// B9 / BUG-9: Auth0-style gated enumeration of the user's MFA methods.
public const string MfaListMethods = "direct-vm://identity-mfa-methods";
///
/// MFA-3: WebAuthn login-flow assertion endpoint. Begin issues a fresh challenge wrapped
/// in mfa_state; complete verifies the assertion and creates a session in the same
/// transaction as .
///
public const string MfaWebAuthn = "direct-vm://identity-mfa-webauthn";
// ── Management endpoints ──
public const string ManageApps = "direct-vm://identity-manage-apps";
public const string ManageScopes = "direct-vm://identity-manage-scopes";
public const string ManageUsers = "direct-vm://identity-manage-users";
public const string ManageTokens = "direct-vm://identity-manage-tokens";
public const string ManageGroups = "direct-vm://identity-manage-groups";
public const string ManageConsents = "direct-vm://identity-manage-consents";
public const string ManageSessions = "direct-vm://identity-manage-sessions";
///
/// Admin signing-key lifecycle management. Operations:
///
/// - list — every key row in the PROPS signing-key store, including retired ones.
/// - rotate — mint a new active key of the supplied kind; demote previously-active keys
/// of that kind (they stay in JWKS until their NotAfter passes).
/// - retire — set NotAfter of the supplied kid to "now"; the key disappears from JWKS
/// on the next request and tokens signed under it stop validating.
///
/// Requires identity:applications.manage or master identity:manage.
///
public const string ManageSigningKeys = "direct-vm://identity-manage-signing-keys";
///
/// W6-0: Backchannel revoked-sids list. Operations:
///
/// - add — publish a new revocation entry (sid, sub or both).
/// - since — incremental poll: returns entries with RevokedAt > cursor.
///
/// Used by Relying Parties (incl. our own Identity.Web) to invalidate cookie sessions
/// in multi-instance deployments where the OIDC backchannel logout (/bcl/sink) push
/// alone is insufficient to fan out across all replicas.
///
public const string RevokedSids = "direct-vm://identity-revoked-sids";
public const string MfaManage = "direct-vm://identity-manage-mfa";
/// H9 (v1.0 DoD): Admin audit log query endpoint.
public const string ManageAudit = "direct-vm://identity-manage-audit";
///
/// N7-3 — admin impersonation session marker. Operations: start, stop.
/// Does NOT mint a token; the BFF tracks the target user in its own session cookie
/// and routes admin API calls accordingly. This endpoint writes audit events
/// (UserImpersonationStarted / UserImpersonationStopped) and validates
/// the target user exists.
///
public const string ManageImpersonation = "direct-vm://identity-manage-impersonation";
/// H5 (v1.0 DoD §5): Admin CRUD for declarative claim mappers.
public const string ManageClaimMappers = "direct-vm://identity-manage-claim-mappers";
/// H5 (v1.0 DoD §5): Admin CRUD for reusable Client Scopes (mapper bundles).
public const string ManageClaimScopes = "direct-vm://identity-manage-claim-scopes";
/// S2: Admin CRUD for claim definitions (schema with required + type + regex).
public const string ManageClaimDefinitions = "direct-vm://identity-manage-claim-definitions";
/// B.3: Admin CRUD + assignments for the Roles registry.
public const string ManageRoles = "direct-vm://identity-manage-roles";
/// W1: Admin CRUD for outbound webhook subscriptions.
public const string ManageWebhooks = "direct-vm://identity-manage-webhooks";
/// W1: Internal dispatcher route — consumes events route wiretap, fans out to subscriptions.
public const string DispatchWebhooks = "direct-vm://identity-dispatch-webhooks";
///
/// H3-SSO (v1.0 DoD §6 scoped-subset): Self-service session endpoint. Caller targets
/// their own sessions only — userId is derived from the authenticated token subject,
/// never from the request body.
///
public const string MeSessions = "direct-vm://identity-me-sessions";
///
/// H3 (v1.0 DoD §6): Self-service profile endpoint (GET /me, PUT /me).
/// Caller id is derived from the authenticated token subject.
///
public const string MeProfile = "direct-vm://identity-me-profile";
///
/// H3 (v1.0 DoD §6): Self-service password change (PUT /me/password). Validates
/// the caller's current password, enforces policy, and revokes all sessions on success
/// (OWASP Session Management C7).
///
public const string MePassword = "direct-vm://identity-me-password";
///
/// N-4 (Session C): anonymous password-recovery initiation. Body =
/// PasswordForgotRequest; always returns success (anti-enumeration). Validates
/// callerResetUrl against the client's ApplicationProps.PasswordResetUris
/// whitelist before issuing a single-use reset token and dispatching an e-mail.
///
public const string PasswordForgot = "direct-vm://identity-password-forgot";
///
/// N-4 (Session C): anonymous password-recovery completion. Body =
/// PasswordResetRequest; verifies + atomically consumes the token, applies the
/// new password, and revokes every active session for the bound user.
///
public const string PasswordReset = "direct-vm://identity-password-reset";
///
/// N-4 (Session C, sub-step N4-6): authenticated self-service request for an
/// e-mail verification link. Body = EmailVerifySendRequest carrying
/// clientId + callerVerifyUrl. The processor binds the token to the
/// caller's current e-mail (derived from the access-token subject), so the user can
/// never trigger a verify e-mail to someone else's inbox.
///
public const string MeEmailVerifySend = "direct-vm://identity-me-email-verify-send";
///
/// N-4 (Session C, sub-step N4-6): anonymous e-mail-verification confirmation.
/// Body = EmailVerifyConfirmRequest; verifies + atomically consumes the token
/// and sets UserProps.EmailVerified = true only when the user's current
/// e-mail still matches the value bound at issue time.
///
public const string EmailVerifyConfirm = "direct-vm://identity-email-verify-confirm";
///
/// N-4 (Session E, sub-step N4-7): authenticated self-service request to switch the
/// caller's e-mail to a new address. Body = ChangeEmailRequestRequest carrying
/// newEmail, clientId + callerConfirmUrl. The processor issues a
/// single-use token bound to BOTH the current and the requested new address and
/// dispatches the confirmation link to the NEW address.
///
public const string MeChangeEmailRequest = "direct-vm://identity-me-change-email-request";
///
/// N-4 (Session E, sub-step N4-7): anonymous change-of-e-mail confirmation.
/// Body = ChangeEmailConfirmRequest; verifies + atomically consumes the token,
/// re-checks address uniqueness, then swaps _users.email to the new value AND
/// flips UserProps.EmailVerified = true only when the caller's current e-mail
/// still matches the snapshot captured at issue time.
///
public const string ChangeEmailConfirm = "direct-vm://identity-change-email-confirm";
///
/// N-3 (sub-step N3-7): anonymous self-service account registration. Body =
/// RegisterAccountRequest; creates a new _users row + UserProps
/// extension, optionally dispatches an e-mail verification link (when both
/// RedbIdentityOptions.Registration.SendVerifyEmail and
/// RedbIdentityOptions.EmailVerification.Enabled are true) and returns
/// the new user id so the BFF can immediately sign the user in via ROPC. Returns
/// 404 when RedbIdentityOptions.Registration.Enabled is false.
///
public const string AccountRegister = "direct-vm://identity-account-register";
///
/// N-4 (Session C): transactional e-mail dispatch backbone. The body of the inbound
/// exchange is the rendered HTML (with redbMail.* headers carrying To/Subject/
/// TextBody/From). Wired to Smtp.Send(...) via the redb.Route.Mail DSL when
/// RedbIdentityOptions.Smtp.Enabled is true. When disabled the route is
/// not built and the channel falls back to a host-registered alternative (e.g. the
/// in-memory channel used by integration tests).
///
public const string EmailSend = "direct-vm://identity-email-send";
///
/// H3 (v1.0 DoD §6): Self-service MFA management (/me/mfa/*). Supports status,
/// setup, confirm-setup, disable, regenerate-recovery — always scoped to the caller.
///
public const string MeMfa = "direct-vm://identity-me-mfa";
///
/// H3 (v1.0 DoD §6): Self-service consent management (GET /me/consents,
/// DELETE /me/consents/{clientId}).
///
public const string MeConsents = "direct-vm://identity-me-consents";
///
/// MFA-3: Self-service WebAuthn management (/me/webauthn/*). Supports status,
/// register-begin, register-complete, list/rename/delete credentials — always scoped to the caller.
///
public const string MeWebAuthn = "direct-vm://identity-me-webauthn";
// ── SCIM 2.0 endpoints (RFC 7644) ──
public const string ScimUsers = "direct-vm://identity-scim-users";
public const string ScimGroups = "direct-vm://identity-scim-groups";
/// H1 (RFC 7644 §3.7): SCIM Bulk endpoint.
public const string ScimBulk = "direct-vm://identity-scim-bulk";
// ── Federation endpoints ──
public const string FederationChallenge = "direct-vm://identity-federation-challenge";
public const string FederationCallback = "direct-vm://identity-federation-callback";
// H8 (DoD §4 gap (b)/(d)): self-service link/unlink of federated identities.
public const string MeFederatedIdentities = "direct-vm://identity-me-federated-identities";
// H8 (DoD §4 gap (e)): admin CRUD over PROPS-stored federation provider configs.
public const string ManageFederationProviders = "direct-vm://identity-manage-federation-providers";
// ── Event dispatch ──
public const string Events = "direct-vm://identity-events";
// ── Audit multicast ──
public const string Audit = "direct-vm://identity-audit";
// ── Phase 9d cross-context broker endpoints (Http facade → Core) ──
///
/// Phase 9d. CORS preflight check: «is browser Origin registered as a
/// redirect/post-logout URI of any OAuth client?». Body: ,
/// reply: . In-memory snapshot in Core,
/// invalidation-driven; per-call cost <1ms after warm-up.
///
public const string CorsCheck = "direct-vm://identity-cors-check";
///
/// Phase 9d. Validates an unauthenticated post_logout_redirect_uri against
/// registered OAuth clients. Body: ,
/// reply: .
///
public const string ValidatePostLogoutRedirect = "direct-vm://identity-validate-post-logout";
///
/// Phase 9d. Decrypts an opaque mfa_state token and returns the configured MFA
/// methods. Used by HTTP UI to render the verification page without taking a hard
/// dependency on Core's MfaStateProtector. Body: ,
/// reply: .
///
public const string MfaMethodsFromState = "direct-vm://identity-mfa-methods-from-state";
// ── B1: one-shot emergency-admin bootstrap (chicken-and-egg) ──
///
/// B1 — atomic create of the first admin user, group, OIDC client
/// (identity-web) and SystemFlag(bootstrap_completed). Body:
/// , reply:
/// . Mounted on the
/// HTTP facade as POST /internal/bootstrap-admin (outside the regular base path).
/// Self-locks via the SystemFlag sentinel — second call returns 410 Gone.
///
public const string BootstrapAdmin = "direct-vm://identity-bootstrap-admin";
// ── Cross-context auth processor entry points (Phase 9b clean rewire) ──
///
/// Validates the management API bearer token and accepts either the
/// identity:manage or identity:account scope. The HTTP facade
/// in its own Tsak context calls this endpoint inline as the first step of
/// every /api/v1/identity/* and /me/* route — same exchange,
/// synchronous, zero-copy via direct-vm.
///
public const string AuthManagement = "direct-vm://identity-auth-management";
///
/// Validates SCIM API bearer tokens (scim scope). Registered only when
/// Features.EnableScim = true. Same usage pattern as
/// .
///
public const string AuthScim = "direct-vm://identity-auth-scim";
///
/// Granular authorization check for the management surface: given a resource, an action and the
/// scopes an already-authenticated caller holds, decides whether the call may proceed.
///
/// Transport-neutral on purpose. Every facade authenticates in its own vocabulary but must not carry
/// its own copy of the scope table - two copies drift, and the one that drifts quietly is the one
/// that grants too much. So the table lives here, once, and each transport supplies three inputs:
///
///
/// - identity:authz-resource - the canonical resource identifier, e.g.
/// /api/v1/identity/users. HTTP passes its own path unchanged; other transports map their
/// addresses onto the same identifiers.
/// - identity:authz-action - read or write. Write implies read, never the
/// inverse.
/// - identity:management-scopes - set by the authentication step that ran before this
/// one ().
///
///
/// A refusal is a 403 with insufficient_scope, in the same shape the rest of Core uses for its
/// verdicts, so each facade renders it in its own protocol without a second table.
///
///
public const string AuthzCheck = "direct-vm://identity-authz-check";
// ── Route IDs ──
public static class RouteIds
{
public const string Token = "identity-token";
public const string Authorize = "identity-authorize";
public const string PushedAuthorization = "identity-par";
public const string Userinfo = "identity-userinfo";
public const string Introspect = "identity-introspect";
public const string Revoke = "identity-revoke";
public const string Discovery = "identity-discovery";
public const string Jwks = "identity-jwks";
public const string Logout = "identity-logout";
public const string Device = "identity-device";
public const string Verification = "identity-verification";
public const string Login = "identity-login";
public const string ConsentGrant = "identity-consent-grant";
public const string DynamicRegister = "identity-dynamic-register";
public const string DynamicRegisterManage = "identity-dynamic-register-manage";
public const string MfaVerify = "identity-mfa-verify";
public const string MfaRecovery = "identity-mfa-recovery";
public const string MfaChallenge = "identity-mfa-challenge";
public const string MfaListMethods = "identity-mfa-methods";
public const string MfaWebAuthn = "identity-mfa-webauthn";
public const string ManageApps = "identity-manage-apps";
public const string ManageScopes = "identity-manage-scopes";
public const string ManageUsers = "identity-manage-users";
public const string ManageTokens = "identity-manage-tokens";
public const string ManageGroups = "identity-manage-groups";
public const string ManageConsents = "identity-manage-consents";
public const string ManageSessions = "identity-manage-sessions";
public const string ManageSigningKeys = "identity-manage-signing-keys";
public const string RevokedSids = "identity-revoked-sids";
public const string RevokedSidsCleanup = "identity-revoked-sids-cleanup";
public const string MfaManage = "identity-manage-mfa";
public const string ManageAudit = "identity-manage-audit";
public const string ManageImpersonation = "identity-manage-impersonation";
public const string ManageClaimMappers = "identity-manage-claim-mappers";
public const string ManageClaimScopes = "identity-manage-claim-scopes";
public const string ManageClaimDefinitions = "identity-manage-claim-definitions";
public const string ManageRoles = "identity-manage-roles";
public const string ManageWebhooks = "identity-manage-webhooks";
public const string DispatchWebhooks = "identity-dispatch-webhooks";
public const string MeSessions = "identity-me-sessions";
public const string MeProfile = "identity-me-profile";
public const string MePassword = "identity-me-password";
public const string PasswordForgot = "identity-password-forgot";
public const string PasswordReset = "identity-password-reset";
public const string MeEmailVerifySend = "identity-me-email-verify-send";
public const string EmailVerifyConfirm = "identity-email-verify-confirm";
public const string MeChangeEmailRequest = "identity-me-change-email-request";
public const string ChangeEmailConfirm = "identity-change-email-confirm";
public const string AccountRegister = "identity-account-register";
public const string EmailSend = "identity-email-send";
public const string MeMfa = "identity-me-mfa";
public const string MeConsents = "identity-me-consents";
public const string MeWebAuthn = "identity-me-webauthn";
public const string ScimUsers = "identity-scim-users";
public const string ScimGroups = "identity-scim-groups";
public const string ScimBulk = "identity-scim-bulk";
public const string FederationChallenge = "identity-federation-challenge";
public const string FederationCallback = "identity-federation-callback";
public const string MeFederatedIdentities = "identity-me-federated-identities";
public const string ManageFederationProviders = "identity-manage-federation-providers";
public const string Events = "identity-events";
/// The timer route that sends the due outbox deliveries (webhooks and audit targets).
public const string WebhookDelivery = "identity-webhook-delivery";
/// The timer route that deletes finished outbox rows past their retention.
public const string DeliveryCleanup = "identity-delivery-cleanup";
public const string Audit = "identity-audit";
// Phase 9d cross-context broker route ids.
public const string CorsCheck = "identity-cors-check";
public const string ValidatePostLogoutRedirect = "identity-validate-post-logout";
public const string MfaMethodsFromState = "identity-mfa-methods-from-state";
// B1: one-shot emergency-admin bootstrap.
public const string BootstrapAdmin = "identity-bootstrap-admin";
// Cross-context auth processor entry points.
public const string AuthManagement = "identity-auth-management";
public const string AuthzCheck = "identity-authz-check";
public const string AuthScim = "identity-auth-scim";
}
}
Path: redb-identity/src/redb.Identity.Contracts/Routes/IdentityReservedInboundHeaders.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Routes/IdentityReservedInboundHeaders.cs
----
namespace redb.Identity.Contracts.Routes;
///
/// Exchange header names that carry internal, server-derived state and must never arrive from a
/// caller. Every transport connector (HTTP, gRPC metadata and envelope headers, SOAP over HTTP)
/// copies the caller's headers into In.Headers verbatim, while Core processors trust these
/// names as if a facade processor had set them: session_user_id becomes the authenticated
/// principal on the authorize route, user_id / ip_address / user_agent /
/// client_id sign the audit log, access_token / client_secret feed
/// authentication. Each facade removes them as its first step, so only its own trusted processors
/// (cookie, Authorization header, body, path, method address) can populate them afterwards. The one
/// list lives here so a name added for one transport is stripped on all of them.
///
/// Deliberately NOT here: operation. Over HTTP it is internal (derived from the method and
/// path, so the HTTP facade strips it on its own), but on the gRPC envelope route the caller names
/// the operation in metadata by design — that transport's equivalent of a URL path.
///
///
/// Also here: Set-Cookie, a response header no caller has any business sending. The routes
/// answer on the request message, and the cookie writers add to whatever Set-Cookie is already
/// on it — so a caller's own value ended up in the same array as ours and went back out with it. The
/// transport refuses to echo a request header only while it is the untouched object the client sent,
/// and an array built around it is not.
///
///
public static class IdentityReservedInboundHeaders
{
public static readonly string[] Names =
{
"session_user_id", "session_username", "session_id", "reauth_marked_sid",
"client_id", "client_secret", "access_token",
"user_id", "ip_address", "user_agent",
"Set-Cookie",
};
/// Removes every reserved name from (case-insensitive dictionaries remove any casing).
public static void Strip(IDictionary headers)
{
foreach (var name in Names)
headers.Remove(name);
}
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimBulkRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimBulkRequest.cs
----
using System.Text.Json;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scim;
///
/// SCIM 2.0 Bulk request (RFC 7644 §3.7).
///
public class ScimBulkRequest
{
[JsonPropertyName("schemas")]
public string[] Schemas { get; set; } = [ScimConstants.BulkRequestSchema];
/// Number of errors before stopping. 0 = continue on all errors.
[JsonPropertyName("failOnErrors")]
public int FailOnErrors { get; set; }
[JsonPropertyName("Operations")]
public List Operations { get; set; } = [];
}
///
/// Single bulk operation (RFC 7644 §3.7).
///
public class ScimBulkOperation
{
[JsonPropertyName("method")]
public string Method { get; set; } = null!;
[JsonPropertyName("path")]
public string Path { get; set; } = null!;
[JsonPropertyName("bulkId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? BulkId { get; set; }
[JsonPropertyName("data")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public JsonElement? Data { get; set; }
}
///
/// SCIM 2.0 Bulk response (RFC 7644 §3.7).
///
public class ScimBulkResponse
{
[JsonPropertyName("schemas")]
public string[] Schemas { get; set; } = [ScimConstants.BulkResponseSchema];
[JsonPropertyName("Operations")]
public List Operations { get; set; } = [];
}
///
/// Single bulk operation result (RFC 7644 §3.7).
///
public class ScimBulkOperationResponse
{
[JsonPropertyName("method")]
public string Method { get; set; } = null!;
[JsonPropertyName("bulkId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? BulkId { get; set; }
[JsonPropertyName("location")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Location { get; set; }
[JsonPropertyName("status")]
public string Status { get; set; } = null!;
[JsonPropertyName("response")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public JsonElement? Response { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimCommon.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimCommon.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scim;
///
/// SCIM 2.0 resource metadata (RFC 7643 §3.1).
///
public class ScimMeta
{
[JsonPropertyName("resourceType")]
public string? ResourceType { get; set; }
[JsonPropertyName("created")]
public DateTimeOffset? Created { get; set; }
[JsonPropertyName("lastModified")]
public DateTimeOffset? LastModified { get; set; }
[JsonPropertyName("location")]
public string? Location { get; set; }
[JsonPropertyName("version")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Version { get; set; }
}
///
/// Multi-valued attribute entry (emails, phoneNumbers, etc.) per RFC 7643 §2.4.
///
public class ScimMultiValuedAttribute
{
[JsonPropertyName("value")]
public string? Value { get; set; }
[JsonPropertyName("type")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Type { get; set; }
[JsonPropertyName("primary")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool Primary { get; set; }
}
///
/// Member reference (for groups) per RFC 7643 §4.2.
///
public class ScimMemberRef
{
[JsonPropertyName("value")]
public string? Value { get; set; }
[JsonPropertyName("display")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Display { get; set; }
[JsonPropertyName("$ref")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Ref { get; set; }
}
///
/// Group reference (read-only on User) per RFC 7643 §4.1.2.
///
public class ScimGroupRef
{
[JsonPropertyName("value")]
public string? Value { get; set; }
[JsonPropertyName("display")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Display { get; set; }
[JsonPropertyName("$ref")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Ref { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimConstants.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimConstants.cs
----
namespace redb.Identity.Contracts.Scim;
///
/// SCIM 2.0 constants (RFC 7643/7644).
///
public static class ScimConstants
{
// ── Schema URIs (RFC 7643 §8) ──
public const string UserSchema = "urn:ietf:params:scim:schemas:core:2.0:User";
public const string GroupSchema = "urn:ietf:params:scim:schemas:core:2.0:Group";
///
/// Enterprise User extension (RFC 7643 §4.3) — department / manager / employeeNumber and friends.
/// Doubles as the JSON member name on the User resource: an extension is namespaced by its URN,
/// not by a plain attribute name.
///
public const string EnterpriseUserSchema = "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User";
public const string ServiceProviderConfigSchema = "urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig";
public const string ResourceTypeSchema = "urn:ietf:params:scim:schemas:core:2.0:ResourceType";
public const string SchemaSchema = "urn:ietf:params:scim:schemas:core:2.0:Schema";
// ── Message schemas (RFC 7644) ──
public const string ListResponseSchema = "urn:ietf:params:scim:api:messages:2.0:ListResponse";
public const string PatchOpSchema = "urn:ietf:params:scim:api:messages:2.0:PatchOp";
public const string BulkRequestSchema = "urn:ietf:params:scim:api:messages:2.0:BulkRequest";
public const string BulkResponseSchema = "urn:ietf:params:scim:api:messages:2.0:BulkResponse";
public const string ErrorSchema = "urn:ietf:params:scim:api:messages:2.0:Error";
// ── Content type (RFC 7644 §3.1) ──
public const string MediaType = "application/scim+json";
// ── Endpoints ──
public const string UsersEndpoint = "/Users";
public const string GroupsEndpoint = "/Groups";
public const string BulkEndpoint = "/Bulk";
public const string ServiceProviderConfigEndpoint = "/ServiceProviderConfig";
public const string SchemasEndpoint = "/Schemas";
public const string ResourceTypesEndpoint = "/ResourceTypes";
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimDiscovery.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimDiscovery.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scim;
///
/// SCIM 2.0 ServiceProviderConfig resource (RFC 7643 §5).
///
public class ScimServiceProviderConfig
{
[JsonPropertyName("schemas")]
public string[] Schemas { get; set; } = [ScimConstants.ServiceProviderConfigSchema];
[JsonPropertyName("patch")]
public ScimSupported Patch { get; set; } = new() { Supported = true };
[JsonPropertyName("bulk")]
public ScimBulkConfig Bulk { get; set; } = new();
[JsonPropertyName("filter")]
public ScimFilterConfig Filter { get; set; } = new();
[JsonPropertyName("changePassword")]
public ScimSupported ChangePassword { get; set; } = new() { Supported = false };
[JsonPropertyName("sort")]
public ScimSupported Sort { get; set; } = new() { Supported = true };
[JsonPropertyName("etag")]
public ScimSupported Etag { get; set; } = new() { Supported = true };
[JsonPropertyName("authenticationSchemes")]
public List AuthenticationSchemes { get; set; } =
[
new()
{
Type = "oauthbearertoken",
Name = "OAuth 2.0 Bearer Token",
Description = "Authentication scheme using OAuth 2.0 Bearer Token (RFC 6750)"
}
];
[JsonPropertyName("meta")]
public ScimMeta? Meta { get; set; }
}
public class ScimSupported
{
[JsonPropertyName("supported")]
public bool Supported { get; set; }
}
public class ScimBulkConfig
{
[JsonPropertyName("supported")]
public bool Supported { get; set; } = false;
[JsonPropertyName("maxOperations")]
public int MaxOperations { get; set; } = 1000;
[JsonPropertyName("maxPayloadSize")]
public int MaxPayloadSize { get; set; } = 1048576;
}
public class ScimFilterConfig
{
[JsonPropertyName("supported")]
public bool Supported { get; set; } = true;
[JsonPropertyName("maxResults")]
public int MaxResults { get; set; } = 100;
}
public class ScimAuthenticationScheme
{
[JsonPropertyName("type")]
public string Type { get; set; } = null!;
[JsonPropertyName("name")]
public string Name { get; set; } = null!;
[JsonPropertyName("description")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Description { get; set; }
}
///
/// SCIM 2.0 ResourceType (RFC 7643 §6).
///
public class ScimResourceType
{
[JsonPropertyName("schemas")]
public string[] Schemas { get; set; } = [ScimConstants.ResourceTypeSchema];
[JsonPropertyName("id")]
public string Id { get; set; } = null!;
[JsonPropertyName("name")]
public string Name { get; set; } = null!;
[JsonPropertyName("endpoint")]
public string Endpoint { get; set; } = null!;
[JsonPropertyName("description")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Description { get; set; }
[JsonPropertyName("schema")]
public string Schema { get; set; } = null!;
///
/// RFC 7643 §6 — the schema extensions this resource type carries. Omitted when there are none,
/// so the Group resource type stays byte-identical to what it was.
///
[JsonPropertyName("schemaExtensions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List? SchemaExtensions { get; set; }
[JsonPropertyName("meta")]
public ScimMeta? Meta { get; set; }
}
///
/// A schema extension declared on a ResourceType (RFC 7643 §6). required says whether the
/// extension MUST be present on every resource of that type — for Enterprise User it is false: a
/// user without a department is a perfectly ordinary user.
///
public class ScimSchemaExtension
{
[JsonPropertyName("schema")]
public string Schema { get; set; } = null!;
[JsonPropertyName("required")]
public bool Required { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimEnterpriseUser.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimEnterpriseUser.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scim;
///
/// SCIM 2.0 Enterprise User extension (RFC 7643 §4.3).
///
/// This is the extension corporate provisioning actually sends. Okta, Entra ID and Workday all
/// push department, manager and employeeNumber on the very first sync — a
/// provider that advertises only the core User schema forces them to drop that data on the floor.
///
///
/// It travels as a namespaced member of the User resource, keyed by its schema URN rather than a
/// plain attribute name, and the URN must also appear in the resource's schemas array —
/// that is what tells the client the extension is present rather than merely permitted.
///
///
public class ScimEnterpriseUser
{
/// Numeric or alphanumeric identifier assigned by the organisation (RFC 7643 §4.3).
[JsonPropertyName("employeeNumber")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? EmployeeNumber { get; set; }
/// Cost centre the user is booked against.
[JsonPropertyName("costCenter")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? CostCenter { get; set; }
/// Name of the organisation.
[JsonPropertyName("organization")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Organization { get; set; }
/// Name of the division.
[JsonPropertyName("division")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Division { get; set; }
/// Name of the department.
[JsonPropertyName("department")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Department { get; set; }
/// The user's manager (RFC 7643 §4.3 — a complex attribute, not a bare string).
[JsonPropertyName("manager")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ScimManager? Manager { get; set; }
/// True when nothing is populated — used to decide whether to emit the member at all.
[JsonIgnore]
public bool IsEmpty =>
string.IsNullOrEmpty(EmployeeNumber)
&& string.IsNullOrEmpty(CostCenter)
&& string.IsNullOrEmpty(Organization)
&& string.IsNullOrEmpty(Division)
&& string.IsNullOrEmpty(Department)
&& string.IsNullOrEmpty(Manager?.Value);
}
///
/// The manager complex attribute of the Enterprise User extension (RFC 7643 §4.3).
/// value is the manager's SCIM id; $ref is the URI of that User resource;
/// displayName is read-only and resolved by the provider.
///
public class ScimManager
{
/// The id of the manager's User resource.
[JsonPropertyName("value")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Value { get; set; }
/// URI of the manager's User resource (RFC 7643 §4.3 — the attribute is literally named "$ref").
[JsonPropertyName("$ref")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Ref { get; set; }
/// The manager's display name. Read-only: the provider resolves it, the client never sets it.
[JsonPropertyName("displayName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? DisplayName { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimError.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimError.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scim;
///
/// SCIM 2.0 error response (RFC 7644 §3.12).
///
public class ScimError
{
[JsonPropertyName("schemas")]
public string[] Schemas { get; set; } = [ScimConstants.ErrorSchema];
/// HTTP status code as string, e.g. "404".
[JsonPropertyName("status")]
public string Status { get; set; } = null!;
/// SCIM detail error type (RFC 7644 §3.12 Table 9), e.g. "uniqueness", "mutability".
[JsonPropertyName("scimType")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ScimType { get; set; }
/// Human-readable error detail.
[JsonPropertyName("detail")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Detail { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimGroup.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimGroup.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scim;
///
/// SCIM 2.0 Group resource (RFC 7643 §4.2).
///
public class ScimGroup
{
[JsonPropertyName("schemas")]
public string[] Schemas { get; set; } = [ScimConstants.GroupSchema];
[JsonPropertyName("id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Id { get; set; }
[JsonPropertyName("externalId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ExternalId { get; set; }
[JsonPropertyName("displayName")]
public string DisplayName { get; set; } = null!;
[JsonPropertyName("members")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List? Members { get; set; }
[JsonPropertyName("meta")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ScimMeta? Meta { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimListResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimListResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scim;
///
/// SCIM 2.0 ListResponse (RFC 7644 §3.4.2).
///
public class ScimListResponse
{
[JsonPropertyName("schemas")]
public string[] Schemas { get; set; } = [ScimConstants.ListResponseSchema];
[JsonPropertyName("totalResults")]
public int TotalResults { get; set; }
/// 1-based start index (RFC 7644 §3.4.2.4).
[JsonPropertyName("startIndex")]
public int StartIndex { get; set; } = 1;
[JsonPropertyName("itemsPerPage")]
public int ItemsPerPage { get; set; }
[JsonPropertyName("Resources")]
public List Resources { get; set; } = [];
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimPatchRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimPatchRequest.cs
----
using System.Text.Json;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scim;
///
/// SCIM 2.0 PATCH request (RFC 7644 §3.5.2).
///
public class ScimPatchRequest
{
[JsonPropertyName("schemas")]
public string[] Schemas { get; set; } = [ScimConstants.PatchOpSchema];
[JsonPropertyName("Operations")]
public List Operations { get; set; } = [];
}
///
/// Single PATCH operation (RFC 7644 §3.5.2).
///
public class ScimPatchOperation
{
/// "add", "replace", or "remove".
[JsonPropertyName("op")]
public string Op { get; set; } = null!;
/// Attribute path, e.g. "displayName", "members", "members[value eq \"123\"]".
[JsonPropertyName("path")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Path { get; set; }
/// Value to apply. Can be a primitive, object, or array.
[JsonPropertyName("value")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public JsonElement? Value { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimSchema.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimSchema.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scim;
///
/// SCIM 2.0 Schema resource (RFC 7643 §7).
///
public class ScimSchema
{
[JsonPropertyName("schemas")]
public string[] Schemas { get; set; } = [ScimConstants.SchemaSchema];
[JsonPropertyName("id")]
public string Id { get; set; } = null!;
[JsonPropertyName("name")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Name { get; set; }
[JsonPropertyName("description")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Description { get; set; }
[JsonPropertyName("attributes")]
public List Attributes { get; set; } = [];
[JsonPropertyName("meta")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ScimMeta? Meta { get; set; }
}
///
/// SCIM Schema attribute definition (RFC 7643 §7).
///
public class ScimSchemaAttribute
{
[JsonPropertyName("name")]
public string Name { get; set; } = null!;
[JsonPropertyName("type")]
public string Type { get; set; } = "string";
[JsonPropertyName("multiValued")]
public bool MultiValued { get; set; }
[JsonPropertyName("required")]
public bool Required { get; set; }
[JsonPropertyName("description")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Description { get; set; }
[JsonPropertyName("mutability")]
public string Mutability { get; set; } = "readWrite";
[JsonPropertyName("returned")]
public string Returned { get; set; } = "default";
[JsonPropertyName("uniqueness")]
public string Uniqueness { get; set; } = "none";
[JsonPropertyName("caseExact")]
public bool CaseExact { get; set; }
[JsonPropertyName("subAttributes")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List? SubAttributes { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimSchemaDefinitions.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimSchemaDefinitions.cs
----
namespace redb.Identity.Contracts.Scim;
///
/// Provides static SCIM 2.0 schema definitions for User and Group (RFC 7643 §7).
///
public static class ScimSchemaDefinitions
{
public static ScimSchema UserSchema { get; } = new()
{
Id = ScimConstants.UserSchema,
Name = "User",
Description = "User Account",
Meta = new ScimMeta { ResourceType = "Schema", Location = "/scim/v2/Schemas/" + ScimConstants.UserSchema },
Attributes =
[
Attr("userName", required: true, mutability: "immutable", uniqueness: "server", description: "Unique identifier for the User, typically used by the user to directly authenticate."),
Attr("name", type: "complex", description: "The components of the user's real name.", subAttributes:
[
Attr("formatted", description: "The full name."),
Attr("familyName", description: "The family name."),
Attr("givenName", description: "The given name.")
]),
Attr("displayName", description: "The name displayed to end-users."),
Attr("active", type: "boolean", description: "Administrative status of the user."),
Attr("password", mutability: "writeOnly", returned: "never", description: "The user's cleartext password. Write-only."),
Attr("emails", type: "complex", multiValued: true, description: "Email addresses for the user.", subAttributes:
[
Attr("value", description: "The email address value."),
Attr("type", description: "The type of email (e.g., work, home)."),
Attr("primary", type: "boolean", description: "Whether this is the primary email.")
]),
Attr("phoneNumbers", type: "complex", multiValued: true, description: "Phone numbers for the user.", subAttributes:
[
Attr("value", description: "The phone number."),
Attr("type", description: "The type (e.g., work, mobile)."),
Attr("primary", type: "boolean", description: "Whether this is the primary phone number.")
]),
Attr("addresses", type: "complex", multiValued: true, description: "Addresses for the user.", subAttributes:
[
Attr("streetAddress"), Attr("locality"), Attr("region"),
Attr("postalCode"), Attr("country"), Attr("formatted"),
Attr("type"), Attr("primary", type: "boolean")
]),
Attr("photos", type: "complex", multiValued: true, description: "URLs of photos of the user.", subAttributes:
[
Attr("value", type: "reference", description: "The photo URI."),
Attr("type", description: "The type (e.g., photo, thumbnail).")
]),
Attr("groups", type: "complex", multiValued: true, mutability: "readOnly", description: "A list of groups to which the user belongs.", subAttributes:
[
Attr("value", mutability: "readOnly", description: "The group id."),
Attr("$ref", mutability: "readOnly", type: "reference", description: "The URI of the group."),
Attr("display", mutability: "readOnly", description: "The group display name.")
]),
Attr("externalId", description: "An identifier for the resource as defined by the provisioning client.", caseExact: true),
Attr("id", mutability: "readOnly", returned: "always", uniqueness: "server", description: "Unique identifier assigned by the service provider.", caseExact: true),
Attr("meta", type: "complex", mutability: "readOnly", description: "Resource metadata.", subAttributes:
[
Attr("resourceType", mutability: "readOnly"),
Attr("created", type: "dateTime", mutability: "readOnly"),
Attr("lastModified", type: "dateTime", mutability: "readOnly"),
Attr("location", mutability: "readOnly", type: "reference")
])
]
};
public static ScimSchema GroupSchema { get; } = new()
{
Id = ScimConstants.GroupSchema,
Name = "Group",
Description = "Group",
Meta = new ScimMeta { ResourceType = "Schema", Location = "/scim/v2/Schemas/" + ScimConstants.GroupSchema },
Attributes =
[
Attr("displayName", required: true, description: "A human-readable name for the Group."),
Attr("members", type: "complex", multiValued: true, description: "A list of members of the Group.", subAttributes:
[
Attr("value", description: "Identifier of the member."),
Attr("$ref", type: "reference", description: "The URI of the member."),
Attr("display", mutability: "readOnly", description: "The display name of the member.")
]),
Attr("externalId", description: "An identifier for the resource as defined by the provisioning client.", caseExact: true),
Attr("id", mutability: "readOnly", returned: "always", uniqueness: "server", description: "Unique identifier assigned by the service provider.", caseExact: true),
Attr("meta", type: "complex", mutability: "readOnly", description: "Resource metadata.", subAttributes:
[
Attr("resourceType", mutability: "readOnly"),
Attr("created", type: "dateTime", mutability: "readOnly"),
Attr("lastModified", type: "dateTime", mutability: "readOnly"),
Attr("location", mutability: "readOnly", type: "reference")
])
]
};
///
/// Enterprise User extension (RFC 7643 §4.3) — the attribute set corporate provisioning sends.
/// manager.displayName and manager.$ref are declared readOnly because the provider
/// resolves them from the referenced user; a client that writes them is ignored, by design.
///
public static ScimSchema EnterpriseUserSchema { get; } = new()
{
Id = ScimConstants.EnterpriseUserSchema,
Name = "EnterpriseUser",
Description = "Enterprise User",
Meta = new ScimMeta { ResourceType = "Schema", Location = "/scim/v2/Schemas/" + ScimConstants.EnterpriseUserSchema },
Attributes =
[
Attr("employeeNumber", description: "Numeric or alphanumeric identifier assigned to a person, typically based on order of hire or association with an organization."),
Attr("costCenter", description: "Identifies the name of a cost center."),
Attr("organization", description: "Identifies the name of an organization."),
Attr("division", description: "Identifies the name of a division."),
Attr("department", description: "Identifies the name of a department."),
Attr("manager", type: "complex", description: "The user's manager.", subAttributes:
[
Attr("value", description: "The id of the SCIM resource representing the user's manager."),
Attr("$ref", type: "reference", description: "The URI of the SCIM resource representing the user's manager."),
Attr("displayName", mutability: "readOnly", description: "The displayName of the user's manager, resolved by the service provider.")
])
]
};
private static ScimSchemaAttribute Attr(
string name,
string type = "string",
bool multiValued = false,
bool required = false,
string? description = null,
string mutability = "readWrite",
string returned = "default",
string uniqueness = "none",
bool caseExact = false,
List? subAttributes = null)
{
return new ScimSchemaAttribute
{
Name = name,
Type = type,
MultiValued = multiValued,
Required = required,
Description = description,
Mutability = mutability,
Returned = returned,
Uniqueness = uniqueness,
CaseExact = caseExact,
SubAttributes = subAttributes
};
}
}
Path: redb-identity/src/redb.Identity.Contracts/Scim/ScimUser.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scim/ScimUser.cs
----
using System.Text.Json.Serialization;
using redb.Identity.Contracts.Common;
namespace redb.Identity.Contracts.Scim;
///
/// SCIM 2.0 User resource (RFC 7643 §4.1).
///
public class ScimUser
{
[JsonPropertyName("schemas")]
public string[] Schemas { get; set; } = [ScimConstants.UserSchema];
[JsonPropertyName("id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Id { get; set; }
[JsonPropertyName("externalId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ExternalId { get; set; }
[JsonPropertyName("userName")]
public string UserName { get; set; } = null!;
[JsonPropertyName("name")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ScimName? Name { get; set; }
[JsonPropertyName("displayName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? DisplayName { get; set; }
[JsonPropertyName("active")]
public bool Active { get; set; } = true;
/// Write-only password (RFC 7643 §4.1 — writeOnly, never returned).
[OneTimeSecret]
[JsonPropertyName("password")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Password { get; set; }
[JsonPropertyName("emails")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List? Emails { get; set; }
[JsonPropertyName("phoneNumbers")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List? PhoneNumbers { get; set; }
[JsonPropertyName("addresses")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List? Addresses { get; set; }
[JsonPropertyName("photos")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List? Photos { get; set; }
[JsonPropertyName("groups")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List? Groups { get; set; }
///
/// Enterprise User extension (RFC 7643 §4.3). Namespaced by its schema URN rather than a plain
/// attribute name — that is how SCIM extensions ride on a resource. When populated, the same URN
/// must also be listed in .
///
[JsonPropertyName(ScimConstants.EnterpriseUserSchema)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ScimEnterpriseUser? Enterprise { get; set; }
[JsonPropertyName("meta")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ScimMeta? Meta { get; set; }
}
///
/// SCIM Name component (RFC 7643 §4.1.1).
///
public class ScimName
{
[JsonPropertyName("formatted")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Formatted { get; set; }
[JsonPropertyName("familyName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? FamilyName { get; set; }
[JsonPropertyName("givenName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? GivenName { get; set; }
}
///
/// SCIM Address (RFC 7643 §4.1.2).
///
public class ScimAddress
{
[JsonPropertyName("streetAddress")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? StreetAddress { get; set; }
[JsonPropertyName("locality")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Locality { get; set; }
[JsonPropertyName("region")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Region { get; set; }
[JsonPropertyName("postalCode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? PostalCode { get; set; }
[JsonPropertyName("country")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Country { get; set; }
[JsonPropertyName("formatted")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Formatted { get; set; }
[JsonPropertyName("type")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Type { get; set; }
[JsonPropertyName("primary")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool Primary { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Scopes/CreateScopeRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scopes/CreateScopeRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scopes;
public sealed class CreateScopeRequest
{
[Required(AllowEmptyStrings = false, ErrorMessage = "name is required.")]
[StringLength(200, MinimumLength = 1)]
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("resources")]
public string[]? Resources { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Scopes/ScopeResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scopes/ScopeResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scopes;
public sealed class ScopeResponse
{
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("name")]
public string? Name { get; set; }
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("resources")]
public string[]? Resources { get; set; }
[JsonPropertyName("concurrencyToken")]
public string? ConcurrencyToken { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Scopes/UpdateScopeRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Scopes/UpdateScopeRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Scopes;
public sealed class UpdateScopeRequest
{
[Required(AllowEmptyStrings = false, ErrorMessage = "id is required.")]
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("resources")]
public string[]? Resources { get; set; }
[JsonPropertyName("concurrencyToken")]
public string? ConcurrencyToken { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Serialization/IdentityWireProfiles.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Serialization/IdentityWireProfiles.cs
----
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Serialization;
///
/// Locked wire-format JSON profiles for redb.Identity transports
/// (SCIM 2.0, RFC 9457 Problem Details, OAuth 2.0 / OIDC / RFC 7591 DCR).
///
/// These options are fixed by IETF RFCs and MUST NOT be made configurable. Identity acts as
/// a SCIM / OAuth 2.0 / OIDC provider — wire-level interop is negotiated by the specs listed
/// below, not by application config. Exposing options would silently break compatibility.
///
///
/// Lives in redb.Identity.Contracts (no Route framework dependency) so transport
/// facades — HTTP, gRPC, etc. — can consume the same locked options without taking a
/// project-reference on Core. Core re-exports these as IMessageSerializer singletons
/// for use by the route data-format registry.
///
/// Specification anchors:
///
/// - RFC 8259 §8.1 — JSON between non-closed systems MUST use UTF-8.
/// - RFC 7644 §3 — SCIM media type application/scim+json; attribute names
/// verbatim per RFC 7643 §7 (no naming-policy transform).
/// - RFC 9457 §3 — Problem Details media type application/problem+json;
/// §3.1 lowercase members (type, title, status, detail,
/// instance).
/// - RFC 6749 §5.1 — OAuth 2.0 token responses application/json, UTF-8,
/// snake_case members carried by DTOs via .
/// - RFC 7591 §3.2 — Dynamic Client Registration response naming as request
/// (snake_case, spec-defined).
/// - OpenID Connect Discovery 1.0 §4.2 — JSON object, UTF-8.
///
///
public static class IdentityWireProfiles
{
// ── Media-type constants ─────────────────────────────────────────────────
/// SCIM 2.0 protocol media type — RFC 7644 §3.
public const string ScimMediaType = "application/scim+json";
/// Problem Details media type — RFC 9457 §3.
public const string ProblemMediaType = "application/problem+json";
/// OAuth / OIDC / DCR JSON media type — RFC 6749 §5.1, OIDC Discovery §4.2.
public const string OAuthMediaType = "application/json";
// ── Locked JsonSerializerOptions ─────────────────────────────────────────
/// SCIM response options — RFC 7643/7644.
public static readonly JsonSerializerOptions ScimOptions = BuildScim();
/// Problem Details response options — RFC 9457.
public static readonly JsonSerializerOptions ProblemOptions = BuildProblem();
/// OAuth / OIDC / DCR response options — RFC 6749 §5.1, RFC 7591, OIDC Discovery §4.2.
public static readonly JsonSerializerOptions OAuthOptions = BuildOAuth();
// ── Builders (sealed via trivial serialize so MakeReadOnly() takes effect) ──
private static JsonSerializerOptions BuildScim() => Seal(new JsonSerializerOptions
{
PropertyNamingPolicy = null,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = false
});
private static JsonSerializerOptions BuildProblem() => Seal(new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = false
});
private static JsonSerializerOptions BuildOAuth() => Seal(new JsonSerializerOptions
{
PropertyNamingPolicy = null,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = false
});
///
/// Forces the options into an immutable state (a trivial
/// triggers MakeReadOnly()) so accidental post-publication mutation of the
/// shared singleton can't reshape the wire format.
///
private static JsonSerializerOptions Seal(JsonSerializerOptions options)
{
JsonSerializer.Serialize(0, options);
return options;
}
}
Path: redb-identity/src/redb.Identity.Contracts/Sessions/RevokedSidEntry.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Sessions/RevokedSidEntry.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Sessions;
///
/// One entry in the revoked-sids list returned to a polling Relying Party (RP).
///
/// At least one of or is set:
///
/// - only — single OIDC session was revoked.
/// - only — every session of that subject is revoked
/// (used for "logout everywhere" / admin RevokeAll).
/// - Both — explicit single-session revoke that also carries the subject for forensics.
///
///
/// RP-side cache MUST evict entries past .
///
public sealed class RevokedSidEntry
{
/// OIDC sid claim of the revoked session, when known.
[JsonPropertyName("sid")]
public string? Sid { get; set; }
/// OIDC sub claim — present for "revoke all sessions of subject" entries.
[JsonPropertyName("sub")]
public string? Sub { get; set; }
/// Optional OAuth client_id this revocation applies to. Null = applies to all clients.
[JsonPropertyName("clientId")]
public string? ClientId { get; set; }
/// UTC timestamp the entry was created. RPs use this as the polling cursor.
[JsonPropertyName("revokedAt")]
public DateTimeOffset RevokedAt { get; set; }
/// UTC timestamp after which this entry can be evicted (typically max cookie lifetime).
[JsonPropertyName("expiresAt")]
public DateTimeOffset ExpiresAt { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Sessions/RevokedSidsAddRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Sessions/RevokedSidsAddRequest.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Sessions;
///
/// Request body for POST /api/internal/revoked-sids.
///
/// Caller MUST provide OR (or both). Sub-only marks every
/// session of that subject as revoked — used for "logout everywhere" / admin RevokeAll.
///
///
public sealed class RevokedSidsAddRequest
{
/// OIDC sid claim of the revoked session.
[JsonPropertyName("sid")]
public string? Sid { get; set; }
/// OIDC sub claim. When set without , revokes all sessions of subject.
[JsonPropertyName("sub")]
public string? Sub { get; set; }
/// Optional client_id scope. Null = applies to all clients.
[JsonPropertyName("clientId")]
public string? ClientId { get; set; }
///
/// When the entry expires (RPs use this as TTL for their local cache). Server enforces a
/// configurable upper bound (default 24h).
///
[JsonPropertyName("expiresAt")]
public DateTimeOffset? ExpiresAt { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Sessions/RevokedSidsSinceResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Sessions/RevokedSidsSinceResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Sessions;
///
/// Response of GET /api/internal/revoked-sids/since?cursor=....
///
/// Polling Relying Parties (RPs) call this periodically to refresh their local blacklist.
/// On first call cursor is omitted — server returns a baseline starting from
/// now - retention. Subsequent calls use from previous response.
///
///
public sealed class RevokedSidsSinceResponse
{
/// Entries strictly newer than the supplied cursor, ordered by RevokedAt ascending.
[JsonPropertyName("entries")]
public List Entries { get; set; } = new();
///
/// Cursor to pass on the next polling call. Equals the server-side timestamp of the most
/// recent entry in , or the request cursor when there were no
/// new entries (so the next poll keeps the same window).
///
[JsonPropertyName("nextCursor")]
public DateTimeOffset NextCursor { get; set; }
/// Server time at the moment this response was assembled (for clock-skew diagnostics).
[JsonPropertyName("serverTime")]
public DateTimeOffset ServerTime { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Sessions/SessionPruneResult.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Sessions/SessionPruneResult.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Sessions;
///
/// The answer of the session cleanup: {"prunedSessions":4,"expiredActiveSessions":1}.
///
public sealed class SessionPruneResult
{
/// Revoked sessions past the retention window, removed.
[JsonPropertyName("prunedSessions")]
public int PrunedSessions { get; init; }
/// Sessions still marked active whose lifetime had run out, marked revoked by this pass.
[JsonPropertyName("expiredActiveSessions")]
public int ExpiredActiveSessions { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Sessions/SessionResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Sessions/SessionResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Sessions;
///
/// Session record returned by the management API.
///
public sealed class SessionResponse
{
[JsonPropertyName("sessionId")]
public long SessionId { get; set; }
[JsonPropertyName("userId")]
public long UserId { get; set; }
/// Login of the session owner — populated by the admin list / list-all paths
/// for table rendering. Null when the user no longer exists or lookup failed.
[JsonPropertyName("userLogin")]
public string? UserLogin { get; set; }
[JsonPropertyName("applicationId")]
public long ApplicationId { get; set; }
[JsonPropertyName("clientId")]
public string? ClientId { get; set; }
[JsonPropertyName("applicationName")]
public string? ApplicationName { get; set; }
[JsonPropertyName("status")]
public string? Status { get; set; }
[JsonPropertyName("createdAt")]
public DateTimeOffset? CreatedAt { get; set; }
/// Client IP captured at session creation (sanitized when behind a trusted proxy).
[JsonPropertyName("ipAddress")]
public string? IpAddress { get; set; }
/// Raw User-Agent header at session creation.
[JsonPropertyName("userAgent")]
public string? UserAgent { get; set; }
/// Human-friendly device label (e.g. "Chrome 135 on Windows 10").
[JsonPropertyName("deviceLabel")]
public string? DeviceLabel { get; set; }
/// S-track: timestamp of the most recent token-refresh / cookie / userinfo activity.
[JsonPropertyName("lastAccessedAt")]
public DateTimeOffset? LastAccessedAt { get; set; }
/// S-track: short label of the activity that bumped LastAccessedAt ("refresh_token", "cookie", …).
[JsonPropertyName("lastAccessedBy")]
public string? LastAccessedBy { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Sessions/SessionResults.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Sessions/SessionResults.cs
----
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Sessions;
/// A page of the active sessions of all users, answered by the admin-wide session list.
public sealed class SessionPage
{
[JsonPropertyName("items")]
public required List Items { get; init; }
/// Active sessions in all.
[JsonPropertyName("total")]
public required int Total { get; init; }
[JsonPropertyName("offset")]
public required int Offset { get; init; }
/// The page size asked for.
[JsonPropertyName("count")]
public required int Count { get; init; }
}
///
/// The answer of revoking all sessions of a user with dryRun: how many would be revoked and the ids of the
/// first of them. Nothing is revoked.
///
public sealed class SessionRevokePreview
{
/// Always true.
[JsonPropertyName("success")]
public bool Success { get; } = true;
/// Always true: this is the preview, not the revocation.
[JsonPropertyName("dryRun")]
public bool DryRun { get; } = true;
[JsonPropertyName("wouldRevoke")]
public required int WouldRevoke { get; init; }
[JsonPropertyName("sampleSessionIds")]
public required IReadOnlyList SampleSessionIds { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/SigningKeys/SigningKeyDtos.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/SigningKeys/SigningKeyDtos.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.SigningKeys;
///
/// One row of the signing-key store as exposed by the admin /signing-keys list endpoint.
/// The private material is intentionally never surfaced; only the kid, algorithm metadata,
/// validity window, and active flag travel on the wire.
///
public sealed class SigningKeyResponse
{
[JsonPropertyName("kid")]
public string Kid { get; set; } = "";
[JsonPropertyName("kind")]
public string Kind { get; set; } = "";
[JsonPropertyName("algorithm")]
public string Algorithm { get; set; } = "";
[JsonPropertyName("notBefore")]
public DateTimeOffset NotBefore { get; set; }
[JsonPropertyName("notAfter")]
public DateTimeOffset NotAfter { get; set; }
///
/// true when this key is what OpenIddict picks for NEW token signing. Multiple
/// keys can have NotAfter > now at once (rotation grace window) but at most
/// one of any given Kind is IsActive=true.
///
[JsonPropertyName("isActive")]
public bool IsActive { get; set; }
///
/// true when this row is still inside its validity window
/// ( > now) and therefore still appears in the live JWKS.
///
[JsonPropertyName("inJwks")]
public bool InJwks { get; set; }
}
/// Response shape for GET /signing-keys.
public sealed class SigningKeyListResponse
{
[JsonPropertyName("keys")]
public List Keys { get; set; } = [];
}
/// Request shape for POST /signing-keys/rotate.
public sealed class RotateSigningKeyRequest
{
///
/// Key kind to rotate. Currently supported: "signing" (RSA / RS256) and
/// "encryption" (RSA / RSA-OAEP). Defaults to "signing" when omitted.
///
[JsonPropertyName("kind")]
public string? Kind { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/SigningKeys/SigningKeyRetiredResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/SigningKeys/SigningKeyRetiredResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.SigningKeys;
/// The answer of retiring a signing key: {"success":true,"kid":"..."}.
public sealed class SigningKeyRetiredResponse
{
[JsonPropertyName("success")]
public bool Success { get; init; } = true;
[JsonPropertyName("kid")]
public required string Kid { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Tokens/IntrospectionResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Tokens/IntrospectionResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Tokens;
public sealed class IntrospectionResponse
{
[JsonPropertyName("active")]
public bool Active { get; set; }
[JsonPropertyName("scope")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Scope { get; set; }
[JsonPropertyName("client_id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ClientId { get; set; }
[JsonPropertyName("username")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Username { get; set; }
[JsonPropertyName("token_type")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? TokenType { get; set; }
[JsonPropertyName("exp")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public long? Exp { get; set; }
[JsonPropertyName("iat")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public long? Iat { get; set; }
[JsonPropertyName("sub")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Sub { get; set; }
[JsonPropertyName("aud")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Aud { get; set; }
[JsonPropertyName("iss")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Iss { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Tokens/RevokedCountResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Tokens/RevokedCountResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Tokens;
/// The answer of revoking all tokens of a subject: {"revokedCount":3}.
public sealed class RevokedCountResponse
{
/// Tokens revoked by the call; 0 when the subject had none.
[JsonPropertyName("revokedCount")]
public int RevokedCount { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Tokens/TokenInfoResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Tokens/TokenInfoResponse.cs
----
namespace redb.Identity.Contracts.Tokens;
///
/// Administrative token info (for management endpoint, not OAuth flow).
///
public class TokenInfoResponse
{
public long Id { get; set; }
public long ApplicationObjectId { get; set; }
/// OIDC public sub claim (GUID) of the token's owning user.
public string? Subject { get; set; }
/// Numeric user id resolved from . Populated by the
/// admin list path for table rendering. Null when reverse lookup fails.
public long? SubjectUserId { get; set; }
/// Login of the token's owning user, resolved by the admin list path.
public string? SubjectLogin { get; set; }
/// OAuth client_id of the application the token was issued to.
public string? ClientId { get; set; }
/// Display name of the application the token was issued to.
public string? ApplicationName { get; set; }
public string? Status { get; set; }
public string? Type { get; set; }
public DateTimeOffset CreatedAt { get; set; }
/// Token expiration timestamp (_objects.date_complete).
public DateTimeOffset? ExpiresAt { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Tokens/TokenPrunePreview.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Tokens/TokenPrunePreview.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Tokens;
///
/// The answer of a token prune asked as a dry run: what a prune would remove now, with nothing removed.
///
public sealed class TokenPrunePreview
{
/// Always true: marks the answer as a preview.
[JsonPropertyName("dryRun")]
public bool DryRun { get; init; } = true;
/// Tokens a prune would remove.
[JsonPropertyName("wouldPruneTokens")]
public int WouldPruneTokens { get; init; }
/// Authorizations a prune would remove.
[JsonPropertyName("wouldPruneAuthorizations")]
public int WouldPruneAuthorizations { get; init; }
/// Tokens created before this moment are past the retention window.
[JsonPropertyName("threshold")]
public DateTimeOffset Threshold { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Tokens/TokenPruneResult.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Tokens/TokenPruneResult.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Tokens;
///
/// The answer of a token prune: {"prunedTokens":12,"prunedAuthorizations":3}. Tokens past the retention
/// window are removed, and so are authorizations no token refers to any more.
///
public sealed class TokenPruneResult
{
/// Tokens removed.
[JsonPropertyName("prunedTokens")]
public int PrunedTokens { get; init; }
/// Authorizations removed because no token refers to them.
[JsonPropertyName("prunedAuthorizations")]
public int PrunedAuthorizations { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Tokens/TokenRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Tokens/TokenRequest.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Tokens;
public sealed class TokenRequest
{
[JsonPropertyName("grant_type")]
public string GrantType { get; set; } = string.Empty;
[JsonPropertyName("client_id")]
public string? ClientId { get; set; }
[JsonPropertyName("client_secret")]
public string? ClientSecret { get; set; }
[JsonPropertyName("scope")]
public string? Scope { get; set; }
[JsonPropertyName("code")]
public string? Code { get; set; }
[JsonPropertyName("redirect_uri")]
public string? RedirectUri { get; set; }
[JsonPropertyName("refresh_token")]
public string? RefreshToken { get; set; }
[JsonPropertyName("code_verifier")]
public string? CodeVerifier { get; set; }
[JsonPropertyName("username")]
public string? Username { get; set; }
[JsonPropertyName("password")]
public string? Password { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Tokens/TokenResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Tokens/TokenResponse.cs
----
using System.Text.Json.Serialization;
using redb.Identity.Contracts.Common;
namespace redb.Identity.Contracts.Tokens;
public sealed class TokenResponse
{
[OneTimeSecret]
[JsonPropertyName("access_token")]
public string? AccessToken { get; set; }
[JsonPropertyName("token_type")]
public string TokenType { get; set; } = "Bearer";
[JsonPropertyName("expires_in")]
public long? ExpiresIn { get; set; }
[OneTimeSecret]
[JsonPropertyName("refresh_token")]
public string? RefreshToken { get; set; }
[OneTimeSecret]
[JsonPropertyName("id_token")]
public string? IdToken { get; set; }
[JsonPropertyName("scope")]
public string? Scope { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/AddressDto.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/AddressDto.cs
----
namespace redb.Identity.Contracts.Users;
///
/// OIDC structured address claim (§5.1.1).
/// Used in user management API requests/responses.
///
public class AddressDto
{
public string? StreetAddress { get; set; }
public string? Locality { get; set; }
public string? Region { get; set; }
public string? PostalCode { get; set; }
public string? Country { get; set; }
public string? Formatted { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/AdminResetPasswordRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/AdminResetPasswordRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
///
/// Admin-side password reset for a user, bypassing the "old password" challenge
/// that the user-facing requires. Reserved for
/// the management API (gated by identity:users.manage / identity:manage
/// scope) — never invoked from the user's own profile flow.
///
public class AdminResetPasswordRequest
{
/// Internal numeric user id (server fills this from the route).
[Required]
public long Id { get; set; }
///
/// New password. Server-side validation runs the same complexity policy as
/// the user-facing change-password endpoint (length, history, banned list).
///
[Required]
public required string NewPassword { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/ChangeEmailConfirmRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/ChangeEmailConfirmRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
///
/// N-4 (Session E, sub-step N4-7): request body for
/// direct-vm://identity-change-email-confirm (and the HTTP facade
/// POST /api/v1/identity/account/change-email/confirm). Anonymous endpoint;
/// rate-limited at the HTTP facade.
///
public class ChangeEmailConfirmRequest
{
/// Per-issuance identifier captured from the confirm URL ?jti=....
[Required]
public required string Jti { get; set; }
/// Plaintext token captured from the confirm URL ?token=....
[Required]
public required string Token { get; set; }
}
///
/// N-4 (Session E, sub-step N4-7): response for the confirm endpoint.
///
/// On failure (bad / expired / consumed token, race detected, new address taken since
/// issue) returns the generic OAuth-style invalid_token error — granular reasons
/// are recorded to audit only.
///
///
public class ChangeEmailConfirmResponse
{
/// true on success; the user's e-mail is now NewEmail and verified.
public bool Success { get; set; }
/// OAuth-style error code on failure (always invalid_token).
public string? Error { get; set; }
/// Human-readable error description (generic).
public string? ErrorDescription { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/ChangeEmailRequestRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/ChangeEmailRequestRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
///
/// N-4 (Session E, sub-step N4-7): request body for
/// direct-vm://identity-me-change-email-request (and the HTTP facade
/// POST /api/v1/identity/me/change-email/request).
///
/// Authenticated endpoint: the caller user is derived from the access-token subject.
/// The body carries the address the user wants to switch to plus the BFF's
/// ClientId and the page that will host the confirmation form.
///
///
public class ChangeEmailRequestRequest
{
///
/// Target e-mail address the user wishes to use going forward. Confirmation link is
/// dispatched to THIS address; the current address remains the canonical login until
/// the user proves control of the new one.
///
[Required]
public required string NewEmail { get; set; }
///
/// OAuth client_id of the BFF initiating the change. Used to look up the per-client
/// confirm-URL whitelist on ApplicationProps.ChangeEmailUris.
///
[Required]
public required string ClientId { get; set; }
///
/// The page that will host the confirmation (e.g.
/// https://app.example.com/change-email). Must match one of the client's
/// ChangeEmailUris exactly (string compare); otherwise the request is rejected.
/// The confirm link is composed as {CallerConfirmUrl}?token={plaintext}&jti={jti}.
///
[Required]
public required string CallerConfirmUrl { get; set; }
}
///
/// N-4 (Session E, sub-step N4-7): response for the request endpoint. Always
/// = true when validation passes; failures surface as the
/// standard error envelope.
///
public class ChangeEmailRequestResponse
{
/// true for a successful dispatch attempt.
public bool Success { get; set; } = true;
}
Path: redb-identity/src/redb.Identity.Contracts/Users/ChangePasswordRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/ChangePasswordRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
public class ChangePasswordRequest
{
[Required]
public long Id { get; set; }
[Required]
public required string OldPassword { get; set; }
[Required]
public required string NewPassword { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/CreateUserRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/CreateUserRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
public class CreateUserRequest
{
[Required]
public required string Login { get; set; }
[Required]
public required string Password { get; set; }
public string? DisplayName { get; set; }
public string? Email { get; set; }
public string? PhoneNumber { get; set; }
public string? GivenName { get; set; }
public string? FamilyName { get; set; }
public string? Picture { get; set; }
///
/// S2 — optional custom claims dictionary applied at create time so an
/// admin can satisfy required ClaimDefinitionProps in a single
/// POST. Validated against the global schema; required claims without a
/// default and not supplied here cause 400 validation_error.
///
public Dictionary? CustomClaims { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/EmailVerifyConfirmRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/EmailVerifyConfirmRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
///
/// N-4 (Session C, sub-step N4-6): request body for
/// direct-vm://identity-email-verify-confirm (and the HTTP facade
/// POST /api/v1/identity/account/verify-email/confirm).
/// Anonymous endpoint; rate-limited at the HTTP facade.
///
public class EmailVerifyConfirmRequest
{
/// Per-issuance identifier captured from the verify URL ?jti=....
[Required]
public required string Jti { get; set; }
/// Plaintext token captured from the verify URL ?token=....
[Required]
public required string Token { get; set; }
}
///
/// N-4 (Session C, sub-step N4-6): response for the confirm endpoint.
///
/// On failure (bad / expired / consumed token, or e-mail changed since issue) returns
/// the generic OAuth-style invalid_token error — granular reasons are recorded
/// to audit only, never returned to anonymous callers (defence against enumeration of
/// jti values).
///
///
public class EmailVerifyConfirmResponse
{
/// true on success; the user's EmailVerified flag is now true.
public bool Success { get; set; }
/// OAuth-style error code on failure (always invalid_token).
public string? Error { get; set; }
/// Human-readable error description (generic).
public string? ErrorDescription { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/EmailVerifySendRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/EmailVerifySendRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
///
/// N-4 (Session C, sub-step N4-6): request body for
/// direct-vm://identity-me-email-verify-send (and the HTTP facade
/// POST /api/v1/identity/me/verify-email/send).
///
/// Authenticated endpoint: the user + target e-mail are taken from the access-token
/// subject, so a caller cannot trigger a verify e-mail to someone else's inbox.
///
///
public class EmailVerifySendRequest
{
///
/// OAuth client_id of the BFF initiating the verification. Used to look up the
/// per-client verify-URL whitelist on ApplicationProps.EmailVerifyUris.
///
[Required]
public required string ClientId { get; set; }
///
/// The page that will host the verify-confirmation (e.g.
/// https://app.example.com/verify-email). Must match one of the client's
/// EmailVerifyUris exactly (string compare); otherwise the request is
/// silently dropped (success returned for anti-enumeration symmetry with forgot).
/// The verify link e-mailed to the user is composed as
/// {CallerVerifyUrl}?token={plaintext}&jti={jti}.
///
[Required]
public required string CallerVerifyUrl { get; set; }
}
///
/// N-4 (Session C, sub-step N4-6): generic response for the send endpoint. Always
/// = true when authentication passes. Reserved for future
/// fatal-error signaling (e.g. SMTP down).
///
public class EmailVerifySendResponse
{
/// Always true for a successful dispatch attempt.
public bool Success { get; set; } = true;
}
Path: redb-identity/src/redb.Identity.Contracts/Users/ExternalIdentityDto.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/ExternalIdentityDto.cs
----
namespace redb.Identity.Contracts.Users;
///
/// DTO representing a federation identity link to an external provider.
///
public class ExternalIdentityDto
{
/// Subject identifier in the external system (OIDC sub, LDAP DN, SAML NameID).
public string? Sub { get; set; }
/// When this identity was linked to the local user.
public DateTimeOffset LinkedAt { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/ImpersonationResponses.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/ImpersonationResponses.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Users;
/// The answer of starting an impersonation: the user the administrator now acts as.
public sealed class ImpersonationStartedResponse
{
[JsonPropertyName("targetUserId")]
public long TargetUserId { get; init; }
[JsonPropertyName("targetLogin")]
public string? TargetLogin { get; init; }
}
/// The answer of stopping an impersonation: {"stopped":true}.
public sealed class ImpersonationStoppedResponse
{
[JsonPropertyName("stopped")]
public bool Stopped { get; init; } = true;
}
Path: redb-identity/src/redb.Identity.Contracts/Users/MeChangePasswordRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/MeChangePasswordRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
///
/// Self-service password change request for PUT /me/password.
/// Caller identity is taken from the access-token subject — no Id is accepted.
///
public class MeChangePasswordRequest
{
[Required]
public required string OldPassword { get; set; }
[Required]
public required string NewPassword { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/MeUpdateProfileRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/MeUpdateProfileRequest.cs
----
namespace redb.Identity.Contracts.Users;
///
/// Self-service profile update request for PUT /me. Caller identity is derived
/// from the authenticated access-token subject; Id is NOT accepted in the body.
/// Admin-only fields (Status, EmailVerified, PhoneNumberVerified)
/// are intentionally absent — a user cannot grant themselves verified flags or toggle
/// their own account status. Changes to those fields require the admin
/// PUT /users/{id} endpoint via identity:manage scope.
///
public class MeUpdateProfileRequest
{
public string? DisplayName { get; set; }
public string? Email { get; set; }
public string? PhoneNumber { get; set; }
// OIDC Core §5.1 `profile` claims. The whole set is settable here so userinfo can return it —
// the conformance suite checks userinfo against exactly this list for scope=profile.
public string? GivenName { get; set; }
public string? FamilyName { get; set; }
public string? MiddleName { get; set; }
public string? Nickname { get; set; }
/// Shorthand name for the RP's UI. Falls back to the login when unset.
public string? PreferredUsername { get; set; }
/// URL of the user's profile page (OIDC: profile).
public string? Profile { get; set; }
public string? Picture { get; set; }
public string? Website { get; set; }
public string? Gender { get; set; }
/// ISO 8601 YYYY-MM-DD (a bare year is allowed).
public string? Birthdate { get; set; }
/// IANA time-zone name, e.g. "Europe/Moscow".
public string? ZoneInfo { get; set; }
/// BCP 47 language tag, e.g. "ru-RU".
public string? Locale { get; set; }
/// OIDC structured address (§5.1.1). Null = no change, empty object = clear.
public AddressDto? Address { get; set; }
/// Arbitrary custom claims. Null = no change. Keys merged (overwrite).
public Dictionary? CustomClaims { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/PasswordForgotRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/PasswordForgotRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
///
/// N-4 (Session C): request body for direct-vm://identity-password-forgot
/// (and the HTTP facade POST /api/v1/identity/password/forgot).
///
/// Always returns success to the caller regardless of whether matches
/// an existing user — this is the anti-enumeration contract. The processor only sends an
/// e-mail when the (email, clientId, callerResetUrl) tuple resolves to a real user and the
/// reset URL is in the client's ApplicationProps.PasswordResetUris whitelist.
///
///
public class PasswordForgotRequest
{
/// User-supplied e-mail. Looked up against UserSearchCriteria.EmailExact.
[Required]
public required string Email { get; set; }
///
/// OAuth client_id of the BFF initiating the reset. Used to look up the per-client
/// password-reset URL whitelist on ApplicationProps.PasswordResetUris.
///
[Required]
public required string ClientId { get; set; }
///
/// The page that will host the reset form (e.g. https://app.example.com/reset-password).
/// Must match one of the client's PasswordResetUris exactly (string compare); if
/// not, the request is silently dropped (anti-enumeration: still returns success).
/// The reset link e-mailed to the user is composed as
/// {CallerResetUrl}?token={plaintext}&jti={jti}.
///
[Required]
public required string CallerResetUrl { get; set; }
}
///
/// N-4 (Session C): generic response for the forgot endpoint. Always
/// = true to prevent account enumeration via the response
/// body. The HTTP facade should also normalize timing to a constant ceiling.
///
public class PasswordForgotResponse
{
/// Always true. Reserved for future fatal-error signaling (e.g. SMTP down).
public bool Success { get; set; } = true;
}
Path: redb-identity/src/redb.Identity.Contracts/Users/PasswordResetRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/PasswordResetRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
///
/// N-4 (Session C): request body for direct-vm://identity-password-reset
/// (and the HTTP facade POST /api/v1/identity/password/reset).
///
/// Carries the (, ) pair extracted from the reset link
/// plus the new password. The processor verifies + atomically consumes the token via
/// IPasswordResetTokenStore, validates the new password against the policy, sets it
/// via IUserProvider.SetPasswordAsync, and revokes every active session for the user.
///
///
public class PasswordResetRequest
{
/// Per-issuance identifier emitted by IPasswordResetTokenStore.IssueAsync.
[Required]
public required string Jti { get; set; }
/// Plaintext reset token (32-byte base64url) from the reset link.
[Required]
public required string Token { get; set; }
/// New password. Validated against the configured password policy before persistence.
[Required]
public required string NewPassword { get; set; }
}
///
/// N-4 (Session C): response for the reset endpoint. On success, is
/// true and reports how many active sessions were
/// invalidated by the change. On failure (bad / expired / consumed token, policy
/// violation), is false and carries a
/// short machine-readable code — error descriptions are intentionally generic to deny
/// guessing attempts useful signal.
///
public class PasswordResetResponse
{
public bool Success { get; set; }
public string? Error { get; set; }
public string? ErrorDescription { get; set; }
public int SessionsRevoked { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/RegisterAccountRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/RegisterAccountRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
///
/// N-3 (sub-step N3-6/N3-7): request body for self-service account registration
/// (direct-vm://identity-account-register and the HTTP facade
/// POST /api/v1/identity/account/register).
///
/// Endpoint is anonymous and gated by RedbIdentityOptions.Registration.Enabled;
/// when the master switch is off the route is not built and the facade returns 404.
/// Rate-limiting is layered upstream identically to .
///
///
public class RegisterAccountRequest
{
///
/// Desired login. Must be unique. Same validation as the admin CreateUser path
/// (length, allowed characters). Stored as _users.login.
///
[Required]
public required string Login { get; set; }
///
/// Initial password. Validated against the full server-side password policy
/// (length + composition + history + breach) before storage.
///
[Required]
public required string Password { get; set; }
///
/// Required e-mail address. Unlike the admin path, anonymous registration cannot
/// leave the e-mail empty — it is the only mechanism for password recovery /
/// e-mail verification later, and it is the natural duplicate-account guard.
///
[Required]
public required string Email { get; set; }
/// Optional display name. Defaults to the login when omitted.
public string? DisplayName { get; set; }
}
///
/// N-3: response for . The processor returns
/// = true together with the new user id on success, and a
/// structured error code on failure (validation / duplicate / disabled). Unlike the
/// password-recovery endpoint this is NOT an anti-enumeration surface — duplicate
/// login / e-mail must be visible so the UI can render an actionable message.
///
public class RegisterAccountResponse
{
/// true when the account was created and persisted.
public bool Success { get; set; }
/// Identifier of the newly created user. Populated only when = true.
public long? UserId { get; set; }
/// Echo of Login on success — useful for the BFF auto-sign-in step.
public string? Login { get; set; }
///
/// Stable machine-readable error code on failure: validation_error /
/// duplicate / registration_disabled / weak_password.
///
public string? Error { get; set; }
/// Human-readable description for the failing case. Safe to surface to the user.
public string? ErrorDescription { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/UpdateUserRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/UpdateUserRequest.cs
----
using System.ComponentModel.DataAnnotations;
namespace redb.Identity.Contracts.Users;
public class UpdateUserRequest
{
[Required]
public long Id { get; set; }
public string? DisplayName { get; set; }
public string? Status { get; set; }
public string? Email { get; set; }
public bool? EmailVerified { get; set; }
public string? PhoneNumber { get; set; }
public bool? PhoneNumberVerified { get; set; }
public string? GivenName { get; set; }
public string? FamilyName { get; set; }
public string? Picture { get; set; }
/// OIDC structured address (§5.1.1). Null = no change, empty object = clear.
public AddressDto? Address { get; set; }
/// Arbitrary claims dictionary. Null = no change. Merged with existing (keys overwrite).
public Dictionary? CustomClaims { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Users/UserResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Users/UserResponse.cs
----
namespace redb.Identity.Contracts.Users;
public class UserResponse
{
public long Id { get; set; }
///
/// Public OIDC sub claim — stable per-user GUID emitted in every
/// id_token / access_token issued for this user. Distinct from
/// (the internal bigint primary key used by admin API
/// paths). Null when the user has no OIDC profile object yet (e.g.
/// freshly imported via SCIM before first sign-in initialises one).
///
public Guid? SubjectGuid { get; set; }
public string? Login { get; set; }
public string? DisplayName { get; set; }
public string? Status { get; set; }
public string? Email { get; set; }
public bool EmailVerified { get; set; }
public string? PhoneNumber { get; set; }
public bool PhoneNumberVerified { get; set; }
// OIDC Core §5.1 `profile` claims (the set userinfo returns for scope=profile).
public string? GivenName { get; set; }
public string? FamilyName { get; set; }
public string? MiddleName { get; set; }
public string? Nickname { get; set; }
public string? PreferredUsername { get; set; }
public string? Profile { get; set; }
public string? Picture { get; set; }
public string? Website { get; set; }
public string? Gender { get; set; }
public string? Birthdate { get; set; }
public string? ZoneInfo { get; set; }
public string? Locale { get; set; }
public AddressDto? Address { get; set; }
public Dictionary? CustomClaims { get; set; }
/// Federation identities keyed by provider ID. Null if local-only user.
public Dictionary? ExternalIdentities { get; set; }
public DateTimeOffset CreatedAt { get; set; }
public DateTimeOffset ModifiedAt { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Validation/RequestValidator.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Validation/RequestValidator.cs
----
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace redb.Identity.Contracts.Validation;
///
/// Centralised DataAnnotations-driven request DTO validation.
/// Returns a uniform problem response compatible with the management API
/// error contract — { error = "invalid_request", error_description, validation_errors[] } —
/// which
/// then maps to HTTP 400 (E6 / D5 unified error format).
///
public static class RequestValidator
{
///
/// Validates using .
/// Returns null if the DTO is valid; otherwise a problem object the controller
/// can return as-is (the post-dispatch status mapper turns it into HTTP 400).
///
public static object? Validate(object? request)
{
if (request is null)
{
return new ValidationErrorResponse
{
ErrorDescription = "Request body is required.",
ValidationErrors = System.Array.Empty()
};
}
var ctx = new ValidationContext(request);
var results = new List();
if (Validator.TryValidateObject(request, ctx, results, validateAllProperties: true))
return null;
var errors = results
.Select(r => r.ErrorMessage ?? "Invalid value.")
.ToArray();
return new ValidationErrorResponse
{
ErrorDescription = errors.Length > 0 ? errors[0] : "Request validation failed.",
ValidationErrors = errors
};
}
}
Path: redb-identity/src/redb.Identity.Contracts/Validation/ScimRequestValidator.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Validation/ScimRequestValidator.cs
----
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using redb.Identity.Contracts.Scim;
namespace redb.Identity.Contracts.Validation;
///
/// SCIM 2.0 request DTO validation. Returns a populated
/// (RFC 7644 §3.12) when validation fails so the SCIM status mapper turns
/// the response into HTTP 400 with scimType=invalidValue.
///
public static class ScimRequestValidator
{
/// Validates the SCIM request DTO.
public static ScimError? Validate(object? request)
{
if (request is null)
{
return new ScimError
{
Status = "400",
ScimType = "invalidValue",
Detail = "Request body is required."
};
}
var ctx = new ValidationContext(request);
var results = new List();
if (Validator.TryValidateObject(request, ctx, results, validateAllProperties: true))
return null;
var detail = results
.Select(r => r.ErrorMessage ?? "Invalid value.")
.FirstOrDefault() ?? "Request validation failed.";
return new ScimError
{
Status = "400",
ScimType = "invalidValue",
Detail = detail
};
}
}
Path: redb-identity/src/redb.Identity.Contracts/Validation/ValidationErrorResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Validation/ValidationErrorResponse.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Validation;
///
/// The refusal of a request that fails its declared validation rules: the first rule broken as the
/// description, every rule broken in . The status mapper answers it with 400.
///
public sealed class ValidationErrorResponse
{
[JsonPropertyName("error")]
public string Error { get; init; } = "validation_error";
[JsonPropertyName("error_description")]
public required string ErrorDescription { get; init; }
[JsonPropertyName("validation_errors")]
public required string[] ValidationErrors { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Webhooks/CreateWebhookSubscriptionRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Webhooks/CreateWebhookSubscriptionRequest.cs
----
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Webhooks;
public sealed class CreateWebhookSubscriptionRequest
{
[Required(AllowEmptyStrings = false)]
[JsonPropertyName("url")]
public required string Url { get; set; }
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
/// "*" (default) or comma-separated event ids / cat: tokens.
[JsonPropertyName("eventTypeFilter")]
public string? EventTypeFilter { get; set; }
[JsonPropertyName("enabled")]
public bool? Enabled { get; set; }
[JsonPropertyName("timeoutMs")]
public int? TimeoutMs { get; set; }
[JsonPropertyName("maxAttempts")]
public int? MaxAttempts { get; set; }
[JsonPropertyName("retryBackoffMs")]
public int? RetryBackoffMs { get; set; }
[JsonPropertyName("extraHeaders")]
public Dictionary? ExtraHeaders { get; set; }
///
/// Optional operator-supplied HMAC secret. When omitted the server
/// generates a 256-bit random secret. When supplied, must be at least
/// 16 chars (basic strength check).
///
[JsonPropertyName("hmacSecret")]
public string? HmacSecret { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Webhooks/UpdateWebhookSubscriptionRequest.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Webhooks/UpdateWebhookSubscriptionRequest.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Webhooks;
///
/// Null fields preserve existing values (PATCH semantics). HMAC secret is
/// managed through the dedicated rotate endpoint to keep the lifecycle
/// explicit and audit-friendly.
///
public sealed class UpdateWebhookSubscriptionRequest
{
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("url")]
public string? Url { get; set; }
[JsonPropertyName("eventTypeFilter")]
public string? EventTypeFilter { get; set; }
[JsonPropertyName("enabled")]
public bool? Enabled { get; set; }
[JsonPropertyName("timeoutMs")]
public int? TimeoutMs { get; set; }
[JsonPropertyName("maxAttempts")]
public int? MaxAttempts { get; set; }
[JsonPropertyName("retryBackoffMs")]
public int? RetryBackoffMs { get; set; }
[JsonPropertyName("extraHeaders")]
public Dictionary? ExtraHeaders { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/Webhooks/WebhookDeliveryPage.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Webhooks/WebhookDeliveryPage.cs
----
using System.Text.Json.Serialization;
namespace redb.Identity.Contracts.Webhooks;
/// A page of the delivery outbox (webhooks and audit targets), newest first, without payloads.
public sealed class WebhookDeliveryPage
{
[JsonPropertyName("items")]
public required List Items { get; init; }
[JsonPropertyName("offset")]
public int Offset { get; init; }
[JsonPropertyName("count")]
public int Count { get; init; }
}
/// One row of the delivery outbox.
public sealed class WebhookDeliveryItem
{
[JsonPropertyName("id")]
public long Id { get; init; }
[JsonPropertyName("deliveryId")]
public string? DeliveryId { get; init; }
[JsonPropertyName("eventId")]
public string? EventId { get; init; }
/// webhook or an audit target kind.
[JsonPropertyName("kind")]
public required string Kind { get; init; }
/// A subscription id or an audit target name.
[JsonPropertyName("destination")]
public required string Destination { get; init; }
[JsonPropertyName("eventType")]
public required string EventType { get; init; }
[JsonPropertyName("status")]
public required string Status { get; init; }
[JsonPropertyName("attempts")]
public int Attempts { get; init; }
[JsonPropertyName("lastError")]
public string? LastError { get; init; }
[JsonPropertyName("createdAt")]
public string? CreatedAt { get; init; }
[JsonPropertyName("nextAttemptAt")]
public string? NextAttemptAt { get; init; }
[JsonPropertyName("finishedAt")]
public string? FinishedAt { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Webhooks/WebhookSecretRotatedResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Webhooks/WebhookSecretRotatedResponse.cs
----
using System.Text.Json.Serialization;
using redb.Identity.Contracts.Common;
namespace redb.Identity.Contracts.Webhooks;
///
/// The answer of rotating a webhook secret when the subscription could not be read back right after the
/// rotation. It carries the new HMAC secret, which is shown this once; the usual answer is the subscription
/// itself () with the secret included.
///
public sealed class WebhookSecretRotatedResponse
{
[JsonPropertyName("success")]
public bool Success { get; init; } = true;
[OneTimeSecret]
[JsonPropertyName("hmacSecret")]
public required string HmacSecret { get; init; }
}
Path: redb-identity/src/redb.Identity.Contracts/Webhooks/WebhookSubscriptionResponse.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/Webhooks/WebhookSubscriptionResponse.cs
----
using System.Text.Json.Serialization;
using redb.Identity.Contracts.Common;
namespace redb.Identity.Contracts.Webhooks;
public sealed class WebhookSubscriptionResponse
{
[JsonPropertyName("id")]
public long Id { get; set; }
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
[JsonPropertyName("description")]
public string? Description { get; set; }
[JsonPropertyName("url")]
public string Url { get; set; } = "";
[JsonPropertyName("eventTypeFilter")]
public string EventTypeFilter { get; set; } = "*";
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } = true;
[JsonPropertyName("timeoutMs")]
public int TimeoutMs { get; set; }
[JsonPropertyName("maxAttempts")]
public int MaxAttempts { get; set; }
[JsonPropertyName("retryBackoffMs")]
public int RetryBackoffMs { get; set; }
[JsonPropertyName("extraHeaders")]
public Dictionary? ExtraHeaders { get; set; }
///
/// Plaintext HMAC secret — populated ONLY on the create response and
/// the secret-rotate response. List / get / update never return it.
///
[OneTimeSecret]
[JsonPropertyName("hmacSecret")]
public string? HmacSecret { get; set; }
/// True after the first delivery / get / list response when the secret is server-resident only.
[JsonPropertyName("hasHmacSecret")]
public bool HasHmacSecret { get; set; }
[JsonPropertyName("createdAt")]
public DateTimeOffset? CreatedAt { get; set; }
[JsonPropertyName("modifiedAt")]
public DateTimeOffset? ModifiedAt { get; set; }
}
Path: redb-identity/src/redb.Identity.Contracts/redb.Identity.Contracts.csproj
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/src/redb.Identity.Contracts/redb.Identity.Contracts.csproj
----
redb.Identity.Contracts
redb.Identity.Contracts
Transport-agnostic request/response DTOs and route-name constants for redb.Identity, shared by Core, Http and Client.