DefaultCsrfTokenRepositoryManager class final

Default implementation of CsrfTokenRepositoryManager responsible for discovering, configuring, and providing access to CsrfTokenRepository instances.

This manager integrates with the Jetleaf ApplicationContext to:

  1. Discover custom CsrfTokenRepository implementations registered as pods
  2. Build a default repository from environment configuration
  3. Provide a fallback repository if none is configured

Discovery Process

On initialization (onReady), the manager:

  1. Searches the application context for CsrfTokenRepository pods
  2. If found, uses the discovered repository
  3. If not found, uses RequestAttributeCsrfTokenRepository as fallback

Environment Integration

The manager reads configuration from environment properties:

  • jetleaf.web.csrf.enabled - Global enable/disable flag
  • jetleaf.web.csrf.header-name - Custom header name
  • jetleaf.web.csrf.parameter-name - Custom parameter name

Example

final manager = DefaultCsrfTokenRepositoryManager();
await manager.onReady(); // Discovers repositories

final repository = manager.getRepository();
final token = repository.generateToken(request);
Implemented types

Constructors

DefaultCsrfTokenRepositoryManager()
Default implementation of CsrfTokenRepositoryManager responsible for discovering, configuring, and providing access to CsrfTokenRepository instances.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getPackageName() String
Represents an abstraction for identifying the package that an object, resource, or service belongs to.
getRepository() CsrfTokenRepository
Returns the CsrfTokenRepository to use for token operations.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onReady() Future<void>
Interface to be implemented by pods that require initialization logic after their properties have been set by the container.
setApplicationContext(ApplicationContext applicationContext) → void
Sets the ApplicationContext that this component runs in.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited