CorsConfig

@Configuration
@ConditionalOnProperty(name = "cryptotrader.api.cors.enabled", havingValue = "true", matchIfMissing = true)
open class CorsConfig : WebMvcConfigurer

Central CORS configuration for the API. Summary: - Reads allowed origins/methods/headers from properties under cryptotrader.api.cors.* - Allows credentials when configured (required for HttpOnly refresh cookie in dev/prod as applicable). - Registers both MVC mapping-based CORS and a CorsConfigurationSource bean for frameworks that use it. Properties: - cryptotrader.api.cors.allowed-origins (default http://localhost:4200) - cryptotrader.api.cors.allowed-methods (default GET,POST,PUT,DELETE,PATCH,OPTIONS) - cryptotrader.api.cors.allowed-headers (default *) - cryptotrader.api.cors.exposed-headers (default Location,Link) - cryptotrader.api.cors.allow-credentials (default true)

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun addArgumentResolvers(resolvers: List<HandlerMethodArgumentResolver>)
Link copied to clipboard
open fun addCorsMappings(registry: CorsRegistry)
Programmatically registers CORS rules for all controller endpoints.
Link copied to clipboard
open fun addErrorResponseInterceptors(interceptors: List<ErrorResponse.Interceptor>)
Link copied to clipboard
open fun addFormatters(registry: FormatterRegistry)
Link copied to clipboard
open fun addInterceptors(registry: InterceptorRegistry)
Link copied to clipboard
open fun addResourceHandlers(registry: ResourceHandlerRegistry)
Link copied to clipboard
open fun addReturnValueHandlers(handlers: List<HandlerMethodReturnValueHandler>)
Link copied to clipboard
open fun addViewControllers(registry: ViewControllerRegistry)
Link copied to clipboard
open fun configureAsyncSupport(configurer: AsyncSupportConfigurer)
Link copied to clipboard
open fun configureContentNegotiation(configurer: ContentNegotiationConfigurer)
Link copied to clipboard
open fun configureDefaultServletHandling(configurer: DefaultServletHandlerConfigurer)
Link copied to clipboard
open fun configureHandlerExceptionResolvers(resolvers: List<HandlerExceptionResolver>)
Link copied to clipboard
open fun configureMessageConverters(converters: List<HttpMessageConverter<out Any>>)
Link copied to clipboard
open fun configurePathMatch(configurer: PathMatchConfigurer)
Link copied to clipboard
open fun configureViewResolvers(registry: ViewResolverRegistry)
Link copied to clipboard
@Bean
@ConditionalOnMissingBean(value = CorsConfigurationSource::class)
open fun corsConfigurationSource(): CorsConfigurationSource
Provide a CorsConfigurationSource bean for components that look it up directly (e.g.
Link copied to clipboard
open fun extendHandlerExceptionResolvers(resolvers: List<HandlerExceptionResolver>)
Link copied to clipboard
open fun extendMessageConverters(converters: List<HttpMessageConverter<out Any>>)
Link copied to clipboard
open fun getMessageCodesResolver(): MessageCodesResolver
Link copied to clipboard
open fun getValidator(): Validator