import { SetMetadata } from '@nestjs/common';
import { ApiKeyScope } from '../principal';

export const SCOPES_KEY = 'api_key_scopes';

// Requires API-key principals to hold ALL listed scopes. JWT users are unaffected
// (their access is governed by org role instead).
export const RequireScopes = (...scopes: ApiKeyScope[]) => SetMetadata(SCOPES_KEY, scopes);
