lab7: app security, Argon2id, mTLS, OpenBao client, least-privilege worker
This commit is contained in:
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user