Class IdentityEndpointConventionBuilderExtensions
Namespace: Cephalon.Identity.AspNetCore.Transports.Rest
Assembly: Cephalon.Identity.AspNetCore.dll
Adds Cephalon-specific authorization conventions to REST route handlers and groups.
public static class IdentityEndpointConventionBuilderExtensionsInheritance
Section titled “Inheritance”object ← IdentityEndpointConventionBuilderExtensions
Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Methods
Section titled “Methods”RequireCephalonAuthorization(RouteHandlerBuilder, string, string?, string?, string?, string?, string?)
Section titled “ RequireCephalonAuthorization(RouteHandlerBuilder, string, string?, string?, string?, string?, string?)”Requires a Cephalon authorization decision before a REST route handler can execute.
public static RouteHandlerBuilder RequireCephalonAuthorization(this RouteHandlerBuilder builder, string policyId, string? action = null, string? resourceType = null, string? resourceIdRouteKey = null, string? tenantRouteKey = null, string? ownerSubjectIdRouteKey = null)Parameters
Section titled “Parameters”builder RouteHandlerBuilder
The route handler builder to protect.
policyId string
The Cephalon authorization policy id that must allow the request.
action string?
The optional action to evaluate. When omitted, the adapter maps the HTTP method to a conventional action such as
read, create, update, or delete.
resourceType string?
The optional logical resource type. When omitted, the adapter derives it from the final literal segment in the endpoint route pattern.
resourceIdRouteKey string?
The optional route-value key that provides the resource identifier. When omitted, the adapter falls back to the configured resource-id route keys.
tenantRouteKey string?
The optional route-value key that provides the tenant identifier. When omitted, the adapter falls back to the configured tenant route keys and tenant headers.
ownerSubjectIdRouteKey string?
The optional route-value key that provides the owning subject identifier for owner-based policies.
Returns
Section titled “Returns”The same route handler builder for fluent convention chaining.
Remarks
Section titled “Remarks”This helper keeps ASP.NET Core principal and route parsing in the host layer while still evaluating the shared
Cephalon authorization contracts through
RequireCephalonAuthorization(RouteGroupBuilder, string, string?, string?, string?, string?, string?)
Section titled “ RequireCephalonAuthorization(RouteGroupBuilder, string, string?, string?, string?, string?, string?)”Requires a Cephalon authorization decision before every REST route handler in the route group can execute.
public static RouteGroupBuilder RequireCephalonAuthorization(this RouteGroupBuilder builder, string policyId, string? action = null, string? resourceType = null, string? resourceIdRouteKey = null, string? tenantRouteKey = null, string? ownerSubjectIdRouteKey = null)Parameters
Section titled “Parameters”builder RouteGroupBuilder
The route group builder to protect.
policyId string
The Cephalon authorization policy id that must allow the request.
action string?
The optional action to evaluate. When omitted, the adapter maps the HTTP method to a conventional action such as
read, create, update, or delete.
resourceType string?
The optional logical resource type. When omitted, the adapter derives it from the final literal segment in the endpoint route pattern.
resourceIdRouteKey string?
The optional route-value key that provides the resource identifier. When omitted, the adapter falls back to the configured resource-id route keys.
tenantRouteKey string?
The optional route-value key that provides the tenant identifier. When omitted, the adapter falls back to the configured tenant route keys and tenant headers.
ownerSubjectIdRouteKey string?
The optional route-value key that provides the owning subject identifier for owner-based policies.
Returns
Section titled “Returns”The same route group builder for fluent convention chaining.
WithCephalonAuthenticationSchemes<TBuilder>(TBuilder, params string[])
Section titled “ WithCephalonAuthenticationSchemes<TBuilder>(TBuilder, params string[])”Declares the ASP.NET Core authentication schemes that should own challenge and forbid responses for an endpoint or route group.
public static TBuilder WithCephalonAuthenticationSchemes<TBuilder>(this TBuilder builder, params string[] authenticationSchemes) where TBuilder : IEndpointConventionBuilderParameters
Section titled “Parameters”builder TBuilder
The endpoint or route-group builder to annotate.
authenticationSchemes string[]
The authentication scheme names to use for boundary responses.
Returns
Section titled “Returns”TBuilder
The same builder for fluent chaining.
Type Parameters
Section titled “Type Parameters”TBuilder
The endpoint convention builder type.