AuthenticationServiceFactory

works.iterative.server.http.AuthenticationServiceFactory

Factory that creates the appropriate AuthenticationService based on configuration.

Reads auth_provider and env from ZIO Config to determine which authentication implementation to use:

  • "test": TestAuthenticationService (for testing only, forbidden in production)
  • "oidc": Pac4jAuthenticationAdapter (for production OIDC authentication)

Example usage:

 val app = ZIO.serviceWithZIO[AuthenticationService](_.currentUser)
   .provide(AuthenticationServiceFactory.layer)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete fields

val layer: ZLayer[Any, Throwable, AuthenticationService]

ZLayer that provides AuthenticationService based on configuration.

ZLayer that provides AuthenticationService based on configuration.

Validates:

  • auth_provider must be set and valid (oidc or test)
  • auth_provider=test is forbidden when env=production

Logs INFO message indicating which authentication service was selected.

Attributes