diff --git a/src/api/backend/api/default.service.ts b/src/api/backend/api/default.service.ts index e420442..246f9fd 100644 --- a/src/api/backend/api/default.service.ts +++ b/src/api/backend/api/default.service.ts @@ -4840,6 +4840,14 @@ export class DefaultService { headers = headers.set('year', String(year)); } + // authentication (ksi) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/json' @@ -4881,6 +4889,14 @@ export class DefaultService { let headers = this.defaultHeaders; + // authentication (ksi) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/json' diff --git a/src/api/edulint.yaml b/src/api/edulint.yaml index 2816a52..6517b93 100644 --- a/src/api/edulint.yaml +++ b/src/api/edulint.yaml @@ -45,14 +45,14 @@ paths: summary: List of currently supported Edulint versions. responses: "200": - description: The versions are sorted -- the newest version is listed first. + description: Different EduLint versions are currently not supported. Endpoint returns only "latest". content: application/json: schema: type: array items: type: string - example: ["2.10.2", "2.9.2"] + example: ["latest"] /api/code: post: @@ -128,7 +128,7 @@ paths: parameters: - name: version in: path - description: The version of EduLint to use. You can use either a specific version (e.g. 2.0.0) or "latest". + description: The version of EduLint to use. Currently, you can only use "latest". required: true schema: type: string @@ -171,7 +171,7 @@ paths: parameters: - name: version in: path - description: The version of EduLint to use. You can use either a specific version (e.g. 2.0.0) or "latest". + description: The version of EduLint to use. Currently, you can only use "latest". required: true schema: type: string diff --git a/src/api/edulint/api/aPI.service.ts b/src/api/edulint/api/aPI.service.ts index c0a4fa0..4703982 100644 --- a/src/api/edulint/api/aPI.service.ts +++ b/src/api/edulint/api/aPI.service.ts @@ -64,7 +64,7 @@ export class APIService { /** * Analyzes the code with the given hash with the given version of EduLint * - * @param version The version of EduLint to use. You can use either a specific version (e.g. 2.0.0) or \"latest\". + * @param version The version of EduLint to use. Currently, you can only use \"latest\". * @param hash the hash of the code to analyze * @param config extra configuration to use (equivalent to command line configuration described in [EduLint's documentation](https://edulint.rtfd.io#configuration)). * @param use_cached_result enables/disables using cached linting results @@ -212,7 +212,7 @@ export class APIService { * Uploads some code and returns its analysis * This endpoint combines the /code and /api/{version}/analyze/{hash} endpoints. * @param body the code to upload and analyze - * @param version The version of EduLint to use. You can use either a specific version (e.g. 2.0.0) or \"latest\". + * @param version The version of EduLint to use. Currently, you can only use \"latest\". * @param config extra configuration to use (equivalent to command line configuration described in [EduLint's documentation](https://edulint.rtfd.io#configuration)). * @param use_cached_result enables/disables using cached linting results * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. diff --git a/src/app/services/tasks/tasks.service.ts b/src/app/services/tasks/tasks.service.ts index 7d47f7f..76e35ec 100644 --- a/src/app/services/tasks/tasks.service.ts +++ b/src/app/services/tasks/tasks.service.ts @@ -51,7 +51,10 @@ export class TasksService { shareReplay(1) ); - this.waves$ = year.selected$.pipe( + this.waves$ = merge( + backend.user$.pipe(map(() => this.year.selected)), + year.selected$ + ).pipe( mergeMap((year) => this.backend.http.wavesGetAll(year?.id)), map((response) => { const {waves} = response;