JWT Authentication Utilities
Latest stable Based on Bluetape4k release 1.11.0
Problem
Section titled “Problem”A library for creating and parsing JSON Web Tokens (JWT). Built on jjwt 0.13.x, it provides a Kotlin-friendly API and KeyChain management. This manual connects that purpose to the current build, source entry points, tests, configuration resources, and lifecycle evidence instead of duplicating the README feature list.
When to use
Section titled “When to use”Use bluetape4k-jwt when the application needs input contracts, value semantics, algorithmic cost, and deterministic output. Start with the source entry points below and confirm that their ownership and failure contracts match the calling component. Prefer a smaller standard-library or already-adopted module when it satisfies the same contract without another runtime boundary.
Coordinates
Section titled “Coordinates”dependencies { implementation(platform("io.github.bluetape4k:bluetape4k-dependencies:<version>")) implementation("io.github.bluetape4k:bluetape4k-jwt")}Gradle project path: :bluetape4k-jwt. Source directory: utils/jwt.
Concepts
Section titled “Concepts”The first source-level concepts to inspect are JwtConsts, JwtCodecs, JwtComposer, JwtComposerDsl, KeyChain, KeyChainDto, AbstractKeyChainRepository, and KeyChainRepository. File names are navigation anchors; read each declaration and its tests before treating it as a public contract.
Quick start
Section titled “Quick start”Add the coordinate above, refresh Gradle, and start from the smallest entry point that owns the required task. Open JwtConsts first; it is a concrete source entry point for the module.
API by task
Section titled “API by task”| Entry point | What to verify |
|---|---|
JwtConsts | Inspect this declaration’s constructors, functions, and ownership contract. |
JwtCodecs | Inspect this declaration’s constructors, functions, and ownership contract. |
JwtComposer | Inspect this declaration’s constructors, functions, and ownership contract. |
JwtComposerDsl | Inspect this declaration’s constructors, functions, and ownership contract. |
KeyChain | Inspect this declaration’s constructors, functions, and ownership contract. |
KeyChainDto | Inspect this declaration’s constructors, functions, and ownership contract. |
AbstractKeyChainRepository | Inspect this declaration’s constructors, functions, and ownership contract. |
KeyChainRepository | Inspect this declaration’s constructors, functions, and ownership contract. |
InMemoryKeyChainRepository | Inspect this declaration’s constructors, functions, and ownership contract. |
RedisKeyChainRepository | Inspect this declaration’s constructors, functions, and ownership contract. |
Patterns
Section titled “Patterns”The README evidence is organized around Architecture, JWT Create and Verify Flow, Class Diagram, JWT Token Structure, Key Features, Usage Examples, Basic JWT Creation and Parsing, Creating JWTs with Kotlin DSL, Using JwtReader, and KeyChain Rotation. Use those topics as a navigation map, then confirm behavior in source and tests. Keep adoption narrow and connect owned resources to the caller lifecycle.
Integrations
Section titled “Integrations”The current build declares these integration edges:
api(project(":bluetape4k-io"))api(libs.jjwt.api)api(libs.jjwt.impl)api(libs.jjwt.jackson)api(project(":bluetape4k-jackson2"))api(libs.jackson.module.kotlin)api(libs.jackson.module.blackbird)compileOnly(libs.fory.kotlin)compileOnly(libs.kryo5)compileOnly(libs.lz4.java)compileOnly(libs.snappy.java)compileOnly(libs.zstd.jni)Treat compileOnly edges as caller-provided capabilities and verify runtime availability before using their APIs.
Configuration
Section titled “Configuration”Configuration resources found in the module:
Read property names and defaults from these resources and the binding source before overriding them.
Failures
Section titled “Failures”Failure semantics are defined by the linked entry points and tests, not inferred from the artifact name. Keep cancellation and timeout signals intact, close owned resources, and translate backend exceptions only at a boundary that can add a stable domain contract. Use the test anchors below to verify the exact behavior before adding retries or fallbacks.
Operations
Section titled “Operations”Measure hot paths, bound input sizes, and monitor failures at the application boundary that calls the utility. Keep capacity, timeout, retry, and shutdown settings next to the component that owns the resource; avoid process-wide defaults that hide which caller accepted the trade-off.
Testing
Section titled “Testing”Run the module test task:
./gradlew :bluetape4k-jwt:test --no-configuration-cacheRepresentative test anchors:
AbstractJwtTestJwtComposerDslTestJwtComposerTestAbstractKeyChainRepositoryTestKeyChainTestInMemoryKeyChainRepositoryTestRedisKeyChainRepositoryTestAbstractJwtProviderTest
Workshops
Section titled “Workshops”No dedicated workshop path is registered in the manual manifest. Use the module README and the representative tests above as runnable evidence.
Limitations
Section titled “Limitations”This page documents the repository state represented by the linked source and tests. It does not turn optional backends into application defaults or claim performance without a benchmark artifact. Re-check compatibility and lifecycle notes when the module version changes.
Release diagrams
Section titled “Release diagrams”These diagrams are loaded directly from README assets published with the 1.11.0 release and pinned to its immutable commit. They describe this manual’s released structure and runtime flows, not later Snapshot changes. Select a preview to open the SVG at the same release commit.
JWT Create and Verify Flow diagram
Section titled “JWT Create and Verify Flow diagram”Release README: utils/jwt/README.md
JWT Class Structure diagram
Section titled “JWT Class Structure diagram”Release README: utils/jwt/README.md

