Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/client/metabase-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export class MetabaseClient {
timeout: 30000, // 30 second timeout to prevent hanging requests
});

if (config.proxyAuthorization) {
this.logInfo("Using Proxy-Authorization header for proxy authentication.");
this.axiosInstance.defaults.headers.common["Proxy-Authorization"] = config.proxyAuthorization;
}

if (config.apiKey) {
this.logInfo("Using Metabase API Key for authentication.");
this.axiosInstance.defaults.headers.common["X-API-Key"] = config.apiKey;
Expand Down
1 change: 1 addition & 0 deletions src/types/metabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface MetabaseConfig {
username?: string;
password?: string;
apiKey?: string;
proxyAuthorization?: string;
}

export interface Dashboard {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function loadConfig(): MetabaseConfig {
const username = process.env.METABASE_USERNAME;
const password = process.env.METABASE_PASSWORD;
const apiKey = process.env.METABASE_API_KEY;
const proxyAuthorization = process.env.METABASE_PROXY_AUTHORIZATION;

if (!url) {
throw new Error("METABASE_URL environment variable is required");
Expand All @@ -28,6 +29,7 @@ export function loadConfig(): MetabaseConfig {
username,
password,
apiKey,
proxyAuthorization,
};
}

Expand Down