tsec.authentication

Members list

Type members

Classlikes

final case class AugmentedJWT[A, I](id: SecureRandomId, jwt: JWTMac[A], identity: I, expiry: Instant, lastTouched: Option[Instant])

An Authenticator that wraps a JWTMAC[A]

An Authenticator that wraps a JWTMAC[A]

Attributes

Companion
object
Source
JWTAuthenticator.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object AugmentedJWT

Attributes

Companion
class
Source
JWTAuthenticator.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class AuthEncryptedCookie[A, Id](id: UUID, name: String, content: Cookie[A], identity: Id, expiry: Instant, lastTouched: Option[Instant], secure: Boolean, httpOnly: Boolean, domain: Option[String], path: Option[String], sameSite: SameSite, extension: Option[String])

An authenticated cookie implementation

An authenticated cookie implementation

Value parameters

content

the raw cookie: The full thing, including the nonce

id

the cookie id

identity

The id of what

Attributes

Companion
object
Source
EncryptedCookieAuthenticator.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
EncryptedCookieAuthenticator.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait AuthToken[A]

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.

Attributes

Source
AuthToken.scala
Supertypes
class Object
trait Matchable
class Any
final case class AuthenticatedCookie[A, Id](id: UUID, name: String, content: Cookie[A], identity: Id, expiry: Instant, lastTouched: Option[Instant], secure: Boolean, httpOnly: Boolean, domain: Option[String], path: Option[String], sameSite: SameSite, extension: Option[String])

An authenticated cookie implementation

An authenticated cookie implementation

Type parameters

A

Our Mac algorithm we are signing the cookie with.

Value parameters

content

the raw cookie: The full thing, including the nonce

id

the cookie id

identity

The id of what

Attributes

Companion
object
Source
SignedCookieAuthenticator.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
SignedCookieAuthenticator.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
abstract class Authenticator[F[_], I, V, A]

A base typeclass for generating authenticators, i.e cookies, tokens, JWTs etc.

A base typeclass for generating authenticators, i.e cookies, tokens, JWTs etc.

Type parameters

A

the type of authenticator

I

The Identifier type

V

The value type, i.e user, or possibly only partial information

Attributes

Source
Authenticator.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class BearerTokenAuthenticator[F, I, V]
class EncryptedCookieAuthenticator[F, I, V, A]
class StatefulECAuthenticator[F, I, V, A]
class StatelessECAuthenticator[F, I, V, A]
class JWTAuthenticator[F, I, V, A]
class SignedCookieAuthenticator[F, I, V, A]
Show all
final implicit class AuthenticatorSyntax[A](val a: A) extends AnyVal

Attributes

Source
package.scala
Supertypes
class AnyVal
trait Matchable
class Any
trait BackingStore[F[_], I, V] extends IdentityStore[F, I, V]

Attributes

Source
package.scala
Supertypes
trait IdentityStore[F, I, V]
class Object
trait Matchable
class Any
sealed abstract class BearerTokenAuthenticator[F[_], I, V] extends Authenticator[F, I, V, TSecBearerToken[I]]

Attributes

Companion
object
Source
BearerTokenAuthenticator.scala
Supertypes
class Authenticator[F, I, V, TSecBearerToken[I]]
class Object
trait Matchable
class Any

Attributes

Companion
class
Source
BearerTokenAuthenticator.scala
Supertypes
class Object
trait Matchable
class Any
Self type
sealed abstract class EncryptedCookieAuthenticator[F[_], I, V, A] extends Authenticator[F, I, V, AuthEncryptedCookie[A, I]]

Attributes

Companion
object
Source
EncryptedCookieAuthenticator.scala
Supertypes
class Authenticator[F, I, V, AuthEncryptedCookie[A, I]]
class Object
trait Matchable
class Any
Known subtypes
class StatefulECAuthenticator[F, I, V, A]
class StatelessECAuthenticator[F, I, V, A]

Attributes

Companion
class
Source
EncryptedCookieAuthenticator.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait IdentityStore[F[_], I, V]

Attributes

Source
package.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait BackingStore[F, I, V]
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

Note: Not sealed in case of user-defined custom behavior

Attributes

Companion
object
Source
JWTAuthenticator.scala
Supertypes
class Authenticator[F, I, V, AugmentedJWT[A, I]]
class Object
trait Matchable
class Any

Attributes

Companion
class
Source
JWTAuthenticator.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final case class SecuredRequest[F[_], Identity, Auth](request: Request[F], identity: Identity, authenticator: Auth)

Inspired from the Silhouette SecuredRequest

