Repository navigation
v3.0.0
Authentication (helidon-extensions)
Endpoints can now declare an Authentication parameter; the codegen resolves it from the request context.
Authentication/AuthenticationResolverinterfaces andAuthenticationFilter(lazy resolution per request)- Provide an
AuthenticationResolvervia the registry (@Creates); it's wired into routing automatically - Declared
Authenticationparameter types are type-checked against the resolved authentication
data class UserAuthN(val id: String) : Authentication
@Get("/user")
fun user(auth: UserAuthN, res: ServerResponse) {
res.send(auth.id)
}ksp {
arg("stopgap.codegen.endpoint.auth.defaultType", "public") // or an Authentication FQN
}See docs/proposals/0001-securing-api.md.
helidon-test
SetupCapturegainsauthResolver(defaults toTestAuthFakeResolver)WebserverExtensionregistersAuthenticationFilterfor integration tests
⚠️ Breaking changes
- Closed by default: endpoint methods without an
Authenticationparameter fail compilation unlessstopgap.codegen.endpoint.auth.defaultTypeis configured - KSP option renamed:
endpoint.codegen.registry.skip=true→stopgap.codegen.endpoint.registry.enabled=false(no fallback) SetupCapture: newauthResolverparameter in 2nd position — positional args must be updated
dependencies {
implementation("dev.sku20.stopgap:helidon-extensions:3.0.0")
testImplementation("dev.sku20.stopgap:helidon-test:3.0.0")
}