Ether Framework
Unified API docs for Ether modules
Loading...
Searching...
No Matches
dev.rafex.ether.glowroot.jetty12.GlowrootAuthUserMiddleware Class Reference

Middleware that sets the authenticated user on the Glowroot transaction. More...

Inheritance diagram for dev.rafex.ether.glowroot.jetty12.GlowrootAuthUserMiddleware:
Collaboration diagram for dev.rafex.ether.glowroot.jetty12.GlowrootAuthUserMiddleware:

Public Member Functions

 GlowrootAuthUserMiddleware (final Function< HttpExchange, String > userExtractor)
 Creates a middleware with the given user-extractor function.
HttpHandler wrap (final HttpHandler next)

Detailed Description

Middleware that sets the authenticated user on the Glowroot transaction.

Calls Glowroot#setTransactionUser(String) with the value returned by a configurable userExtractor function. If the extractor returns null or blank, the user is not set.

For Jetty-specific extraction from JWT auth context use GlowrootJettyExtractors#authUser() to obtain the extractor:


middlewareRegistry.add(new GlowrootAuthUserMiddleware(GlowrootJettyExtractors.authUser()));

Setting the user enables Glowroot's "User recording" — you can search all slow traces for a specific user, invaluable for debugging user-specific issues.

Definition at line 62 of file GlowrootAuthUserMiddleware.java.

Constructor & Destructor Documentation

◆ GlowrootAuthUserMiddleware()

dev.rafex.ether.glowroot.jetty12.GlowrootAuthUserMiddleware.GlowrootAuthUserMiddleware ( final Function< HttpExchange, String > userExtractor)

Creates a middleware with the given user-extractor function.

Parameters
userExtractorfunction that derives the user identifier from an HttpExchange; must not be null

Definition at line 72 of file GlowrootAuthUserMiddleware.java.

Member Function Documentation

◆ wrap()

HttpHandler dev.rafex.ether.glowroot.jetty12.GlowrootAuthUserMiddleware.wrap ( final HttpHandler next)

Implements dev.rafex.ether.http.core.Middleware.

Definition at line 77 of file GlowrootAuthUserMiddleware.java.

References dev.rafex.ether.http.core.HttpHandler.handle().

Here is the call graph for this function:

The documentation for this class was generated from the following file: