Skip to content
Snippets Groups Projects
Commit dafeacf4 authored by Felix Sidokhine's avatar Felix Sidokhine
Browse files

Added OpenAPI 3 compatible docs

parent 68142365
No related branches found
No related tags found
No related merge requests found
openapi: 3.0.0
info:
title: Admin API
version: '1.0'
servers:
- url: 'http://localhost:8080'
paths:
/api/admin/device:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-admin-device
put:
summary: ''
operationId: put-api-admin-device
responses:
'200':
description: OK
delete:
summary: ''
operationId: delete-api-admin-device
responses:
'200':
description: OK
/api/admin/devices:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-admin-devices
/api/admin/directory/entry:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-admin-directory-entry
put:
summary: ''
operationId: put-api-admin-directory-entry
responses:
'200':
description: OK
post:
summary: ''
operationId: post-api-admin-directory-entry
responses:
'200':
description: OK
/api/admin/user:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-admin-user
post:
summary: ''
operationId: post-api-admin-user
responses:
'200':
description: OK
delete:
summary: ''
operationId: delete-api-admin-user
responses:
'200':
description: OK
put:
summary: ''
operationId: put-api-admin-user
responses:
'200':
description: OK
/api/admin/users:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-admin-users
components:
schemas: {}
openapi: 3.0.0
info:
title: Install API
version: '1.0'
servers:
- url: 'http://localhost:3000'
paths:
/api/install/auth:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-install-auth
/api/install/ca:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-install-ca
/api/install/settings:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-install-settings
/api/install/start:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-install-start
components:
schemas: {}
openapi: 3.0.0
info:
title: Nameserver API
version: '1.0'
servers:
- url: 'http://localhost:8080'
paths:
'/api/nameserver/addr/{addr}':
parameters:
- schema:
type: string
name: addr
in: path
required: true
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-nameserver-addr-addr
'/api/nameserver/name/{name}':
parameters:
- schema:
type: string
name: name
in: path
required: true
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-nameserver-name-name
components:
schemas: {}
openapi: 3.0.0
info:
title: Security API
version: '1.0'
servers:
- url: 'http://localhost:8080'
paths:
/api/auth/login:
post:
summary: ''
operationId: post-api-auth-login
responses:
'200':
description: OK
components:
schemas: {}
openapi: 3.0.0
info:
title: User API
version: '1.0'
servers:
- url: 'http://localhost:8080'
paths:
/api/auth/contacts:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-auth-contacts
'/api/auth/device/{deviceId}':
parameters:
- schema:
type: string
name: deviceId
in: path
required: true
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-auth-device-deviceId
/api/auth/devices:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-auth-devices
/api/auth/directories:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-auth-directories
/api/auth/directory/entry:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-auth-directory-entry
/api/auth/directory/search:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-auth-directory-search
/api/auth/user:
get:
summary: Your GET endpoint
tags: []
responses: {}
operationId: get-api-auth-user
components:
schemas: {}
securitySchemes:
API Key - 1:
name: API Key
type: apiKey
in: query
......@@ -45,7 +45,7 @@ public class DeviceServlet extends HttpServlet {
@Override
protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String username = req.getAttribute("username").toString();
String deviceId = req.getParameter("deviceId");
String deviceId = req.getPathInfo().replace("/","");
String deviceName = req.getParameter("deviceName");
StatementList update = new StatementList();
StatementElement st0 = new StatementElement("deviceName","=",deviceName,"");
......@@ -61,8 +61,8 @@ public class DeviceServlet extends HttpServlet {
@Override
protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doDelete(req, resp);
DeviceRevocationResponse devResponse = RevokeDeviceFlow.revokeDevice(req.getAttribute("username").toString(),req.getParameter("deviceId"));
String deviceId = req.getPathInfo().replace("/","");
DeviceRevocationResponse devResponse = RevokeDeviceFlow.revokeDevice(req.getAttribute("username").toString(),deviceId);
if(devResponse != null) resp.getOutputStream().write(JsonStream.serialize(devResponse).getBytes());
else resp.sendError(500,"An exception has occurred while trying to revoke a device!");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment