Member Junction
    Preparing search index...

    Function CheckAPIKeyScopeAndLog

    • Check if an API key has the required scope and log usage.

      Same as CheckAPIKeyScope but also logs the authorization attempt. Use this for operations where you want detailed audit trails.

      Parameters

      • apiKeyId: string

        The API key ID from context.userPayload.apiKeyId

      • scopePath: string

        The scope path required

      • contextUser: UserInfo

        The authenticated user

      • usageDetails: {
            endpoint: string;
            ipAddress?: string;
            method: string;
            operationName?: string;
            responseTimeMs?: number;
            statusCode?: number;
            userAgent?: string;
        }

        Details about the request for logging

      • options: ScopeAuthOptions = {}

        Additional options for scope checking

      Returns Promise<ScopeAuthResult & { LogId?: string }>

      ScopeAuthResult with authorization details and optional log ID