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:
- Discover custom CsrfTokenRepository implementations registered as pods
- Build a default repository from environment configuration
- Provide a fallback repository if none is configured
Discovery Process
On initialization (onReady), the manager:
- Searches the application context for CsrfTokenRepository pods
- If found, uses the discovered repository
- If not found, uses RequestAttributeCsrfTokenRepository as fallback
Environment Integration
The manager reads configuration from environment properties:
jetleaf.web.csrf.enabled- Global enable/disable flagjetleaf.web.csrf.header-name- Custom header namejetleaf.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
ApplicationContextthat this component runs in. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited