Package dev.dokimos.server.controller.v1
Class ApiKeyController
java.lang.Object
dev.dokimos.server.controller.v1.ApiKeyController
Manages scoped API keys. Every write here requires an
ADMIN principal, enforced by
ApiKeyAuthFilter. Create returns the raw generated key exactly once;
all other responses carry metadata only.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<CreatedApiKeyView> createApiKey(@Valid CreateApiKeyRequest request) Mints a key.voiddeleteApiKey(UUID id) Permanently deletes a key.disableApiKey(UUID id) Disables a key so it can no longer authenticate.Lists every key as metadata only; the raw key is never returned.
-
Constructor Details
-
ApiKeyController
-
-
Method Details
-
createApiKey
@PostMapping public org.springframework.http.ResponseEntity<CreatedApiKeyView> createApiKey(@Valid @RequestBody @Valid CreateApiKeyRequest request) Mints a key. Returns 201 with aLocationheader and the raw key in the body; the raw key is never retrievable again. -
listApiKeys
Lists every key as metadata only; the raw key is never returned. -
disableApiKey
Disables a key so it can no longer authenticate. Returns 404 if it does not exist. -
deleteApiKey
Permanently deletes a key. Returns 404 if it does not exist.
-