io.github.vlmiroshnikov.authz.jwt

Type members

Classlikes

trait Alg(val name: String)
object Audience
trait AuxDecoder[A]
trait AuxEncoder[A]
object Binary
trait Claims
case object DecodingFailure extends Throwable with NoStackTrace
case object EncodingFailure extends Throwable with NoStackTrace
trait Header
case class InvalidJWTFormat(msg: String) extends Exception with NoStackTrace
case object InvalidSignature extends Exception with NoStackTrace
enum JWTType(val name: String)
case class Jwt[H <: Header, C <: Claims](header: H, claims: C, signature: Binary)
case class ParseResult[H <: Header, C <: Claims](header: H, claims: C, signature: Binary, signedPart: String)
case class RawJwt(header: String, claims: String, signature: String)
Companion
object
object RawJwt
Companion
class
trait Signer[F[_]]
case class StdClaims(issuer: Option[String], subject: Option[String], audience: Option[Audience], expiration: Option[Instant], notBefore: Option[Instant], issuedAt: Option[Instant], jwtId: Option[String]) extends Claims
case class StdHeader(`type`: JWTType, algorithm: String, contentType: Option[String], critical: Option[NonEmptyList[String]], jku: Option[String], jwk: Option[String], kid: Option[String], x5u: Option[String]) extends Header
case class UnsupportedAlgorithm(alg: String) extends Exception with NoStackTrace
trait Verifier[F[_]]

Types

opaque type Audience
opaque type Binary

Value members

Concrete methods

def buildAndSign[F[_], H <: Header, C <: Claims](header: H, claims: C)(using E: MonadError[F, Throwable], signer: Signer[F], headerEnc: AuxEncoder[H], claimsEnc: AuxEncoder[C]): F[RawJwt]
def parse[F[_], H <: Header, C <: Claims](jwt: String)(using E: MonadError[F, Throwable], headerDec: AuxDecoder[H], claimsDec: AuxDecoder[C]): F[ParseResult[H, C]]
def verify[F[_], H <: Header, C <: Claims](header: H, claims: C, signature: Binary, signedPart: String)(using E: MonadError[F, Throwable], verifier: Verifier[F]): F[Boolean]

Extensions

Extensions

extension (c: Claims)
def isAfterNBF(now: Instant): Boolean
def isNotExpired(now: Instant): Boolean
def isValidIssued(now: Instant): Boolean