forked from Qortal/qortal
Added GET /admin/apikey/test endpoint, so that we have a dedicated place to test if authentication works.
This commit is contained in:
parent
b4d2fae27f
commit
940304b4c2
@ -746,4 +746,22 @@ public class AdminResource {
|
|||||||
return apiKey.toString();
|
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…
Reference in New Issue
Block a user