Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

635 B
Raw Blame
/*
 * Copyright Daytona Platforms Inc.
 * SPDX-License-Identifier: AGPL-3.0
 */

import { Injectable, ExecutionContext, Logger, CanActivate } from '@nestjs/common'
import { getAuthContext } from './get-auth-context'
import { isOtelCollectorContext } from '../common/interfaces/otel-collector-context.interface'

@Injectable()
export class OtelCollectorGuard implements CanActivate {
  protected readonly logger = new Logger(OtelCollectorGuard.name)

  async canActivate(context: ExecutionContext): Promise<boolean> {
    // Throws if not otel collector context
    getAuthContext(context, isOtelCollectorContext)
    return true
  }
}