Package org.dspace.app.rest.utils
Class ApplicationConfig
- java.lang.Object
-
- org.dspace.app.rest.utils.ApplicationConfig
-
@Configuration @ComponentScan({"org.dspace.app.rest.converter","org.dspace.app.rest.repository","org.dspace.app.rest.utils","org.dspace.app.configuration","org.dspace.iiif","org.dspace.app.iiif"}) public class ApplicationConfig extends ObjectThis class provides extra configuration for our Spring Boot ApplicationNOTE: @ComponentScan on "org.dspace.app.configuration" provides a way for other DSpace modules or plugins to "inject" their own Spring configurations / subpaths into our Spring Boot webapp.
- Author:
- Andrea Bollini (andrea.bollini at 4science.it), Tim Donohue
-
-
Constructor Summary
Constructors Constructor Description ApplicationConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetCorsAllowCredentials()Return whether to allow credentials (cookies) on CORS requests.String[]getCorsAllowedOrigins(String[] corsOrigins)Return the array of allowed origins (client URLs) for the CORS "Access-Control-Allow-Origin" header Used by Application classString[]getCorsAllowedOriginsConfig()Returns the rest.cors.allowed-origins defined in DSpace configuration.booleangetIiifAllowCredentials()Return whether to allow credentials (cookies) on IIIF requests.String[]getIiifAllowedOriginsConfig()Returns the rest.iiif.cors.allowed-origins (for IIIF access) defined in DSpace configuration.
-
-
-
Method Detail
-
getCorsAllowedOrigins
public String[] getCorsAllowedOrigins(String[] corsOrigins)
Return the array of allowed origins (client URLs) for the CORS "Access-Control-Allow-Origin" header Used by Application class- Parameters:
corsOrigins- list of allowed origins for the dspace api or iiif endpoints- Returns:
- Array of URLs
-
getCorsAllowedOriginsConfig
public String[] getCorsAllowedOriginsConfig()
Returns the rest.cors.allowed-origins defined in DSpace configuration.- Returns:
- allowed origins
-
getIiifAllowedOriginsConfig
public String[] getIiifAllowedOriginsConfig()
Returns the rest.iiif.cors.allowed-origins (for IIIF access) defined in DSpace configuration.- Returns:
- allowed origins
-
getCorsAllowCredentials
public boolean getCorsAllowCredentials()
Return whether to allow credentials (cookies) on CORS requests. This is used to set the CORS "Access-Control-Allow-Credentials" header in Application class.- Returns:
- true or false
-
getIiifAllowCredentials
public boolean getIiifAllowCredentials()
Return whether to allow credentials (cookies) on IIIF requests. This is used to set the CORS "Access-Control-Allow-Credentials" header in Application class. Defaults to false.- Returns:
- true or false
-
-