PartialServerEndpoint
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.
Type parameters
- ERROR_OUTPUT
-
Error output parameter types.
- F
-
The effect type used in the provided partial server logic.
- INPUT
-
Input parameter types.
- OUTPUT
-
Output parameter types.
- PRINCIPAL
-
The type of the value returned by the security logic.
- R
-
The capabilities that are required by this endpoint's inputs/outputs.
Any
, if no requirements. - SECURITY_INPUT
-
Security input parameter types, which the security logic accepts and returns a
PRINCIPAL
or an errorERROR_OUTPUT
.
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait EndpointMetaOpstrait EndpointInfoOps[R]class Objecttrait Matchableclass AnyShow all
- Self type
-
Members list
Type members
Types
Value members
Concrete methods
Attributes
- Definition Classes
Attributes
- Definition Classes
Attributes
- Definition Classes
Attributes
- Definition Classes
Attributes
- Definition Classes
If the error type is an Either
, e.g. when using errorOutEither
, this method accepts server logic that returns either success or the Left
error type. Use of this method avoids having to wrap the returned error in Left
.
If the error type is an Either
, e.g. when using errorOutEither
, this method accepts server logic that returns either success or the Left
error type. Use of this method avoids having to wrap the returned error in Left
.
Attributes
If the error type is an Either
, e.g. when using errorOutEither
, this method accepts server logic that returns either success or the Right
error type. Use of this method avoids having to wrap the returned error in Right
.
If the error type is an Either
, e.g. when using errorOutEither
, this method accepts server logic that returns either success or the Right
error type. Use of this method avoids having to wrap the returned error in Right
.
Attributes
Inherited methods
Attributes
- Inherited from:
- EndpointInfoOps
Attributes
- Inherited from:
- EndpointInfoOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInfoOps
Attributes
- Inherited from:
- EndpointInfoOps
Adds a new error variant, where the current error output is represented as a Left
, and the given one as a Right
.
Adds a new error variant, where the current error output is represented as a Left
, and the given one as a Right
.
Attributes
- Inherited from:
- EndpointErrorOutputVariantsOps
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 the E
type is different from E
, 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.
Type parameters
- E2
-
A common supertype of the new variant and the current output
E
.
Value parameters
- o
-
The variant to add. Can be created given an output with one of the Tapir.oneOfVariant methods.
Attributes
- Inherited from:
- EndpointErrorOutputVariantsOps
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.
Type parameters
- E2
-
A common supertype of the new variant and the current output
E
.
Value parameters
- o
-
The variant to add. Can be created given an output with one of the Tapir.oneOfVariant methods.
Attributes
- Inherited from:
- EndpointErrorOutputVariantsOps
Same as errorOutVariant, but allows appending multiple variants in one go.
Same as errorOutVariant, but allows appending multiple variants in one go.
Attributes
- Inherited from:
- EndpointErrorOutputVariantsOps
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.
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.
Type parameters
- E2
-
A common supertype of the new variant and the current output
E
.
Attributes
- Inherited from:
- EndpointErrorOutputVariantsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInfoOps
Attributes
- Inherited from:
- EndpointErrorOutputVariantsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInputsMacros
Attributes
- Inherited from:
- EndpointOutputsOps
Attributes
- Inherited from:
- EndpointOutputsOps
Attributes
- Inherited from:
- EndpointOutputsOps
Attributes
- Inherited from:
- EndpointOutputsMacros
The method defined in a fixed method input in this endpoint, if any (using e.g. EndpointInputsOps.get or EndpointInputsOps.post).
The method defined in a fixed method input in this endpoint, if any (using e.g. EndpointInputsOps.get or EndpointInputsOps.post).
Attributes
- Inherited from:
- EndpointMetaOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInfoOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointOutputsOps
Attributes
- Inherited from:
- EndpointOutputsOps
Attributes
- Inherited from:
- EndpointOutputsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointInputsOps
Attributes
- Inherited from:
- EndpointOutputsOps
Attributes
- Inherited from:
- EndpointOutputsOps
Attributes
- Inherited from:
- EndpointOutputsOps
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- EndpointInputsOps
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)}/-
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)}/-
Attributes
- Inherited from:
- EndpointMetaOps
Detailed description of the endpoint, with inputs/outputs represented in the same order as originally defined, including mapping information. E.g.:
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: -)
Attributes
- Inherited from:
- EndpointMetaOps
Shows endpoint path, by default all parametrised path and query components are replaced by {param_name} or {paramN}, e.g. for
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}
Value parameters
- 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
Attributes
- Inherited from:
- EndpointMetaOps
Equivalent to .toString
, shows the whole case class structure.
Equivalent to .toString
, shows the whole case class structure.
Attributes
- Inherited from:
- EndpointMetaOps
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
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
Attributes
- Inherited from:
- EndpointMetaOps
Attributes
- Inherited from:
- EndpointInfoOps
Append t
to the existing tags.
Append ts
to the existing tags.
Attributes
- Inherited from:
- EndpointInputsOps
Overwrite the existing tags with a single tag t
.
Overwrite the existing tags with ts
.
Remove all tags from this endpoint.