From a910371882b3372c9f838b7c97b759f96dc4c809 Mon Sep 17 00:00:00 2001 From: VLE2FE Date: Wed, 5 Aug 2020 18:28:27 +0200 Subject: [PATCH] removed maintain user, constrained spctra access --- .idea/dictionaries/VLE2FE.xml | 1 + api/api.yaml | 45 +++++++++------ api/material.yaml | 22 +++---- api/measurement.yaml | 14 ++--- api/root.yaml | 6 +- api/sample.yaml | 53 ++++++++++------- api/template.yaml | 8 +-- api/user.yaml | 8 +-- data_import/import.js | 51 +++++++++-------- src/globals.ts | 3 +- src/routes/material.spec.ts | 2 +- src/routes/material.ts | 71 +++++++++++++++-------- src/routes/measurement.spec.ts | 27 ++++++--- src/routes/measurement.ts | 47 +++++++++------ src/routes/root.ts | 2 +- src/routes/sample.spec.ts | 92 ++++++++++++++++++++++++------ src/routes/sample.ts | 66 ++++++++++----------- src/routes/template.ts | 20 ++++--- src/routes/user.spec.ts | 2 +- src/routes/user.ts | 30 ++++++---- src/routes/validate/measurement.ts | 6 +- src/test/db.json | 2 +- 22 files changed, 357 insertions(+), 221 deletions(-) diff --git a/.idea/dictionaries/VLE2FE.xml b/.idea/dictionaries/VLE2FE.xml index 2d3f5ec..16f4de3 100644 --- a/.idea/dictionaries/VLE2FE.xml +++ b/.idea/dictionaries/VLE2FE.xml @@ -18,6 +18,7 @@ frameguard functionlink glassfibrecontent + isin janedoe johnnydoe kfingew diff --git a/api/api.yaml b/api/api.yaml index 7089f4a..45be8c4 100644 --- a/api/api.yaml +++ b/api/api.yaml @@ -5,28 +5,35 @@ info: title: Digital fingerprint of plastics - API version: 1.0.0 description: | - This API gives access to the project database.
+ This **API** gives access to the project database. + Access is restricted. Authentication can be obtained with HTTP Basic Auth using username and password. - Data access methods can also be accessed using an API key at the URL ending like ?key=xxx
+ Data access methods can also be accessed using an API key at the URL ending like ?key=xxx + The description lists available authentication methods, also the locks of each method close correspondingly - if the entered authentication is allowed.

- There are a number of different user levels:
- + if the entered authentication is allowed. + + + There are a number of different user levels: + + | | read sample data | add samples/edit own | read spectral data | edit other's data | maintain templates | edit users | + |:-----:|:----------------:|:--------------------:|:------------------:|:-----------------:|:------------------:|:----------:| + | read | yes | no | no | no | no | no | + | write | yes | yes | no | no | no | no | + | dev | yes | yes | yes | yes | yes | no | + | admin | yes | yes | yes | yes | yes | yes | + Password policy: - + + - at least one digit + - at least one lower case letter + - at least one upper case letter + - at least one of the following special characters: !"#%&'()*+,-./:;<=>?@[\]^_`{|}~ + - no whitespace + - at least 8 characters + +
+ x-doc: | status: