lab7: app security, Argon2id, mTLS, OpenBao client, least-privilege worker

This commit is contained in:
2026-11-26 16:47:23 +03:00
parent 3418252554
commit cda6e27fb8
58 changed files with 6031 additions and 639 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
import { Injectable, Logger } from '@nestjs/common';
import { Inject, Injectable, Logger, Optional } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import type { AppConfig } from '../config/app-config.schema.js';
import { MetricsService } from '../metrics/metrics.service.js';
@@ -44,7 +44,7 @@ export class FaultInjector {
constructor(
config: ConfigService<AppConfig>,
private readonly redis: RedisClient,
@Optional() @Inject(RedisClient) private readonly redis: RedisClient | undefined,
private readonly metrics: MetricsService,
) {
this.enabled = config.getOrThrow('FAULT_INJECTION_ENABLED') === 1;
@@ -55,7 +55,7 @@ export class FaultInjector {
target?: FaultTarget,
signal?: AbortSignal,
): Promise<void> {
if (!this.enabled) return;
if (!this.enabled || !this.redis) return;
const keys = target
? [
`fault:${name}:${target.attachmentId}:${target.pipelineVersion}`,