BearerAuthGroup

public struct BearerAuthGroup<T> : Endpoint where T : CorvusModelTokenAuthenticatable

A special type of Group that protects its content with bearer token authentication for a generic CorvusModelTokenAuthenticatable.

  • The content of the BearerAuthGroup, which can be any kind of Corvus component.

    Declaration

    Swift

    public var content: Endpoint
  • Creates a BearerAuthGroup from a path and a builder function passed as a closure.

    Declaration

    Swift

    public init(
        _ pathComponents: PathComponent...,
        @EndpointBuilder content: () -> Endpoint
    )

    Parameters

    pathComponents

    One or more objects describing the route.

    content

    An EndpointBuilder, which is a function builder that takes in multiple Endpoints and returns them as a single Endpoint.

  • A method that registers the content of the BearerAuthGroup to the supplied RoutesBuilder. It also registers basic authentication middleware using Tconforming to CorvusModelUserToken.

    Declaration

    Swift

    public func register(to routes: RoutesBuilder)

    Parameters

    routes

    A RoutesBuilder containing all the information about the HTTP route leading to the current component.