Package io.micronaut.multitenancy.writer
Class CookieTenantWriterConfigurationProperties
java.lang.Object
io.micronaut.multitenancy.writer.CookieTenantWriterConfigurationProperties
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
,io.micronaut.http.cookie.CookieConfiguration
,CookieTenantWriterConfiguration
@ConfigurationProperties("micronaut.multitenancy.tenantwriter.cookie")
public class CookieTenantWriterConfigurationProperties
extends Object
implements CookieTenantWriterConfiguration
ConfigurationProperties
implementation of CookieTenantWriterConfiguration
.- Since:
- 1.0
- Author:
- Sergio del Amo
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NonNull String
@NonNull String
Optional<io.micronaut.http.cookie.SameSite>
boolean
void
setCookieDomain
(@Nullable String cookieDomain) Sets the domain name of this Cookie.void
setCookieHttpOnly
(boolean cookieHttpOnly) Whether the Cookie can only be accessed via HTTP.void
setCookieMaxAge
(TemporalAmount cookieMaxAge) Sets the maximum age of the cookie.void
setCookiename
(String cookiename) Cookie Name.void
setCookiePath
(@Nullable String cookiePath) Sets the path of the cookie.void
setCookieSameSite
(io.micronaut.http.cookie.SameSite sameSite) Determines if this thisCookie
can be sent along cross-site requests.void
setCookieSecure
(boolean cookieSecure) Sets whether the cookie is secured.void
setEnabled
(boolean enabled) EnablesCookieTenantWriter
.
-
Field Details
-
PREFIX
Configuration Properties Prefix.- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
DEFAULT_HTTPONLY
public static final boolean DEFAULT_HTTPONLYThe default http only value.- See Also:
-
DEFAULT_COOKIENAME
The default cookie name.- See Also:
-
DEFAULT_COOKIEPATH
Default Cookie Path.- See Also:
-
-
Constructor Details
-
CookieTenantWriterConfigurationProperties
public CookieTenantWriterConfigurationProperties()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
-
setEnabled
public void setEnabled(boolean enabled) EnablesCookieTenantWriter
. Default value (false).- Parameters:
enabled
- enabled flag
-
setCookiename
Cookie Name. Default value ("tenantId").- Parameters:
cookiename
- Cookie name
-
getCookiename
- Specified by:
getCookiename
in interfaceCookieTenantWriterConfiguration
- Returns:
- an HTTP Header name. e.g. Authorization
-
getCookieName
- Specified by:
getCookieName
in interfaceio.micronaut.http.cookie.CookieConfiguration
-
getCookieDomain
- Specified by:
getCookieDomain
in interfaceio.micronaut.http.cookie.CookieConfiguration
- Returns:
- the domain name of this Cookie
-
getCookiePath
- Specified by:
getCookiePath
in interfaceio.micronaut.http.cookie.CookieConfiguration
- Returns:
- The path of the cookie.
-
isCookieHttpOnly
- Specified by:
isCookieHttpOnly
in interfaceio.micronaut.http.cookie.CookieConfiguration
- Returns:
- Whether the Cookie can only be accessed via HTTP.
-
isCookieSecure
- Specified by:
isCookieSecure
in interfaceio.micronaut.http.cookie.CookieConfiguration
- Returns:
- True if the cookie is secure
-
getCookieMaxAge
- Specified by:
getCookieMaxAge
in interfaceio.micronaut.http.cookie.CookieConfiguration
- Returns:
- The max age to use for the cookie
-
setCookieDomain
Sets the domain name of this Cookie. Default value ("tenantId").- Parameters:
cookieDomain
- the domain name of this Cookie
-
setCookiePath
Sets the path of the cookie. Default value ("/".- Parameters:
cookiePath
- The path of the cookie.
-
setCookieHttpOnly
public void setCookieHttpOnly(boolean cookieHttpOnly) Whether the Cookie can only be accessed via HTTP. Default value (true.- Parameters:
cookieHttpOnly
- Whether the Cookie can only be accessed via HTTP.
-
setCookieSecure
public void setCookieSecure(boolean cookieSecure) Sets whether the cookie is secured. Defaults to the secure status of the request.- Parameters:
cookieSecure
- True if the cookie is secure
-
setCookieMaxAge
Sets the maximum age of the cookie.- Parameters:
cookieMaxAge
- The maximum age of the cookie
-
getCookieSameSite
- Specified by:
getCookieSameSite
in interfaceio.micronaut.http.cookie.CookieConfiguration
-
setCookieSameSite
public void setCookieSameSite(io.micronaut.http.cookie.SameSite sameSite) Determines if this thisCookie
can be sent along cross-site requests. For more information, please look here- Parameters:
sameSite
- SameSite value
-