EndpointPolicyProvider

mbauer83.zio_http_authorization.EndpointPolicyProvider$

An EndpointPolicyProvider is used to retrieve a matching * AuthorizationPolicy for a given Request from a set of policies, each registered with a partial function from Request to the policy.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class DefaultEndpointPolicyProvider(defaultPolicy: AuthorizationPolicy[User[_, _], Resource[_]], registeredPolicies: PartialFunction[Request, AuthorizationPolicy[_, _]]) extends EndpointPolicyProvider

A default implementation of an EndpointPolicyProvider.

A default implementation of an EndpointPolicyProvider.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Permits effectful retrieval of a matching AuthorizationPolicy given a Request as well as effectful registration of AuthorizationPolicies using a partial function from Request to a policy.

Permits effectful retrieval of a matching AuthorizationPolicy given a Request as well as effectful registration of AuthorizationPolicies using a partial function from Request to a policy.

Both the retrieval and registration methods are polymorphic in the types of the User and Resource to which the policy applies.

A default policy is also required. This is used as a fallback when no matching policy is found.

Attributes

Note

To fail safe when no matching policy is found, it is strongly recommended to set the provided DenyAllPolicy as the default policy.

Supertypes
class Object
trait Matchable
class Any
Known subtypes