Package io.floci.testcontainers.config
Class SecurityConfig.Builder
java.lang.Object
io.floci.testcontainers.config.SecurityConfig.Builder
- Enclosing class:
- SecurityConfig
Builder for
SecurityConfig.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates an immutableSecurityConfigfrom this builder.corsAllowPrivateNetwork(boolean corsAllowPrivateNetwork) Sets whether to grant Private Network Access preflights (respond withAccess-Control-Allow-Private-Network: true) when the browser asks.disableCorsHeaders(boolean disableCorsHeaders) Sets whether CORS headers are disabled.extraCorsAllowedHeaders(String... extraCorsAllowedHeaders) Sets the extra CORS allowed headers.extraCorsAllowedHeaders(List<String> extraCorsAllowedHeaders) Sets the extra CORS allowed headers.extraCorsAllowedOrigins(String... extraCorsAllowedOrigins) Sets the extra CORS allowed origins.extraCorsAllowedOrigins(List<String> extraCorsAllowedOrigins) Sets the extra CORS allowed origins.extraCorsExposeHeaders(String... extraCorsExposeHeaders) Sets the extra CORS expose headers.extraCorsExposeHeaders(List<String> extraCorsExposeHeaders) Sets the extra CORS expose headers.
-
Method Details
-
extraCorsAllowedOrigins
Sets the extra CORS allowed origins.- Parameters:
extraCorsAllowedOrigins- the list of allowed origins, ornullto clear- Returns:
- this builder
-
extraCorsAllowedOrigins
Sets the extra CORS allowed origins.- Parameters:
extraCorsAllowedOrigins- the allowed origins- Returns:
- this builder
-
extraCorsAllowedHeaders
Sets the extra CORS allowed headers.- Parameters:
extraCorsAllowedHeaders- the list of allowed headers, ornullto clear- Returns:
- this builder
-
extraCorsAllowedHeaders
Sets the extra CORS allowed headers.- Parameters:
extraCorsAllowedHeaders- the allowed headers- Returns:
- this builder
-
extraCorsExposeHeaders
Sets the extra CORS expose headers.- Parameters:
extraCorsExposeHeaders- the list of expose headers, ornullto clear- Returns:
- this builder
-
extraCorsExposeHeaders
Sets the extra CORS expose headers.- Parameters:
extraCorsExposeHeaders- the expose headers- Returns:
- this builder
-
disableCorsHeaders
Sets whether CORS headers are disabled.- Parameters:
disableCorsHeaders-trueto disable CORS headers (default false)- Returns:
- this builder
-
corsAllowPrivateNetwork
Sets whether to grant Private Network Access preflights (respond withAccess-Control-Allow-Private-Network: true) when the browser asks. Only takes effect after the origin already passes the CORS allow-list, so a page served from a public/secure origin can reach this loopback backend.Off by default: it lets a public origin reach the private network, so it must be opted into explicitly.
- Parameters:
corsAllowPrivateNetwork-trueto grant Private Network Access preflights (default false)- Returns:
- this builder
-
build
Creates an immutableSecurityConfigfrom this builder.- Returns:
- the security configuration
-