mirror of
https://github.com/dadosfera/maestro.git
synced 2026-08-31 19:58:21 +00:00
FEAT: add TOTP support for change password and local build support
- Pass TOTP code to DUC for Keycloak users with MFA - Add Dockerfile.local for local protospack builds - Add .dockerignore to exclude node_modules from Docker context 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
b27298501d
commit
8e0182aa50
@@ -0,0 +1,12 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.git
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
.DS_Store
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
coverage
|
||||||
|
.nyc_output
|
||||||
|
*.tgz
|
||||||
|
!protospack.tgz
|
||||||
+12
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM node:20-alpine AS base_image
|
FROM node:22-alpine AS base_image
|
||||||
RUN npm install -g npm@latest
|
RUN npm install -g npm@latest
|
||||||
|
|
||||||
FROM base_image AS build_base
|
FROM base_image AS build_base
|
||||||
@@ -19,10 +19,20 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
|||||||
|
|
||||||
|
|
||||||
# Local build with secrets
|
# Local build with secrets
|
||||||
|
# Check if local protospack tarball exists (for local dev)
|
||||||
FROM build_base AS build
|
FROM build_base AS build
|
||||||
|
COPY protospack*.tgz* ./
|
||||||
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
|
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
|
||||||
aws codeartifact login --tool npm --namespace @dadosfera --repository dadosfera-npm --domain dadosfera --domain-owner 611330257153 --region us-east-1
|
aws codeartifact login --tool npm --namespace @dadosfera --repository dadosfera-npm --domain dadosfera --domain-owner 611330257153 --region us-east-1
|
||||||
RUN npm ci
|
RUN if [ -f "protospack.tgz" ]; then \
|
||||||
|
echo "Installing from local protospack tarball..." && \
|
||||||
|
npm install ./protospack.tgz --save-exact && \
|
||||||
|
npm ci --ignore-scripts && \
|
||||||
|
npm rebuild; \
|
||||||
|
else \
|
||||||
|
echo "Installing from CodeArtifact..." && \
|
||||||
|
npm ci; \
|
||||||
|
fi
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|||||||
@@ -190,13 +190,14 @@ export class AuthController {
|
|||||||
) {
|
) {
|
||||||
this.logger.info('/auth - change-password');
|
this.logger.info('/auth - change-password');
|
||||||
|
|
||||||
const { oldPassword, newPassword } = body;
|
const { oldPassword, newPassword, totpCode } = body;
|
||||||
const { authorization: accessToken } = headers;
|
const { authorization: accessToken } = headers;
|
||||||
|
|
||||||
return this.authClient.changePassword({
|
return this.authClient.changePassword({
|
||||||
accessToken,
|
accessToken,
|
||||||
oldPassword,
|
oldPassword,
|
||||||
newPassword,
|
newPassword,
|
||||||
|
totpCode,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ export class AuthClientService implements OnModuleInit {
|
|||||||
accessToken,
|
accessToken,
|
||||||
oldPassword,
|
oldPassword,
|
||||||
newPassword,
|
newPassword,
|
||||||
|
totpCode,
|
||||||
}: AuthChangePasswordRequest) {
|
}: AuthChangePasswordRequest) {
|
||||||
this.logger.info('ChangePassword');
|
this.logger.info('ChangePassword');
|
||||||
|
|
||||||
@@ -151,6 +152,7 @@ export class AuthClientService implements OnModuleInit {
|
|||||||
accessToken,
|
accessToken,
|
||||||
oldPassword,
|
oldPassword,
|
||||||
newPassword,
|
newPassword,
|
||||||
|
totpCode,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user