AuthType

zio.blocks.endpoint.AuthType
See theAuthType companion object
sealed trait AuthType

Authentication scheme descriptor aligned with zio-http's typed auth model.

When authentication fails, the default response status is Status.NotFound rather than Status.Unauthorized. This is an intentional security pattern (information hiding) that avoids revealing whether a protected resource exists. Override unauthorizedStatus with withUnauthorizedStatus if you want standard 401 Unauthorized behavior instead.

Attributes

Companion
object
Source
AuthType.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Basic
object Bearer
class Custom[ClientReq]
object Digest
object None
class Or[ClientReq1, ClientReq2, ClientReq]
class Scoped[ClientReq]
class WithStatus[ClientReq]
Show all
Self type

Members list

Type members

Types

Attributes

Source
AuthType.scala

Value members

Abstract methods

Concrete methods

The HTTP status code returned when authentication fails.

The HTTP status code returned when authentication fails.

Defaults to Status.NotFound to avoid revealing protected resources via a distinct authentication failure response.

Attributes

Source
AuthType.scala
def withUnauthorizedStatus(status: Status): AuthType { type ClientRequirement = ClientRequirement; }

Returns a copy of this auth type with a different unauthorized status.

Returns a copy of this auth type with a different unauthorized status.

Use this to opt into standard 401 Unauthorized behavior when information hiding is not desired.

Attributes

Source
AuthType.scala
def |[ClientReq2, ClientReq](that: AuthType { type ClientRequirement = ClientReq2; })(implicit alternator: WithOut[ClientRequirement, ClientReq2, ClientReq]): AuthType { type ClientRequirement = ClientReq; }

Attributes

Source
AuthType.scala