UNPKG

@agent-base/secret-client

Version:
19 lines 1.54 kB
import { UserType, UtilityProvider, UtilitySecretType } from '@agent-base/types'; /** * Generates a standardized Google Secret Manager (GSM) compatible secret ID. * Format varies based on presence of webhookSubscribedEvent: * If webhookSubscribedEvent is present: <userType>_<userId>_<utilityProvider>_<webhookSubscribedEvent>_<secretType> * If webhookSubscribedEvent is absent: <userType>_<userId>_<utilityProvider>_<secretType> * All parts are converted to lowercase and sanitized. * * @param userType The type of user (e.g., UserType.Client, UserType.Platform). Must not be empty. * @param userId The unique ID of the user. Must be a non-empty string. * @param organizationId The unique ID of the organization. Must be a non-empty string. * @param utilityProvider The primary context for the secret (e.g., a UtilityProvider string/enum). Must be non-empty. * @param secretType The specific name or type of the secret (e.g., UtilitySecretType string/enum). Must be non-empty. * @param webhookSubscribedEvent Optional specific identifier or sub-context (e.g., tool ID, webhook event). If provided, must be a non-empty string. * @returns A sanitized, GSM-compatible secret ID string, truncated to 255 characters. * @throws Error if mandatory parameters are invalid. */ export declare const generateSecretManagerId: (userType: UserType, userId: string, organizationId: string, utilityProvider: UtilityProvider, secretType: UtilitySecretType, webhookSubscribedEvent?: string) => string; //# sourceMappingURL=utils.d.ts.map