Commit graph

181 commits

Author SHA1 Message Date
Sonja Happ
0d51f00a22 Merge branch 'authentication'
# Conflicts:
#	routes/user/userMethods.go
2019-06-03 13:20:09 +02:00
smavros
60d2ee94a2 Improves JWT claims:
- Turns custom claim's userID type from string to uint
    - Improves userToContext() function for saving the id and role of
    the authenticated user to the context
    - Improves Authentication() middleware function
2019-06-02 22:51:13 +02:00
smavros
cded4d672c Simplifies authentication middleware 2019-06-02 19:47:41 +02:00
smavros
f805bf1b33 Handles bindJSON error in addUser endpoint 2019-05-30 13:07:25 +02:00
smavros
c1fcf7e0c0 Improves authenticate endpoint:
- Deals with JSON bind error properly. Returs http code 422 and
    error message
    - Renames the handler function from authenticationEp to authenticate
2019-05-30 13:04:50 +02:00
smavros
73691f9595 Implements DELETE /user/{UserID} endpoint 2019-05-29 23:43:37 +02:00
Sonja Happ
f197a1b823 implementations in simulation endpoints, WIP 2019-05-29 09:43:21 +02:00
Sonja Happ
786e36398b implement model-specific methods instead of queries (WIP) 2019-05-28 16:41:30 +02:00
Sonja Happ
4d9af7b0d3 test 2019-05-28 10:41:59 +02:00
Sonja Happ
f6ea39af12 Merge branch 'master' into authentication
# Conflicts:
#	go.mod
#	go.sum
#	routes/user/userEndpoints.go
#	routes/user/userSerializer.go
#	start.go
2019-05-28 10:40:53 +02:00
Sonja Happ
34eebbab88 Shorten API URLs, add more documentation for swaggo 2019-05-27 14:43:12 +02:00
smavros
2eb37938cb Removes original request from /authenticate response 2019-05-27 09:38:13 +02:00
smavros
5f13c1b04d In case of unauthorized user returns JSON response 2019-05-26 19:06:28 +02:00
smavros
8994b9e7a0 Replaces findUserByUsername with User.byUsername() 2019-05-26 19:05:09 +02:00
smavros
150bd76dda Implements userReadEp() for GET /users/:UserID
- Modifies UserSerializer.Response() by adding an argument for
    including or not the model's associations in the respone. If not
    the associations fields are present but their values are null
    - Adds User.byID() method for finding user by the ID which is
    fetched by the resource path of the endpoint
2019-05-26 18:19:05 +02:00
smavros
a6429c53f1 Removes GET /users/me endpoint and handler func 2019-05-26 15:04:16 +02:00
smavros
a20ff0fce6 Adds generation of JWT for authentication 2019-05-26 15:02:15 +02:00
Sonja Happ
e7790f82a4 deterministic order of elements based on ID if multiple elements are extracted from DB 2019-05-24 16:31:28 +02:00
Sonja Happ
144c97ce49 Refactoring code base to new structure, removing circular dependencies, creating response types 2019-05-23 16:50:05 +02:00
smavros
0a559b6c52 Turns user methods to unexported 2019-05-22 15:40:12 +02:00
smavros
8041ab2bc4 Implements user registration endpoint 2019-05-22 15:33:34 +02:00
smavros
6289b859bd Implements user.SetPassword() method 2019-05-22 11:20:29 +02:00
Sonja Happ
5409c61939 Major changes:
- continue revision of folder structure
- work on model endpoints
- add skeletons for clone endpoints
2019-05-21 14:37:45 +02:00
Sonja Happ
44e15773fd Major changes:
- revise data model to new version (without project)
- adapt database test to new data model
- use separate folder for all endpoint defs and functions to avoid circular deps
- add all API endpoints and skeletons for their implementation
2019-05-21 12:49:39 +02:00
smavros
528c391a9f Adds implementation of user.validatePassword():
- Uses bcrypt package for hashing the password
    - Adds password hashing in common.DummyPopulateDB() for testing
2019-05-20 14:03:54 +02:00
smavros
8216767722 Changes in the user package:
- Moves `POST /users` to the users endpoint group where
    authentication is required
    - Renames userLogin to loginRequest
    - Adds userMethods.go source file to the package user
    - Adds type User in the user package which just wrapps the type
    common.User so methods can be added to the type
    - Adds prototypes of methods for setting/validating password and
    updating type User's data
2019-05-20 12:04:37 +02:00
smavros
ab0d8dea8b Work in progress: /authenticate endpoint handler 2019-05-18 18:54:58 +02:00
smavros
a7f15e79fe First try for Authentication middleware 2019-05-16 15:39:48 +02:00
Sonja Happ
2e7475a26b - add first draft of code for other routes (not complete!)
- some new endpoints
- some new DB queries
- some new serializers
2019-05-09 17:02:24 +02:00
Sonja Happ
eea765f707 add skeletons for file endpoints 2019-05-09 12:33:47 +02:00
Sonja Happ
83e8563526 use new folder structure for implementation of routes 2019-05-09 11:50:18 +02:00