pub struct SessionConfigBuilder { /* private fields */ }Expand description
Assembles a SessionConfig. Created with SessionConfig::builder.
Implementations§
Source§impl SessionConfigBuilder
impl SessionConfigBuilder
Sourcepub fn token_store(self, token_store: impl TokenStore + 'static) -> Self
pub fn token_store(self, token_store: impl TokenStore + 'static) -> Self
Overrides the TokenStore carrying the session token between the
client and the server.
Sourcepub fn trust_origin(self, origin: impl Into<String>) -> Self
Available on crate feature router only.
pub fn trust_origin(self, origin: impl Into<String>) -> Self
router only.Trusts origin to send state-changing cross-origin requests, exempting
it from verify_origin.
The value is compared against the request’s Origin header, so pass
the full serialized origin: scheme, host, and any non-default port
("https://accounts.example.com"), with no trailing slash.
Sourcepub fn dangerous_disable_origin_verification(self) -> Self
Available on crate feature router only.
pub fn dangerous_disable_origin_verification(self) -> Self
router only.Disables the OriginLayer that the router’s
sessions extension method registers.
Without the layer, nothing rejects state-changing cross-origin requests; only disable it if the application enforces its own defense against cross-site request forgery.
Sourcepub fn build(self) -> SessionConfig
pub fn build(self) -> SessionConfig
Consumes the builder, returning the finished SessionConfig.
§Panics
Panics when no token store was set and the default cookie store is
unavailable because the cookie feature is disabled.