Skip to main content
Glama

Bruno API MCP Server

by djkz
basic.ts1.21 kB
import { AuthHandler, AuthResult, BasicAuthConfig, EnvVariableProvider, } from "../types.js"; import debug from "debug"; const log = debug("bruno:auth:basic"); /** * Handler for Basic authentication */ export class BasicAuthHandler implements AuthHandler { private config: BasicAuthConfig; constructor(config: BasicAuthConfig) { this.config = config; } /** * Apply Basic authentication to request * @param envProvider Environment variable provider * @returns Authentication result with Authorization header */ applyAuth(envProvider: EnvVariableProvider): AuthResult { const result: AuthResult = { headers: {}, }; // Process username and password with environment variables const username = envProvider.processTemplateVariables(this.config.username); const password = envProvider.processTemplateVariables( this.config.password || "" ); log("Applying Basic auth"); // Create base64 encoded credentials const encoded = Buffer.from(`${username}:${password}`).toString("base64"); result.headers!["Authorization"] = `Basic ${encoded}`; log("Added Basic auth to Authorization header"); return result; } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/djkz/bruno-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server