Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GRIN-Global Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
24
Issues
24
List
Boards
Labels
Service Desk
Milestones
Packages & Registries
Packages & Registries
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
GRIN-Global
GRIN-Global Server
Commits
340f0796
Commit
340f0796
authored
Jan 26, 2021
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: OAuth client controller docs
parent
a3fe3ca4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
src/main/java/org/gringlobal/api/v1/impl/OAuthManagementController.java
...org/gringlobal/api/v1/impl/OAuthManagementController.java
+8
-0
No files found.
src/main/java/org/gringlobal/api/v1/impl/OAuthManagementController.java
View file @
340f0796
...
...
@@ -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
<
OAuthClient
,
OAuthClientFilter
>
listClients
(
@RequestParam
(
name
=
"f"
,
required
=
false
)
String
filterCode
,
final
Pagination
page
,
@RequestBody
(
required
=
false
)
OAuthClientFilter
filter
)
throws
IOException
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment