mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-31 18:39:09 +00:00
FEAT: snowflake sso
This commit is contained in:
@@ -21,9 +21,15 @@ import {
|
||||
AuthVerifyTotpMfaRequest,
|
||||
} from '@dadosfera/protospack-v2/dist/lib/Duc/interfaces/messages';
|
||||
|
||||
import { PERMISSIONS } from 'src/authentication/permissions.enum';
|
||||
import {
|
||||
Authenticated,
|
||||
RequireAllPermissions,
|
||||
} from 'src/authentication/authentication.decorator';
|
||||
import { AuthClientService } from './auth.service';
|
||||
import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
|
||||
import { GrpcToHttpExceptionFilter } from '../../error/grpc-to-http-exception.filter';
|
||||
import { RequestUser, User } from 'src/authentication/user.decorator';
|
||||
|
||||
@ApiTags('Auth')
|
||||
@UseFilters(new GrpcToHttpExceptionFilter())
|
||||
@@ -39,6 +45,15 @@ export class AuthController {
|
||||
this.logger = dadosferaLogger.logger;
|
||||
}
|
||||
|
||||
@Post('/sso/snowflake')
|
||||
@RequireAllPermissions(PERMISSIONS.SNOWFLAKE.permissions.OPEN)
|
||||
@HttpCode(HttpStatus.OK)
|
||||
async snowflakeSignIn(@User() user: RequestUser) {
|
||||
this.logger.info('/auth - snowflakeSignIn');
|
||||
|
||||
return this.authClient.snowflakeSignIn({ userId: user.user_id });
|
||||
}
|
||||
|
||||
@Post('sign-in')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
async signIn(@Body() { username, password, totp }: AuthSignInRequest) {
|
||||
|
||||
Reference in New Issue
Block a user