feat(version): exposer GET /api/v1/version public sans authentification
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,7 @@ public class SecurityConfig {
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
.requestMatchers(
|
||||
"/api/v1/auth/**",
|
||||
"/api/v1/version",
|
||||
"/swagger-ui/**",
|
||||
"/swagger-ui.html",
|
||||
"/api-docs/**",
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.olhar.olharapi.interfaces.rest.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.boot.info.BuildProperties;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/version")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Version", description = "Version de l'API")
|
||||
public class VersionController {
|
||||
|
||||
private final BuildProperties buildProperties;
|
||||
|
||||
@GetMapping
|
||||
@Operation(summary = "Retourne la version de l'API")
|
||||
public Map<String, String> getVersion() {
|
||||
return Map.of("version", buildProperties.getVersion());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user