wip: Create some frontend components to test API generation
This commit is contained in:
parent
532d37ce81
commit
e91bf96e74
10 changed files with 138 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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."),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue