Browse Source

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

qdn
CalDescent 3 years ago
parent
commit
940304b4c2
  1. 18
      src/main/java/org/qortal/api/resource/AdminResource.java

18
src/main/java/org/qortal/api/resource/AdminResource.java

@ -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";
}
}

Loading…
Cancel
Save