Sonja Happ
7a4e801f18
CI: fixes in yaml file
2019-06-06 10:09:49 +02:00
Sonja Happ
ea974ba32b
generate and deploy api docs based on swag tool
2019-06-06 09:57:40 +02:00
Sonja Happ
b6c2d9fc6a
mode testEndpoint and authenticateForTest functions to common package
2019-06-05 16:21:46 +02:00
Sonja Happ
6081fab080
add permission checks to simulation model endpoints
2019-06-05 16:05:27 +02:00
Sonja Happ
759826316d
- implement CheckPermissions method in a more generic way
...
- make this method a middleware function of simulation package
2019-06-05 15:09:36 +02:00
Sonja Happ
4643839141
simulation endpoints: improve error response for access denied case
2019-06-05 14:46:42 +02:00
Sonja Happ
072d948795
- checkPermissions method for simulation endpoints
...
- remove simulationID from simulationmodel and visualization endpoints
2019-06-05 14:34:44 +02:00
Sonja Happ
c6c698c19f
fix a typo in delete method of simulation
2019-06-05 13:21:10 +02:00
Sonja Happ
babe1cb308
refactoring Model to SimulationModel
2019-06-05 13:12:23 +02:00
Sonja Happ
a293b1d954
consider user's role for GET simulaitons endpoint
2019-06-05 11:18:57 +02:00
Sonja Happ
4806583b1f
Merge branch 'authentication'
...
# Conflicts:
# common/models.go
# common/utilities.go
# routes/user/userEndpoints.go
2019-06-05 10:42:49 +02:00
smavros
4cc98867ca
Merge branch 'authentication' of git.rwth-aachen.de:acs/public/villas/villasweb-backend-go into authentication
2019-06-05 10:03:49 +02:00
smavros
1b39f2fd83
Adds global constant strings for Context custom variables
2019-06-05 10:03:12 +02:00
Sonja Happ
c1bd781f37
add comment about using c.GetInt for user_id
2019-06-05 09:58:31 +02:00
Sonja Happ
d3cdf0008b
- rename Modes to Permissions
...
- rename actions.go to roles.go
- put all role related functions in file roles.go
2019-06-05 09:38:17 +02:00
smavros
83444505b0
Implements updateUser() for user endpoint WIP
...
- Improves user.update() method
2019-06-04 21:56:28 +02:00
smavros
e4c8fb9825
Renames IsActionAllowed() to ValidateRole()
2019-06-04 20:33:27 +02:00
smavros
683ea46b15
Adds role validation in other user endpoints
2019-06-04 20:28:15 +02:00
smavros
5d3bb4c632
Improves actions mechanism in common package
...
- Typedefs the name of a model (ModelName) and the CRUD operations
(CRUD).
- Defines constants for models's names and the 4 CRUD operations
- Changes the corresponding functions that need to validate the role
2019-06-04 20:22:09 +02:00
smavros
1a1a3c1876
Adds IsActionAllowed() in common utilities
...
- Is used only in deleteUser handler function for now
2019-06-04 18:03:47 +02:00
Sonja Happ
79faff2758
- extend testing of simulation endpoints
...
- fix some errors in simulation methods and endpoint implementations
2019-06-03 14:31:50 +02:00
Sonja Happ
084d3ec8d8
fix many to many relationship between users and simulations
2019-06-03 14:30:15 +02:00
Sonja Happ
6e84929ef9
fix user ID for db association test
2019-06-03 13:32:53 +02:00
Sonja Happ
fc08075295
- use authentication with User_A for testing of simulations endpoints
...
- use user_id properly in GET simulations endpoint
2019-06-03 13:22:54 +02:00
Sonja Happ
0d51f00a22
Merge branch 'authentication'
...
# Conflicts:
# routes/user/userMethods.go
2019-06-03 13:20:09 +02:00
Sonja Happ
b100d47d68
WIP add authentication to testing
2019-06-03 12:49:57 +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
fc358d06c6
Adds actions.go in package common
...
Creates exported global variable common.Roles that can be used to
validate the permitted operations of a certain role for a certain
model. Need to be filled in properly for every role-model-crud op.
2019-05-31 14:35:33 +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
smavros
8635ceaeb9
Adds User_0 as Admin in dummy database
2019-05-29 23:38:57 +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
97701b6faa
fix simulation endpoint testing
2019-05-28 09:53:10 +02:00
Sonja Happ
0e6ca2d877
make username a query parameter
2019-05-28 09:39:30 +02:00
Sonja Happ
cf1c6e9c18
fix for simulation endpoints regarding adding and deleting user
2019-05-28 09:31:36 +02:00
Sonja Happ
28751c4161
clean up endpoint registration in start and test
2019-05-27 14:55:12 +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
0c4c60c1ce
Add more API doc in code, modify deployment endpoint of auto generated API doc
2019-05-24 17:15: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