package authentication
- Source
- package.scala
- Alphabetic
- By Inheritance
- authentication
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
case class
AugmentedJWT[A, I](id: SecureRandomId, jwt: JWTMac[A], identity: I, expiry: Instant, lastTouched: Option[Instant]) extends Product with Serializable
An
Authenticator
that wraps a JWTMAC[A] -
final
case class
AuthEncryptedCookie[A, Id](id: UUID, name: String, content: AEADCookie[A], identity: Id, expiry: Instant, lastTouched: Option[Instant], secure: Boolean, httpOnly: Boolean = true, domain: Option[String] = None, path: Option[String] = None, extension: Option[String] = None) extends Product with Serializable
An authenticated cookie implementation
An authenticated cookie implementation
- id
the cookie id
- content
the raw cookie: The full thing, including the nonce
- identity
The id of what
-
trait
AuthToken[A] extends AnyRef
Authenticators represent something similar to a Token: Some piece of Id that you can use to identify a user with.
Authenticators represent something similar to a Token: Some piece of Id that you can use to identify a user with. The only thing all authenticators have in common is that they all have some eventual expiry date, as well as _possibly_ a lastTouched date.
An Authenticator can be a bearer token, a JWT, an encrypted cookie or a signed cookie in TSec.
-
final
case class
AuthenticatedCookie[A, Id](id: UUID, name: String, content: SignedCookie[A], identity: Id, expiry: Instant, lastTouched: Option[Instant], secure: Boolean, httpOnly: Boolean = true, domain: Option[String] = None, path: Option[String] = None, extension: Option[String] = None) extends Product with Serializable
An authenticated cookie implementation
An authenticated cookie implementation
- A
Our Mac algorithm we are signing the cookie with.
- id
the cookie id
- content
the raw cookie: The full thing, including the nonce
- identity
The id of what
-
abstract
class
Authenticator[F[_], I, V, A] extends AnyRef
A base typeclass for generating authenticators, i.e cookies, tokens, JWTs etc.
A base typeclass for generating authenticators, i.e cookies, tokens, JWTs etc.
- I
The Identifier type
- V
The value type, i.e user, or possibly only partial information
- A
the type of authenticator
- implicit final class AuthenticatorSyntax[A] extends AnyVal
- trait BackingStore[F[_], I, V] extends IdentityStore[F, I, V]
- sealed abstract class BearerTokenAuthenticator[F[_], I, V] extends Authenticator[F, I, V, TSecBearerToken[I]]
- sealed abstract class EncryptedCookieAuthenticator[F[_], I, V, A] extends Authenticator[F, I, V, AuthEncryptedCookie[A, I]]
- trait IdentityStore[F[_], I, V] extends AnyRef
-
abstract
class
JWTAuthenticator[F[_], I, V, A] extends Authenticator[F, I, V, AugmentedJWT[A, I]]
Note: Not sealed in case of user-defined custom behavior
-
final
case class
SecuredRequest[F[_], Identity, Auth](request: Request[F], identity: Identity, authenticator: Auth) extends Product with Serializable
Inspired from the Silhouette
SecuredRequest
- sealed abstract class SecuredRequestHandler[F[_], Identity, User, Auth] extends AnyRef
- abstract class SignedCookieAuthenticator[F[_], I, V, A] extends Authenticator[F, I, V, AuthenticatedCookie[A, I]]
- sealed abstract class StatefulECAuthenticator[F[_], I, V, A] extends EncryptedCookieAuthenticator[F, I, V, A]
- sealed abstract class StatelessECAuthenticator[F[_], I, V, A] extends EncryptedCookieAuthenticator[F, I, V, A]
- type TSecAuthService[I, A, F[_]] = Kleisli[[β$3$]OptionT[F, β$3$], SecuredRequest[F, I, A], Response[F]]
- final case class TSecBearerToken[I](id: SecureRandomId, identity: I, expiry: Instant, lastTouched: Option[Instant]) extends Product with Serializable
-
final
case class
TSecCookieSettings(cookieName: String = "tsec-auth-cookie", secure: Boolean, httpOnly: Boolean = true, domain: Option[String] = None, path: Option[String] = None, extension: Option[String] = None, expiryDuration: FiniteDuration, maxIdle: Option[FiniteDuration]) extends Product with Serializable
Common cookie settings for cookie-based authenticators
- final case class TSecJWTSettings(headerName: String = "X-TSec-JWT", expiryDuration: FiniteDuration, maxIdle: Option[FiniteDuration]) extends Product with Serializable
- type TSecMiddleware[F[_], I, A] = (Kleisli[[β$0$]OptionT[F, β$0$], SecuredRequest[F, I, A], Response[F]]) ⇒ Kleisli[[β$0$]OptionT[F, β$0$], Request[F], Response[F]]
- final case class TSecTokenSettings(expiryDuration: FiniteDuration, maxIdle: Option[FiniteDuration]) extends Product with Serializable
- type UserAwareMiddleware[F[_], I, A] = (Kleisli[[β$5$]OptionT[F, β$5$], UserAwareRequest[F, I, A], Response[F]]) ⇒ Kleisli[[β$5$]OptionT[F, β$5$], Request[F], Response[F]]
- final case class UserAwareRequest[F[_], Identity, Auth](request: Request[F], maybe: Option[(Identity, Auth)]) extends Product with Serializable
- type UserAwareService[I, A, F[_]] = Kleisli[[β$4$]OptionT[F, β$4$], UserAwareRequest[F, I, A], Response[F]]
Value Members
- def buildBearerAuthHeader(content: String): Authorization
- def cookieFromRequest[F[_]](name: String, request: Request[F])(implicit arg0: Monad[F]): OptionT[F, RequestCookie]
- def extractBearerToken[F[_]](request: Request[F])(implicit arg0: Monad[F]): Option[String]
- def unliftedCookieFromRequest[F[_]](name: String, request: Request[F]): Option[RequestCookie]
- object AugmentedJWT extends Serializable
- object AuthEncryptedCookie extends Serializable
- object AuthenticatedCookie extends Serializable
- object BearerTokenAuthenticator
- object EncryptedCookieAuthenticator
- object JWTAuthenticator
- object SecuredRequestHandler
- object SignedCookieAuthenticator
- object TSecAuthService
- object TSecBearerToken extends Serializable
- object TSecMiddleware
- object UserAwareService
- object asAuthed
- object asAware