diff --git a/src/main/java/org/gringlobal/api/v1/impl/OAuthManagementController.java b/src/main/java/org/gringlobal/api/v1/impl/OAuthManagementController.java index 752a7e4f9853565e3a5079292820e4c4aa108b1d..40841f796003c4b8e9436ad0b1ee55eff4af43a1 100644 --- a/src/main/java/org/gringlobal/api/v1/impl/OAuthManagementController.java +++ b/src/main/java/org/gringlobal/api/v1/impl/OAuthManagementController.java @@ -15,6 +15,7 @@ */ package org.gringlobal.api.v1.impl; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.genesys.blocks.oauth.model.OAuthClient; import org.genesys.blocks.oauth.service.OAuthClientDetailsService; @@ -69,6 +70,7 @@ public class OAuthManagementController extends ApiBaseController { * @return the loaded OAuth client */ @GetMapping(value = ENDPOINT_CLIENT_ID) + @Operation(operationId = "getOauthClient", summary = "Get", description = "Get OAuth client by clientId") public OAuthClient get(@PathVariable(value = "clientId") final String clientId) throws NotFoundElement { OAuthClient client = clientDetailsService.getClient(clientId); if (client == null) { @@ -84,6 +86,7 @@ public class OAuthManagementController extends ApiBaseController { * @return the recorded OAuth client */ @PostMapping(value = "") + @Operation(operationId = "addOauthClient", summary = "Create", description = "Add new OAuth client") public OAuthClient create(@RequestBody OAuthClient source) { OAuthClient oauthClient = clientDetailsService.addClient(source); LOG.info("Created OAuth client with clientId={}", oauthClient.getClientId()); @@ -97,6 +100,7 @@ public class OAuthManagementController extends ApiBaseController { * @return the updated OAuth client */ @PutMapping(value = "") + @Operation(operationId = "updateOauthClient", summary = "Update", description = "Update OAuth client") public OAuthClient update(@RequestBody OAuthClient source) throws NotFoundElement { OAuthClient client = get(source.getClientId()); return clientDetailsService.updateClient(client.getId(), source.getVersion(), source); @@ -109,6 +113,7 @@ public class OAuthManagementController extends ApiBaseController { * @return the removed client */ @DeleteMapping(value = ENDPOINT_CLIENT_ID) + @Operation(operationId = "removeOauthClient", summary = "Delete", description = "Remove OAuth client") public OAuthClient remove(@PathVariable("clientId") final String clientId) throws NotFoundElement { OAuthClient client = get(clientId); LOG.info("Removing client {}", client.getClientId()); @@ -122,6 +127,7 @@ public class OAuthManagementController extends ApiBaseController { * @return the secret */ @PostMapping(value = ENDPOINT_CLIENT_ID + "/secret") + @Operation(operationId = "generateSecret", summary = "Regenerate secret", description = "Generate a new secret for OAuth client") public String generateSecret(@PathVariable(value = "clientId") final String clientId) throws NotFoundElement { OAuthClient client = get(clientId); return clientDetailsService.resetSecret(client); @@ -134,6 +140,7 @@ public class OAuthManagementController extends ApiBaseController { * @return the updated client */ @DeleteMapping(value = ENDPOINT_CLIENT_ID + "/secret") + @Operation(operationId = "clearSecret", summary = "Clear secret", description = "Clear the secret for OAuth client") public OAuthClient removeSecret(@PathVariable(value = "clientId") final String clientId) throws NotFoundElement { clientDetailsService.removeSecret(get(clientId)); return get(clientId); @@ -149,6 +156,7 @@ public class OAuthManagementController extends ApiBaseController { * @throws IOException Signals that an I/O exception has occurred. */ @PostMapping(value = "/filter") + @Operation(operationId = "listClients", summary = "List", description = "List OAuth clients") public FilteredPage listClients(@RequestParam(name = "f", required = false) String filterCode, final Pagination page, @RequestBody(required = false) OAuthClientFilter filter) throws IOException {