Class 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 Object
    This class provides extra configuration for our Spring Boot Application

    NOTE: @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 Detail

      • ApplicationConfig

        public ApplicationConfig()
    • 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