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
BearerAuthGroupfrom a path and a builder function passed as a closure.Declaration
Swift
public init( _ pathComponents: PathComponent..., @EndpointBuilder content: () -> Endpoint )Parameters
pathComponentsOne or more objects describing the route.
contentAn
EndpointBuilder, which is a function builder that takes in multipleEndpointsand returns them as a singleEndpoint. -
A method that registers the
contentof theBearerAuthGroupto the suppliedRoutesBuilder. It also registers basic authentication middleware usingTconforming toCorvusModelUserToken.Declaration
Swift
public func register(to routes: RoutesBuilder)Parameters
routesA
RoutesBuildercontaining all the information about the HTTP route leading to the current component.
BearerAuthGroup Structure Reference