mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 23:24:46 -04:00
auth: adds token-auth to public api
adds auth service adds auth module adds token-auth strategy adds token-auth to all public api calls Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
4784a1aea2
commit
2ab950c5c3
11 changed files with 174 additions and 18 deletions
|
@ -4,18 +4,21 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
import { MonitoringService } from '../../../monitoring/monitoring.service';
|
||||
import { TokenAuthGuard } from '../../../auth/token-auth.guard';
|
||||
|
||||
@Controller('monitoring')
|
||||
export class MonitoringController {
|
||||
constructor(private monitoringService: MonitoringService) {}
|
||||
|
||||
@UseGuards(TokenAuthGuard)
|
||||
@Get()
|
||||
getStatus() {
|
||||
return this.monitoringService.getServerStatus();
|
||||
}
|
||||
|
||||
@UseGuards(TokenAuthGuard)
|
||||
@Get('prometheus')
|
||||
getPrometheusStatus() {
|
||||
return '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue