Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
  • release
  • OZG-7983-DatenAnfrageVeroffentlichen
  • OZG-8086-datenanfrage-erstellen
  • OZG-7774-E2E
  • OZG-5120-PoC-Native-Image
  • 1.9.0
  • 1.8.0
  • 1.7.0
  • 1.6.0
  • 1.5.0
  • 1.4.0
  • 1.3.0
  • 1.2.1
  • 1.2.0
  • 1.1.1
  • 1.1.0
  • 1.0.0
  • 0.8.0
  • 0.7.0
  • 0.6.0
  • 0.5.0
  • 0.4.0
  • 0.3.0
  • 0.2.0
  • 0.1.0
26 results

EnvironmentController.java

Blame
  • EnvironmentController.java 1.04 KiB
    package de.ozgcloud.admin.environment;
    
    import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.*;
    
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;
    
    import de.ozgcloud.admin.RootController;
    import lombok.RequiredArgsConstructor;
    
    @RestController("ozgCloudEnvironmentController")
    @RequiredArgsConstructor
    @RequestMapping(EnvironmentController.PATH)
    public class EnvironmentController {
    
    	static final String PATH = "/api/environment"; // NOSONAR
    
    	private final ProductionProperties environmentProperties;
    
    	private final OAuth2Properties oAuthProperties;
    
    	@GetMapping
    	public Environment getEnvironment() {
    		return Environment.builder()
    				.production(environmentProperties.isProduction())
    				.remoteHost(linkTo(RootController.class).toUri().toString())
    				.authServer(oAuthProperties.getAuthServerUrl())
    				.realm(oAuthProperties.getRealm())
    				.clientId(oAuthProperties.getResource())
    				.build();
    	}
    }