Commit graph

181 commits

Author SHA1 Message Date
f6d9713f35 improve debug output 2021-02-08 11:55:36 +01:00
0b4d25d85c add new /authenticated endpoint for checking if a user is authenticated 2021-02-08 11:55:36 +01:00
fe2d291bb3 add support for external authentication via OAuth2 proxy 2021-02-08 11:55:36 +01:00
ffa532bddc user: add NewUser() 2021-02-08 11:55:36 +01:00
f4c662940e Authentication: remove unused argument 2021-02-08 11:55:36 +01:00
59c924bcff update package name of response docs as changed upstream in swag 2021-02-05 22:44:45 +01:00
Sonja Happ
616a1c74dc WIP: adding test data via JSON file #44 2021-01-26 15:44:51 +01:00
2625e16fbe config: fix typo GolbalConfig -> GlobalConfig 2021-01-25 10:57:25 +01:00
c404c7af5a make JWT secret and expiry time configurable 2021-01-25 10:56:40 +01:00
fee9e3aa6d allow passing token via URL query parameter (closes #49) 2020-11-23 17:29:50 +01:00
Sonja Happ
c4d7fc9488 add APIkey-based authentication to swagger documentation 2020-09-25 16:16:46 +02:00
Sonja Happ
1de4d9c9c2 Code base refactoring: no functional changes, improving test coverage 2020-03-27 11:53:26 +01:00
Sonja Happ
70b2ded851 modularize main function, use DBpool instead of local DB in database package and all testing functions 2020-03-19 10:50:18 +01:00
Sonja Happ
92f22035c6 add GPL 3.0 license statement in all (not auto-generated) code files 2019-11-20 11:08:33 +01:00
Sonja Happ
6d4c84ec4e - InitDB returns error
- Check more errors in InitDB
- fix for healthz endpoint (error checking was wrong)
- remove dbinit parameter from config due to redundancy with mode parameter
2019-11-14 11:44:26 +01:00
Sonja Happ
7a64d4653a Some fixes with respect to config
- resolve some name overlappings
- InitConfig sets global config and returns error
- Add missing error handling
2019-11-14 10:38:51 +01:00
d546f7bc91 fix tests 2019-11-13 21:22:17 +01:00
Sonja Happ
a8a43f8512 Improvements for swagger API documentation
- Adds Authorization token as required header param to all endpoints (except authenticate itself)
- Documents correct data format for request bodies (relevant for updating and adding elements)
- No functional changes applied
2019-11-13 14:48:08 +01:00
Sonja Happ
c6cac69906 #26 complete implementation of healthz endpoint and testing 2019-11-13 09:43:37 +01:00
Sonja Happ
7963ce5e78 remove DB_TEST and use DB_NAME instead, InitDB function now has parameter to specify if DB is used for testing or not 2019-11-11 12:06:53 +01:00
2311d643c6 fix repo path 2019-11-09 11:40:56 +01:00
Sonja Happ
df910c56f7 admin password required to change user's password as admin, fixes #24 2019-11-05 12:05:39 +01:00
Sonja Happ
bae3bc9046 user: admin user can change password of any user without knowing old password 2019-10-24 12:44:26 +02:00
Sonja Happ
2852c4897f user: adapt testing to new password update procedure 2019-10-24 12:26:25 +02:00
Sonja Happ
3fdba37541 user: old password required in request to update user password 2019-10-24 12:23:12 +02:00
Sonja Happ
505358daaa user: fix get user endpoint for non admin users 2019-10-24 11:37:27 +02:00
Sonja Happ
56eabdc194 change active flag in update user to string instead of bool 2019-09-17 17:19:21 +02:00
Sonja Happ
14972262c0 add "Active" bool property to user model, required modifications in user and scenario packages 2019-09-17 17:00:07 +02:00
Sonja Happ
ebf390e9cc update version of swag tool, use swag again in CI, works on #22 2019-09-16 09:17:31 +02:00
Sonja Happ
b570956baf improve user package
- testing more error return codes
- remove some errors from code
- remove unnecessary code
- require a username of at least 3 letters/digits
2019-09-12 10:18:42 +02:00
Sonja Happ
ed1d7677f2 add testing of authentication endpoint, revise authentication endpoint 2019-09-11 17:09:36 +02:00
Sonja Happ
387c922059 Revision of (file) testing
- create a guest user and modify function that adds users to the DB for testing
- improve code coverage of file endpoint tests and remove some obsolete code from file package
- add more error info if role validation fails in all endpoints
- change response of GET files to only return the file data and nothing else
- fix some bugs in file endpoints that became visible by the tests
2019-09-11 12:30:01 +02:00
Sonja Happ
f3a7ed0e61 **Major revision of repository structure**
- rename common package to database
- move all code not related to database to new helper package
- add more test in database package to improve code coverage
- add a new (own) package for AMQP client
2019-09-10 16:28:57 +02:00
Sonja Happ
2ffda7cad8 - revise naming of some common functions
- improve returning of error codes by using common functions
- use a separate file for authentication endpoint to improve clarity of code
2019-09-09 15:30:17 +02:00
Sonja Happ
7b8fc67512 fix some bugs with userID caused by code restructuring in prev commits 2019-09-09 12:42:27 +02:00
Sonja Happ
ac9e564bc8 - deleting old obsolete test functions
- move all data and functions solely used for testing to the file test_utilities
- get rid of utilities file
2019-09-09 12:11:55 +02:00
Sonja Happ
16b3499126 get rid of Request struct as is caused more trouble than good 2019-09-05 09:11:56 +02:00
Sonja Happ
46e84fc758 return the gorm error in case user was not found 2019-09-04 16:18:36 +02:00
Sonja Happ
0d389e9cd5 start each user test function with an empty DB containing only the admin user 2019-09-04 09:05:19 +02:00
Sonja Happ
6221f7d851 user testing: fix responses of successful queries 2019-09-03 16:59:30 +02:00
Sonja Happ
bddbfc028d fix swaggo documentation of user endpoints 2019-09-03 12:03:47 +02:00
smavros
5ac7b5b348 Adds test for user's not allowed actions 2019-08-30 18:19:10 +02:00
smavros
67e4043071 Extends test for GET /users auth as role=User 2019-08-30 15:59:59 +02:00
smavros
f4a15e914e Merge branch 'master' into test-user-endpoints 2019-08-30 15:47:54 +02:00
smavros
68feed0dac Small improvements in user endpoints 2019-08-25 21:52:36 +02:00
smavros
9e01b54307 Improves TestAddUser by testing also GET method 2019-08-25 21:24:55 +02:00
smavros
6959e65bce Adds test for deleting user 2019-08-25 21:03:49 +02:00
smavros
2c087e80e7 Adds test for invalid user update 2019-08-25 20:55:44 +02:00
smavros
4d79f06aba Renaming - Uses only one modRequest variable in user test 2019-08-25 20:02:35 +02:00
smavros
d6cc9ed224 Fixes bug in modify non-Admin user fields 2019-08-25 19:59:47 +02:00