Package ch.bztf.m226blb1.Auth
Class AuthController
java.lang.Object
ch.bztf.m226blb1.Auth.AuthController
The rest controller for handling authentication.
- See Also:
- API Note:
- All methods return a
ResponseHandler
with the status and the data
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeletes anaccount
with the given API-keygenerateKey
(AuthAccount account) Post method for generating an API-key for the givenaccount
.regenerateKey
(AuthAccount account) Put method for regenerating an API-key for the givenaccount
-
Constructor Details
-
AuthController
public AuthController()
-
-
Method Details
-
generateKey
@PostMapping("/generate") public ResponseHandler<String> generateKey(@RequestBody AuthAccount account) Post method for generating an API-key for the givenaccount
.- Parameters:
account
- with the credentials needed to generate anaccount
- Returns:
- the API-key
- See Also:
-
regenerateKey
@PutMapping("/generate") public ResponseHandler<String> regenerateKey(@RequestBody AuthAccount account) Put method for regenerating an API-key for the givenaccount
- Parameters:
account
- with the existing API-key and logging data- Returns:
- the new API-key
- See Also:
-
deleteKey
@DeleteMapping("/delete") public ResponseHandler<String> deleteKey(@RequestParam(name="apiKey",required=false) @RequestHeader(name="Authorization",required=false) @Size(min=128,max=128) @Size(min=128,max=128) String apiKey) Deletes anaccount
with the given API-key- Parameters:
apiKey
- the API-key of the account to delete- Returns:
- the status of the deletion
- See Also:
-