Skip to content
Snippets Groups Projects
Commit e27f0a51 authored by michael.minelli's avatar michael.minelli
Browse files

Merge branch 'fix-publish-function-call' into v3.1.3

parents 2eeffdcc 98d84bce
No related branches found
No related tags found
No related merge requests found
Pipeline #27196 failed
openapi: 3.1.0
info:
title: Dojo API
version: 3.1.2
version: 3.1.3
description: |
**Backend API of the Dojo project.**
......
{
"name" : "dojo_backend_api",
"description" : "Backend API of the Dojo project",
"version" : "3.1.2",
"version" : "3.1.3",
"license" : "AGPLv3",
"author" : "Michaël Minelli <dojo@minelli.me>",
"main" : "dist/src/app.js",
......
......@@ -46,11 +46,11 @@ class AssignmentRoutes implements RoutesManager {
};
registerOnBackend(backend: Express) {
backend.get('/assignments/:assignmentNameOrUrl', SecurityMiddleware.check(true), this.getAssignment);
backend.post('/assignments', SecurityMiddleware.check(true, SecurityCheckType.TEACHING_STAFF), ParamsValidatorMiddleware.validate(this.assignmentValidator), this.createAssignment);
backend.get('/assignments/:assignmentNameOrUrl', SecurityMiddleware.check(true), this.getAssignment.bind(this));
backend.post('/assignments', SecurityMiddleware.check(true, SecurityCheckType.TEACHING_STAFF), ParamsValidatorMiddleware.validate(this.assignmentValidator), this.createAssignment.bind(this));
backend.patch('/assignments/:assignmentNameOrUrl/publish', SecurityMiddleware.check(true, SecurityCheckType.ASSIGNMENT_STAFF), this.publishAssignment);
backend.patch('/assignments/:assignmentNameOrUrl/unpublish', SecurityMiddleware.check(true, SecurityCheckType.ASSIGNMENT_STAFF), this.unpublishAssignment);
backend.patch('/assignments/:assignmentNameOrUrl/publish', SecurityMiddleware.check(true, SecurityCheckType.ASSIGNMENT_STAFF), this.publishAssignment.bind(this));
backend.patch('/assignments/:assignmentNameOrUrl/unpublish', SecurityMiddleware.check(true, SecurityCheckType.ASSIGNMENT_STAFF), this.unpublishAssignment.bind(this));
}
// Get an assignment by its name or gitlab url
......
......@@ -6,8 +6,8 @@ import RoutesManager from '../express/RoutesManager';
class BaseRoutes implements RoutesManager {
registerOnBackend(backend: Express) {
backend.get('/', this.homepage);
backend.get('/health_check', this.healthCheck);
backend.get('/', this.homepage.bind(this));
backend.get('/health_check', this.healthCheck.bind(this));
}
private async homepage(req: express.Request, res: express.Response) {
......
......@@ -8,7 +8,7 @@ import GitlabManager from '../managers/GitlabManager';
class GitlabRoutes implements RoutesManager {
registerOnBackend(backend: Express) {
backend.get('/gitlab/project/:gitlabProjectIdOrNamespace/checkTemplateAccess', SecurityMiddleware.check(true, SecurityCheckType.TEACHING_STAFF), this.checkTemplateAccess);
backend.get('/gitlab/project/:gitlabProjectIdOrNamespace/checkTemplateAccess', SecurityMiddleware.check(true, SecurityCheckType.TEACHING_STAFF), this.checkTemplateAccess.bind(this));
}
private async checkTemplateAccess(req: express.Request, res: express.Response) {
......
......@@ -32,9 +32,9 @@ class SessionRoutes implements RoutesManager {
};
registerOnBackend(backend: Express) {
backend.post('/login', ParamsValidatorMiddleware.validate(this.loginValidator), this.login);
backend.post('/refresh_tokens', ParamsValidatorMiddleware.validate(this.refreshTokensValidator), this.refreshTokens);
backend.get('/test_session', SecurityMiddleware.check(true), this.testSession);
backend.post('/login', ParamsValidatorMiddleware.validate(this.loginValidator), this.login.bind(this));
backend.post('/refresh_tokens', ParamsValidatorMiddleware.validate(this.refreshTokensValidator), this.refreshTokens.bind(this));
backend.get('/test_session', SecurityMiddleware.check(true), this.testSession.bind(this));
}
private async login(req: express.Request, res: express.Response) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment