wip: Create some frontend components to test API generation

This commit is contained in:
Magnus Leßmann (@Mark.TwoFive) 2025-06-21 14:06:44 +02:00
parent 532d37ce81
commit e91bf96e74
Signed by: Mark.TwoFive
GPG key ID: 58204042FE30B10C
10 changed files with 138 additions and 6 deletions

View file

@ -16,7 +16,7 @@ public class SecurityConfiguration {
// Allow unauthenticated access to OpenAPI and swagger documentation.
// This should be removed or at least configurable at some point, but for now, this is fine (tm)
http.authorizeHttpRequests(auth -> auth
.requestMatchers("/v3/api-docs/**", "/swagger-ui/**", "/swagger-ui.html")
.requestMatchers("/v3/api-docs/**", "/v3/api-docs.yaml", "/swagger-ui/**", "/swagger-ui.html")
.permitAll());
return http.build();
}

View file

@ -38,6 +38,18 @@ public class CertificatesEndpoint {
return ResponseEntity.ok(DocumentedPage.of(certificates));
}
@GetMapping("/certificates/{fingerprint}")
@Operation(
description = "Fetches a single certificate by the provided fingerprint",
responses = {
@ApiResponse(responseCode = "200")
}
)
public ResponseEntity<Certificate> getCertificate(@PathVariable String fingerprint) {
var certificate = certificateRepository.findByFingerprintIs(fingerprint);
return ResponseEntity.ok(certificate);
}
@PostMapping("/certificates")
@Operation(description = "Requests a new certificate", responses = {
@ApiResponse(responseCode = "400", description = "One of the provided parameters is invalid."),