case class PartialServerEndpoint[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, -R, F[_]](endpoint: Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R], securityLogic: (MonadError[F]) ⇒ (SECURITY_INPUT) ⇒ F[Either[ERROR_OUTPUT, PRINCIPAL]]) extends EndpointInputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R] with EndpointOutputsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R] with EndpointErrorOutputVariantsOps[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R] with EndpointInfoOps[R] with EndpointMetaOps with Product with Serializable
An endpoint with the security logic provided, and the main logic yet unspecified. See Endpoint.serverSecurityLogic.
The provided security part of the server logic transforms inputs of type SECURITY_INPUT
, either to an error of type ERROR_OUTPUT
, or
value of type PRINCIPAL
.
The part of the server logic which is not provided, will have to transform both PRINCIPAL
and the rest of the input INPUT
either
into an error, or a value of type OUTPUT
.
Inputs/outputs can be added to partial endpoints as to regular endpoints. The shape of the error outputs can be adjusted in a limited
way, by adding new error output variants, similar as if they were defined using Tapir.oneOf; the variants and the existing error
outputs should usually have a common supertype (other than Any
). Hence, it's possible to create a base, secured input, and then
specialise it with inputs, outputs and logic as needed.
- SECURITY_INPUT
Security input parameter types, which the security logic accepts and returns a
PRINCIPAL
or an errorERROR_OUTPUT
.- PRINCIPAL
The type of the value returned by the security logic.
- INPUT
Input parameter types.
- ERROR_OUTPUT
Error output parameter types.
- OUTPUT
Output parameter types.
- R
The capabilities that are required by this endpoint's inputs/outputs.
Any
, if no requirements.- F
The effect type used in the provided partial server logic.
- Self Type
- PartialServerEndpoint[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
- Alphabetic
- By Inheritance
- PartialServerEndpoint
- Serializable
- Serializable
- Product
- Equals
- EndpointMetaOps
- EndpointInfoOps
- EndpointErrorOutputVariantsOps
- EndpointOutputsOps
- EndpointOutputsMacros
- EndpointInputsOps
- EndpointInputsMacros
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Type Members
-
type
EndpointType[_A, _I, _E, _O, -_R] = PartialServerEndpoint[_A, PRINCIPAL, _I, _E, _O, _R, F]
- Definition Classes
- PartialServerEndpoint → EndpointErrorOutputVariantsOps → EndpointOutputsOps → EndpointInputsOps
-
type
ThisType[-_R] = PartialServerEndpoint[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, _R, F]
- Definition Classes
- PartialServerEndpoint → EndpointInfoOps
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
attribute[T](k: AttributeKey[T], v: T): ThisType[R]
- Definition Classes
- EndpointInfoOps
-
def
attribute[T](k: AttributeKey[T]): Option[T]
- Definition Classes
- EndpointInfoOps
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
connect: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
delete: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
deprecated(): ThisType[R]
- Definition Classes
- EndpointInfoOps
-
def
description(d: String): ThisType[R]
- Definition Classes
- EndpointInfoOps
- val endpoint: Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
errorOutEither[E2](o: EndpointOutput[E2]): EndpointType[SECURITY_INPUT, INPUT, Either[ERROR_OUTPUT, E2], OUTPUT, R]
Adds a new error variant, where the current error output is represented as a
Left
, and the given one as aRight
.Adds a new error variant, where the current error output is represented as a
Left
, and the given one as aRight
.- Definition Classes
- EndpointErrorOutputVariantsOps
-
def
errorOutVariant[E2 >: ERROR_OUTPUT](o: OneOfVariant[_ <: E2])(implicit ct: ClassTag[ERROR_OUTPUT], eEqualToErasure: ErasureSameAsType[ERROR_OUTPUT]): EndpointType[SECURITY_INPUT, INPUT, E2, OUTPUT, R]
Replaces the current error output with a Tapir.oneOf output, where:
Replaces the current error output with a Tapir.oneOf output, where:
- the first output variant is the current output:
oneOfVariant(errorOutput)
- the second output variant is the given
o
The variant for the current endpoint output will be created using Tapir.oneOfVariant. Hence, the current output will be used if the run-time class of the output matches
E
. If the erasure of theE
type is different fromE
, there will be a compile-time failure, as no such run-time check is possible. In this case, use errorOutVariantsFromCurrent and create a variant using one of the other variant factory methods (e.g. Tapir.oneOfVariantValueMatcher).During encoding/decoding, the new
o
variant will be considered after the current variant.Usage example:
sealed trait Parent case class Child1(v: String) extends Parent case class Child2(v: String) extends Parent val e: PublicEndpoint[Unit, Parent, Unit, Any] = endpoint .errorOut(stringBody.mapTo[Child1]) .errorOutVariant[Parent](oneOfVariant(stringBody.mapTo[Child2]))
Adding error output variants is useful when extending the error outputs in a PartialServerEndpoint, created using EndpointServerLogicOps.serverSecurityLogic.
- E2
A common supertype of the new variant and the current output
E
.- o
The variant to add. Can be created given an output with one of the Tapir.oneOfVariant methods.
- Definition Classes
- EndpointErrorOutputVariantsOps
- the first output variant is the current output:
-
def
errorOutVariantPrepend[E2 >: ERROR_OUTPUT](o: OneOfVariant[_ <: E2]): EndpointType[SECURITY_INPUT, INPUT, E2, OUTPUT, R]
Replaces the current error output with a Tapir.oneOf output, where:
Replaces the current error output with a Tapir.oneOf output, where:
- the first output variant is the given
o
- the second, default output variant is the current output:
oneOfDefaultVariant(errorOutput)
Useful for adding specific error variants, while the more general ones are already covered by the existing error output.
During encoding/decoding, the new
o
variant will be considered before the current variant.Adding error output variants is useful when extending the error outputs in a PartialServerEndpoint, created using EndpointServerLogicOps.serverSecurityLogic.
- E2
A common supertype of the new variant and the current output
E
.- o
The variant to add. Can be created given an output with one of the Tapir.oneOfVariant methods.
- Definition Classes
- EndpointErrorOutputVariantsOps
- the first output variant is the given
-
def
errorOutVariants[E2 >: ERROR_OUTPUT](first: OneOfVariant[_ <: E2], other: OneOfVariant[_ <: E2]*)(implicit ct: ClassTag[ERROR_OUTPUT], eEqualToErasure: ErasureSameAsType[ERROR_OUTPUT]): EndpointType[SECURITY_INPUT, INPUT, E2, OUTPUT, R]
Same as errorOutVariant, but allows appending multiple variants in one go.
Same as errorOutVariant, but allows appending multiple variants in one go.
- Definition Classes
- EndpointErrorOutputVariantsOps
-
def
errorOutVariantsFromCurrent[E2 >: ERROR_OUTPUT](variants: (EndpointOutput[ERROR_OUTPUT]) ⇒ List[OneOfVariant[_ <: E2]]): EndpointType[SECURITY_INPUT, INPUT, E2, OUTPUT, R]
Replace the error output with a Tapir.oneOf output, using the variants returned by
variants
.Replace the error output with a Tapir.oneOf output, using the variants returned by
variants
. The current output should be included in one of the returned variants.Allows creating the variant list in a custom order, placing the current variant in an arbitrary position, and using default variants if necessary.
Adding error output variants is useful when extending the error outputs in a PartialServerEndpoint, created using EndpointServerLogicOps.serverSecurityLogic.
- E2
A common supertype of the new variant and the current output
E
.
- Definition Classes
- EndpointErrorOutputVariantsOps
-
def
errorOutput: EndpointOutput[ERROR_OUTPUT]
- Definition Classes
- PartialServerEndpoint → EndpointMetaOps → EndpointErrorOutputVariantsOps
-
def
get: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
head: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
in[BS, J, IJ, R2](i: StreamBodyIO[BS, J, R2])(implicit concat: typelevel.ParamConcat.Aux[INPUT, J, IJ]): EndpointType[SECURITY_INPUT, IJ, ERROR_OUTPUT, OUTPUT, R with R2]
- Definition Classes
- EndpointInputsOps
-
def
in[J, IJ](i: EndpointInput[J])(implicit concat: typelevel.ParamConcat.Aux[INPUT, J, IJ]): EndpointType[SECURITY_INPUT, IJ, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
info: EndpointInfo
- Definition Classes
- PartialServerEndpoint → EndpointMetaOps → EndpointInfoOps
-
def
info(i: EndpointInfo): ThisType[R]
- Definition Classes
- EndpointInfoOps
-
def
input: EndpointInput[INPUT]
- Definition Classes
- PartialServerEndpoint → EndpointMetaOps → EndpointInputsOps
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
mapErrorOut[EE](f: (ERROR_OUTPUT) ⇒ EE)(g: (EE) ⇒ ERROR_OUTPUT): EndpointType[SECURITY_INPUT, INPUT, EE, OUTPUT, R]
- Definition Classes
- EndpointErrorOutputVariantsOps
-
def
mapIn[II](f: (INPUT) ⇒ II)(g: (II) ⇒ INPUT): EndpointType[SECURITY_INPUT, II, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
mapIn[II](m: Mapping[INPUT, II]): EndpointType[SECURITY_INPUT, II, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
mapInDecode[II](f: (INPUT) ⇒ DecodeResult[II])(g: (II) ⇒ INPUT): EndpointType[SECURITY_INPUT, II, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
macro
def
mapInTo[CASE_CLASS]: EndpointType[SECURITY_INPUT, CASE_CLASS, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsMacros
-
def
mapOut[OO](f: (OUTPUT) ⇒ OO)(g: (OO) ⇒ OUTPUT): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OO, R]
- Definition Classes
- EndpointOutputsOps
-
def
mapOut[OO](m: Mapping[OUTPUT, OO]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OO, R]
- Definition Classes
- EndpointOutputsOps
-
def
mapOutDecode[OO](f: (OUTPUT) ⇒ DecodeResult[OO])(g: (OO) ⇒ OUTPUT): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OO, R]
- Definition Classes
- EndpointOutputsOps
-
macro
def
mapOutTo[CASE_CLASS]: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, CASE_CLASS, R]
- Definition Classes
- EndpointOutputsMacros
-
def
method: Option[Method]
The method defined in a fixed method input in this endpoint, if any (using e.g.
The method defined in a fixed method input in this endpoint, if any (using e.g. EndpointInputsOps.get or EndpointInputsOps.post).
- Definition Classes
- EndpointMetaOps
-
def
method(m: Method): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
name(n: String): ThisType[R]
- Definition Classes
- EndpointInfoOps
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
options: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
out[PIPE_REQ_RESP, P, OP, R2](i: WebSocketBodyOutput[PIPE_REQ_RESP, _, _, P, R2])(implicit ts: typelevel.ParamConcat.Aux[OUTPUT, P, OP]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OP, R with R2 with WebSockets]
- Definition Classes
- EndpointOutputsOps
-
def
out[BS, P, OP, R2](i: StreamBodyIO[BS, P, R2])(implicit ts: typelevel.ParamConcat.Aux[OUTPUT, P, OP]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OP, R with R2]
- Definition Classes
- EndpointOutputsOps
-
def
out[P, OP](i: EndpointOutput[P])(implicit ts: typelevel.ParamConcat.Aux[OUTPUT, P, OP]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OP, R]
- Definition Classes
- EndpointOutputsOps
-
def
output: EndpointOutput[OUTPUT]
- Definition Classes
- PartialServerEndpoint → EndpointMetaOps → EndpointOutputsOps
-
def
patch: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
post: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
prependIn[BS, J, JI, R2](i: StreamBodyIO[BS, J, R2])(implicit concat: typelevel.ParamConcat.Aux[J, INPUT, JI]): EndpointType[SECURITY_INPUT, JI, ERROR_OUTPUT, OUTPUT, R with R2]
- Definition Classes
- EndpointInputsOps
-
def
prependIn[J, JI](i: EndpointInput[J])(implicit concat: typelevel.ParamConcat.Aux[J, INPUT, JI]): EndpointType[SECURITY_INPUT, JI, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
prependOut[PIPE_REQ_RESP, P, PO, R2](i: WebSocketBodyOutput[PIPE_REQ_RESP, _, _, P, R2])(implicit ts: typelevel.ParamConcat.Aux[P, OUTPUT, PO]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, PO, R with R2 with WebSockets]
- Definition Classes
- EndpointOutputsOps
-
def
prependOut[BS, P, PO, R2](i: StreamBodyIO[BS, P, R2])(implicit ts: typelevel.ParamConcat.Aux[P, OUTPUT, PO]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, PO, R with R2]
- Definition Classes
- EndpointOutputsOps
-
def
prependOut[P, PO](i: EndpointOutput[P])(implicit ts: typelevel.ParamConcat.Aux[P, OUTPUT, PO]): EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, PO, R]
- Definition Classes
- EndpointOutputsOps
-
def
put: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
def
securityInput: EndpointInput[SECURITY_INPUT]
- Definition Classes
- PartialServerEndpoint → EndpointMetaOps
- val securityLogic: (MonadError[F]) ⇒ (SECURITY_INPUT) ⇒ F[Either[ERROR_OUTPUT, PRINCIPAL]]
- def serverLogic(f: (PRINCIPAL) ⇒ (INPUT) ⇒ F[Either[ERROR_OUTPUT, OUTPUT]]): Full[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
- def serverLogicError(f: (PRINCIPAL) ⇒ (INPUT) ⇒ F[ERROR_OUTPUT]): Full[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
-
def
serverLogicLeftErrorOrSuccess[LE, RE](f: (PRINCIPAL) ⇒ (INPUT) ⇒ F[Either[LE, OUTPUT]])(implicit eIsEither: =:=[Either[LE, RE], ERROR_OUTPUT]): Full[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
If the error type is an
Either
, e.g.If the error type is an
Either
, e.g. when usingerrorOutEither
, this method accepts server logic that returns either success or theLeft
error type. Use of this method avoids having to wrap the returned error inLeft
. - def serverLogicOption(f: (PRINCIPAL) ⇒ (INPUT) ⇒ F[Option[OUTPUT]])(implicit eIsUnit: =:=[ERROR_OUTPUT, Unit]): Full[SECURITY_INPUT, PRINCIPAL, INPUT, Unit, OUTPUT, R, F]
- def serverLogicPure(f: (PRINCIPAL) ⇒ (INPUT) ⇒ Either[ERROR_OUTPUT, OUTPUT]): Full[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
- def serverLogicRecoverErrors(f: (PRINCIPAL) ⇒ (INPUT) ⇒ F[OUTPUT])(implicit eIsThrowable: <:<[ERROR_OUTPUT, Throwable], eClassTag: ClassTag[ERROR_OUTPUT]): Full[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
-
def
serverLogicRightErrorOrSuccess[LE, RE](f: (PRINCIPAL) ⇒ (INPUT) ⇒ F[Either[RE, OUTPUT]])(implicit eIsEither: =:=[Either[LE, RE], ERROR_OUTPUT]): Full[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
If the error type is an
Either
, e.g.If the error type is an
Either
, e.g. when usingerrorOutEither
, this method accepts server logic that returns either success or theRight
error type. Use of this method avoids having to wrap the returned error inRight
. - def serverLogicSuccess(f: (PRINCIPAL) ⇒ (INPUT) ⇒ F[OUTPUT]): Full[SECURITY_INPUT, PRINCIPAL, INPUT, ERROR_OUTPUT, OUTPUT, R, F]
-
def
show: String
Basic information about the endpoint, excluding mapping information, with inputs sorted (first the method, then path, etc.).
Basic information about the endpoint, excluding mapping information, with inputs sorted (first the method, then path, etc.). E.g.:
POST /books /add {header Authorization} {body as application/json (UTF-8)} -> {body as text/plain (UTF-8)}/-
- Definition Classes
- EndpointMetaOps
-
def
showDetail: String
Detailed description of the endpoint, with inputs/outputs represented in the same order as originally defined, including mapping information.
Detailed description of the endpoint, with inputs/outputs represented in the same order as originally defined, including mapping information. E.g.:
Endpoint(securityin: -, in: /books POST /add {body as application/json (UTF-8)} {header Authorization}, errout: {body as text/plain (UTF-8)}, out: -)
- Definition Classes
- EndpointMetaOps
-
def
showPathTemplate(showPathParam: (Int, PathCapture[_]) ⇒ String = ..., showQueryParam: Option[(Int, Query[_]) ⇒ String] = ..., includeAuth: Boolean = true, showNoPathAs: String = "*", showPathsAs: Option[String] = Some("*"), showQueryParamsAs: Option[String] = Some("*")): String
Shows endpoint path, by default all parametrised path and query components are replaced by {param_name} or {paramN}, e.g.
Shows endpoint path, by default all parametrised path and query components are replaced by {param_name} or {paramN}, e.g. for
endpoint.in("p1" / path[String] / query[String]("par2"))
returns
/p1/{param1}?par2={par2}
- includeAuth
Should authentication inputs be included in the result.
- showNoPathAs
How to show the path if the endpoint does not define any path inputs.
- showPathsAs
How to show Tapir.paths inputs (if at all), which capture multiple paths segments
- showQueryParamsAs
How to show Tapir.queryParams inputs (if at all), which capture multiple query parameters
- Definition Classes
- EndpointMetaOps
-
def
showRaw: String
Equivalent to
.toString
, shows the whole case class structure.Equivalent to
.toString
, shows the whole case class structure.- Definition Classes
- EndpointMetaOps
-
def
showShort: String
Shortened information about the endpoint.
Shortened information about the endpoint. If the endpoint is named, returns the name, e.g.
[my endpoint]
. Otherwise, returns the string representation of the method (if any) and path, e.g.POST /books/add
- Definition Classes
- EndpointMetaOps
-
def
showType: String
- Attributes
- protected
- Definition Classes
- PartialServerEndpoint → EndpointMetaOps
-
def
summary(s: String): ThisType[R]
- Definition Classes
- EndpointInfoOps
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
tag(t: String): ThisType[R]
- Definition Classes
- EndpointInfoOps
-
def
tags(ts: List[String]): ThisType[R]
- Definition Classes
- EndpointInfoOps
-
def
trace: EndpointType[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
- Definition Classes
- EndpointInputsOps
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated