From 1bb07f0227b05494104dd2235d07e6a562cb1561 Mon Sep 17 00:00:00 2001 From: Filip Bucek Date: Mon, 30 Sep 2019 13:19:03 +0200 Subject: [PATCH] restapi: added info about endpoinst + openapi 3.0 description --- README.md | 32 ++++++++++- openapi-testserver.yaml | 117 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 openapi-testserver.yaml diff --git a/README.md b/README.md index 96467dc..ca64db4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,34 @@ # colnod-connector +Acces Management System of Colsys: [Product info](http://produkty.colsys.cz/colnod/) -## Colnod +## RestAPI definitions -Acces Management System of Colsys: [Product info](http://produkty.colsys.cz/colnod/) \ No newline at end of file +- `openapi.yaml` ( editor `VSCode` with `Swagger Viewer` extension - ⌘+⇧+P `Preview Swagger` ) + +## Colnod Test server + +[Colnod server: confluence](https://spaceti.atlassian.net/wiki/spaces/IN/pages/97320961/Colsys+-+Colnod) + +- URL: `192.168.1.3:8843` +- `!!! No license!!!` - server will shutdown after 8 hours. + - restart: `sudo service cndserver start` + - check `nmap -p8443 192.168.1.3` or `nc -zvw3 192.168.1.3 8443` + - user: `spaceti` + - password: `` + - sha512: `E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0` + +```bash +curl -k --user "spaceti:E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0" -d '{"password":"E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0","username":"spaceti"}' -H "Content-Type: application/json" https://192.168.1.3:8443/AaaManager/authSession +``` + +## Colnod Penta server + +- Acces through: `penta-master` IP:`172.16.3.4` +- URL: `192.168.254.11:8443` +- Port forwarding: `ssh -L 8443:192.168.254.11:8443 penta-master` + - `!!! does not work !!!` + +```bash +curl -k --user "spaceti:E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0" -d '{"password":"E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0","username":"spaceti"}' -H "Content-Type: application/json" https://192.168.254.11:8443/AaaManager/authSession +``` diff --git a/openapi-testserver.yaml b/openapi-testserver.yaml new file mode 100644 index 0000000..c62d493 --- /dev/null +++ b/openapi-testserver.yaml @@ -0,0 +1,117 @@ +openapi: 3.0.0 +info: + description: "Colnod system: [Product information](http://produkty.colsys.cz/colnod) +Jira issues: + [Communicaiton with + Colnod](https://spaceti.atlassian.net/secure/RapidBoard.jspa?rapidView=78&p\ + rojectKey=INT&modal=detail&selectedIssue=INT-3563)" + version: 1.0.0 + title: Colnod server + contact: + name: Filip Bucek + email: filip.bucek@spaceti.com + +servers: + - url: http://192.168.1.3:8443 + +tags: + - name: login + description: Login information ( token ) + - name: user + description: Operations about user + - name: token + description: Working with tokens ( keys ) +paths: + /AaaManager/authSession: + post: + summary: Login user + description: Loging using sha512 hash + requestBody: + description: Optional description in *Markdown* + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Login' + # content: + # "*/*": + # schema: + # $ref: "#/components/schemas/Login" + tags: + - login + # parameters: + # username: spaceti + # password: E7FEA07DBC82FB9BA34B2E453E2EFE89F0583E7187543507EF11E84726071FE428445372F2E46B455EB0C79747C51E362F403CE39473A2A8C2DFA0CE5C9826C0 + responses: + "200": + description: Login success + content: + "*/*": + schema: + $ref: "#/components/schemas/Token" + "400": + description: "" + content: + "*/*": + schema: + $ref: "#/components/schemas/Token" + /SubjectManager/getSubjects: + get: + summary: Get subjects + tags: + - user + responses: + "200": + description: xxxxx + /TokenManager/getTokens: + get: + tags: + - token + responses: + "200": + description: xxxxx + /TokenManager/setTokens: + delete: + tags: + - token + responses: + "200": + description: xxxxx +components: + securitySchemes: + basicAuth: # <-- arbitrary name for the security scheme + type: http + scheme: basic + + + # petstore_auth: + # type: oauth2 + # flows: + # implicit: + # authorizationUrl: http://petstore.swagger.io/oauth/dialog + # scopes: + # write:pets: modify pets in your account + # read:pets: read your pets + # api_key: + # type: apiKey + # name: api_key + # in: header + schemas: + Login: + type: object + properties: + username: + type: string + password: + type: string + + Token: + type: object + properties: + tokenType: + type: string + tokenBits: + type: integer + +# security: +# - basicAuth: [d] # <-- use the same name here \ No newline at end of file