zio.blocks.jwt
Members list
Type members
Classlikes
A JWT signing algorithm as defined in RFC 7518.
A JWT signing algorithm as defined in RFC 7518.
Attributes
- Companion
- object
- Source
- Algorithm.scala
- Supertypes
- Known subtypes
Supported JWT algorithms. Use Algorithm.fromString to parse an alg header value.
Supported JWT algorithms. Use Algorithm.fromString to parse an alg header value.
Attributes
- Companion
- trait
- Source
- Algorithm.scala
- Supertypes
- Self type
-
Algorithm.type
Attributes
- Source
- Base64Url.scala
- Supertypes
- Self type
-
Base64Url.type
This object was generated by sbt-buildinfo.
This object was generated by sbt-buildinfo.
Attributes
- Source
- BuildInfo.scala
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Self type
-
BuildInfo.type
Attributes
- Source
- JvmJwtCryptoBackend.scala
- Supertypes
- Self type
-
JvmJwtCryptoBackend.type
Pure-Scala JWT implementation (RFC 7519).
Pure-Scala JWT implementation (RFC 7519).
==Minimal usage==
JvmJwtCryptoBackend.install() // once at startup
val token = Jwt.sign(claims, key, Algorithm.HS256).getOrElse(throw new RuntimeException(...))
val claims = Jwt.decode(token, key, Algorithm.HS256).getOrElse(throw new RuntimeException(...))
Attributes
Attributes
- Companion
- object
- Source
- JwtAudience.scala
- Supertypes
- Known subtypes
Attributes
- Companion
- trait
- Source
- JwtAudience.scala
- Supertypes
- Self type
-
JwtAudience.type
Attributes
- Companion
- class
- Source
- JwtClaims.scala
- Supertypes
- Self type
-
JwtClaims.type
The set of claims carried inside a JWT payload.
The set of claims carried inside a JWT payload.
Registered claim names follow RFC 7519 §4.1. Additional application-defined claims are collected in extra, preserving their original JSON value type as JwtValue.
NumericDate claims (exp, nbf, iat) accept integer and fractional/exponent JSON numbers. Fractional values are deterministically truncated toward zero (floor for non-negative values) to seconds. Non-finite, negative, or out-of-range values are rejected.
Use the methods on JwtClaims to deserialise and serialise.
Attributes
- Companion
- object
- Source
- JwtClaims.scala
- Supertypes
Global registry for the active JwtCryptoBackend.
Global registry for the active JwtCryptoBackend.
Call JvmJwtCryptoBackend.install() (JVM) or JsJwtCryptoBackend.install() (JS) once at application startup. Until then the default backend handles HMAC algorithms only.
Attributes
Platform-specific cryptographic operations for JWT.
Platform-specific cryptographic operations for JWT.
Call install() on a platform backend (e.g. JvmJwtCryptoBackend.install()) before signing or verifying tokens. The default backend (the built-in shared backend) supports HMAC-SHA2 algorithms only and requires no native dependencies.
Attributes
- Source
- Jwt.scala
- Supertypes
- Known subtypes
-
object JvmJwtCryptoBackend
Attributes
- Companion
- class
- Source
- Jwt.scala
- Supertypes
- Self type
-
JwtDecodeOptions.type
Options for authenticated JWT decoding.
Options for authenticated JWT decoding.
This is the source-compatible configuration value that groups optional parameters instead of adding many positional arguments. Existing call sites that use decode(token,key,alg,clockSkew,issuer) continue to work via the legacy overload which delegates to this options type.
Audience validation follows RFC 7519 §4.1.3 receiver contract: when expectedAudience is set, the token's aud claim must be present and contain the expected value (string match for single aud, membership for array aud). Missing aud yields MissingClaim("aud"); mismatch yields InvalidToken.
Value parameters
- backend
-
explicit crypto backend to use for this operation; defaults to JwtCrypto.backend snapshot
- clockSkewSeconds
-
allowable clock skew in seconds for
exp/nbfvalidation - expectedAudience
-
if set, the
audclaim must contain this audience - issuer
-
if set, the
issclaim must match exactly - limits
-
resource limits for token/JSON parsing
- nowSeconds
-
explicit current time in seconds since epoch for
exp/nbfvalidation; defaults toSystem.currentTimeMillis()/1000
Attributes
Attributes
- Companion
- trait
- Source
- JwtError.scala
- Supertypes
- Self type
-
JwtError.type
A failure that can occur during JWT signing or decoding.
A failure that can occur during JWT signing or decoding.
All subtypes extend scala.util.control.NoStackTrace to avoid capturing a stack trace on the hot decoding path.
Attributes
- Companion
- object
- Source
- JwtError.scala
- Supertypes
-
trait NoStackTraceclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class AlgorithmMismatchclass ExpiredTokenclass InvalidClaimclass InvalidKeyclass InvalidSignatureclass InvalidTokenclass JsonTooLargeclass MissingClaimclass NotYetValidclass SegmentTooLargeclass TokenTooLargeclass TooDeepclass TooManyElementsclass TooManyFieldsclass UnsupportedAlgorithmShow all
Attributes
- Companion
- object
- Source
- JwtHeader.scala
- Supertypes
Attributes
- Companion
- class
- Source
- JwtHeader.scala
- Supertypes
- Self type
-
JwtHeader.type
Conservative resource limits for JWT parsing and token validation.
Conservative resource limits for JWT parsing and token validation.
All limits are checked before allocation where possible.
Value parameters
- maxArrayElements
-
maximum number of elements in a single JSON array
- maxDepth
-
maximum nesting depth for JSON objects/arrays (root is depth 1)
- maxFields
-
maximum number of fields in a single JSON object
- maxJsonChars
-
maximum length of decoded JSON (header or payload) in characters
- maxSegmentChars
-
maximum length of a single Base64Url segment (header/payload/signature)
- maxTokenChars
-
maximum total compact token length in characters
Attributes
Options for JWT signing.
Options for JWT signing.
Value parameters
- backend
-
explicit crypto backend to use for this operation; defaults to JwtCrypto.backend snapshot
- limits
-
resource limits for header JSON validation
Attributes
Attributes
- Companion
- class
- Source
- Jwt.scala
- Supertypes
- Self type
-
JwtSignOptions.type
Attributes
- Companion
- trait
- Source
- JwtValue.scala
- Supertypes
- Self type
-
JwtValue.type
Public JSON value ADT for JWT custom claims.
Public JSON value ADT for JWT custom claims.
Mirrors JSON value kinds: string, number, boolean, null, array, object. Numbers preserve their original JSON text to avoid loss of precision or formatting. Nested objects and arrays are fully supported; no values are silently dropped during parsing.
Attributes
- Companion
- object
- Source
- JwtValue.scala
- Supertypes
- Known subtypes