function getAuthHeaders()

in packages/graph-explorer/src/connector/fetchDatabaseRequest.ts [59:77]


function getAuthHeaders(
  connection: ConnectionConfig | undefined,
  featureFlags: FeatureFlags,
  typeHeaders: HeadersInit | undefined
) {
  const headers: HeadersInit = {};
  if (connection?.proxyConnection) {
    headers["graph-db-connection-url"] = connection.graphDbUrl || "";
    headers["db-query-logging-enabled"] = String(
      featureFlags.allowLoggingDbQuery
    );
  }
  if (connection?.awsAuthEnabled) {
    headers["aws-neptune-region"] = connection.awsRegion || "";
    headers["service-type"] = connection.serviceType || DEFAULT_SERVICE_TYPE;
  }

  return { ...headers, ...typeHeaders };
}