-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApiEndpoints.java
More file actions
51 lines (44 loc) · 2.21 KB
/
Copy pathApiEndpoints.java
File metadata and controls
51 lines (44 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package nl.medtechchain.controllers;
import java.util.Set;
/**
* A class that contains all supported API endpoints, so that they can be accessed from all places
* (for easy reference and modification).
*/
public class ApiEndpoints {
// Full paths
public static final String LOGIN_API = "/api/users/login";
public static final String REGISTER_API = "/api/users/register";
public static final String GET_RESEARCHERS_API = "/api/users/researchers";
public static final String UPDATE_API = "/api/users/update";
public static final String DELETE_API = "/api/users/delete";
public static final String CHANGE_PASSWORD_API = "/api/users/change_password";
public static final String QUERIES_API = "/api/queries";
public static final String READ_QUERIES_API = "/api/queries/read";
public static final String CONFIGS_INTERFACE_API = "/api/configs/interface";
public static final String CONFIGS_PLATFORM_API = "/api/configs/platform";
public static final String CONFIGS_NETWORK_API = "/api/configs/network";
// Prefixes for paths
public static final String USERS_API_PREFIX = "/api/users";
public static final String QUERIES_API_PREFIX = "/api/queries";
public static final String CONFIGS_API_PREFIX = "/api/configs";
// Actual endpoints (i.e. without the common prefix)
public static final String LOGIN = "/login";
public static final String REGISTER = "/register";
public static final String GET_RESEARCHERS = "/researchers";
public static final String UPDATE = "/update";
public static final String DELETE = "/delete";
public static final String CHANGE_PASSWORD = "/change_password";
public static final String QUERIES = "";
public static final String READ = "/read";
public static final String INTERFACE = "/interface";
public static final String PLATFORM = "/platform";
public static final String NETWORK = "/network";
// Paths that do not require JWT. For parts that are not in this list,
// 401 Unauthorized will be returned if the JWT is missing.
public static Set<String> NO_JWT_PATHS = Set.of(LOGIN_API, CHANGE_PASSWORD_API);
/**
* This class should not be instantiated.
*/
private ApiEndpoints() {
}
}