Added GET /admin/apikey/test endpoint, so that we have a dedicated place to test if authentication works.

This commit is contained in:
CalDescent 2022-01-09 20:08:45 +00:00
parent b4d2fae27f
commit 940304b4c2

View File

@ -746,4 +746,22 @@ public class AdminResource {
return apiKey.toString();
}
@GET
@Path("/apikey/test")
@Operation(
summary = "Test an API key",
responses = {
@ApiResponse(
description = "true if authenticated",
content = @Content(mediaType = MediaType.TEXT_PLAIN, schema = @Schema(type = "boolean"))
)
}
)
@SecurityRequirement(name = "apiKey")
public String testApiKey() {
Security.checkApiCallAllowed(request);
return "true";
}
}