Inspired from the Silhouette SecuredRequest

Attributes

Source
package.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed abstract class SecuredRequestHandler[F[_], Identity, User, Auth](val authenticator: Authenticator[F, Identity, User, Auth])(implicit F: MonadError[F, Throwable], ME: MonadError[[_] =>> Kleisli[[_] =>> OptionT[F, _$2], Request[F], _$3], Throwable])

Attributes

Companion
object
Source
SecuredRequestHandler.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Source
SecuredRequestHandler.scala
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class SignedCookieAuthenticator[F[_], I, V, A] extends Authenticator[F, I, V, AuthenticatedCookie[A, I]]

Attributes

Companion
object
Source
SignedCookieAuthenticator.scala
Supertypes
class Authenticator[F, I, V, AuthenticatedCookie[A, I]]
class Object
trait Matchable
class Any

Attributes

Companion
class
Source
SignedCookieAuthenticator.scala
Supertypes
class Object
trait Matchable
class Any
Self type
sealed abstract class StatefulECAuthenticator[F[_], I, V, A] extends EncryptedCookieAuthenticator[F, I, V, A]

Attributes

Source
EncryptedCookieAuthenticator.scala
Supertypes
class EncryptedCookieAuthenticator[F, I, V, A]
class Authenticator[F, I, V, AuthEncryptedCookie[A, I]]
class Object
trait Matchable
class Any
sealed abstract class StatelessECAuthenticator[F[_], I, V, A] extends EncryptedCookieAuthenticator[F, I, V, A]

Attributes

Source
EncryptedCookieAuthenticator.scala
Supertypes
class EncryptedCookieAuthenticator[F, I, V, A]
class Authenticator[F, I, V, AuthEncryptedCookie[A, I]]
class Object
trait Matchable
class Any

Attributes

Source
package.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final case class TSecBearerToken[I](id: SecureRandomId, identity: I, expiry: Instant, lastTouched: Option[Instant])

Attributes

Companion
object
Source
BearerTokenAuthenticator.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
BearerTokenAuthenticator.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class TSecCookieSettings(cookieName: String, secure: Boolean, httpOnly: Boolean, domain: Option[String], path: Option[String], sameSite: SameSite, extension: Option[String], expiryDuration: FiniteDuration, maxIdle: Option[FiniteDuration])

Common cookie settings for cookie-based authenticators

Common cookie settings for cookie-based authenticators

Attributes

Source
package.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class TSecJWTSettings(headerName: String, expiryDuration: FiniteDuration, maxIdle: Option[FiniteDuration])

Attributes

Source
package.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Source
package.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final case class TSecTokenSettings(expiryDuration: FiniteDuration, maxIdle: Option[FiniteDuration])

Attributes

Source
package.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class UserAwareRequest[F[_], Identity, Auth](request: Request[F], maybe: Option[(Identity, Auth)])

Attributes

Source
package.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Source
package.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object asAuthed

Attributes

Source
package.scala
Supertypes
class Object
trait Matchable
class Any
Self type
asAuthed.type
object asAware

Attributes

Source
package.scala
Supertypes
class Object
trait Matchable
class Any
Self type
asAware.type

Types

type TSecAuthService[I, A, F[_]] = Kleisli[[_] =>> OptionT[F, _$13], SecuredRequest[F, I, A], Response[F]]

Attributes

Source
package.scala
type TSecMiddleware[F[_], I, A] = ([_] =>> OptionT[F, _$7], SecuredRequest[F, I, A], Response[F], Request[F]) => Response[F]

Attributes

Source
package.scala
type UserAwareMiddleware[F[_], I, A] = ([_] =>> OptionT[F, _$31], UserAwareRequest[F, I, A], Response[F], Request[F]) => Response[F]

Attributes

Source
package.scala
type UserAwareService[I, A, F[_]] = Kleisli[[_] =>> OptionT[F, _$29], UserAwareRequest[F, I, A], Response[F]]

Attributes

Source
package.scala

Value members

Concrete methods

Attributes

Source
package.scala
def cookieFromRequest[F[_] : Monad](name: String, request: Request[F]): OptionT[F, RequestCookie]

Attributes

Source
package.scala
def extractBearerToken[F[_] : Monad](request: Request[F]): Option[String]

Attributes

Source
package.scala
def unliftedCookieFromRequest[F[_]](name: String, request: Request[F]): Option[RequestCookie]

Attributes

Source
package.scala

Implicits

Implicits

final implicit def AuthenticatorSyntax[A](a: A): AuthenticatorSyntax[A]

Attributes

Source
package.scala