MCPcopy Index your code
hub / github.com/simstudioai/sim / buildAuthHeaders

Function buildAuthHeaders

apps/sim/executor/utils/http.ts:5–16  ·  view source on GitHub ↗
(userId?: string)

Source from the content-addressed store, hash-verified

3import { HTTP } from '@/executor/constants'
4
5export async function buildAuthHeaders(userId?: string): Promise<Record<string, string>> {
6 const headers: Record<string, string> = {
7 'Content-Type': HTTP.CONTENT_TYPE.JSON,
8 }
9
10 if (typeof window === 'undefined') {
11 const token = await generateInternalToken(userId)
12 headers.Authorization = `Bearer ${token}`
13 }
14
15 return headers
16}
17
18export function buildAPIUrl(path: string, params?: Record<string, string>): URL {
19 const baseUrl = path.startsWith('/api/') ? getInternalApiBaseUrl() : getBaseUrl()

Callers 10

executeJobInlineFunction · 0.90
executeMethod · 0.90
executeMethod · 0.90
executeLegacyMethod · 0.90
executeV2Method · 0.90
loadChildWorkflowMethod · 0.90
checkChildDeploymentMethod · 0.90
fetchWorkflowMetadataFunction · 0.50

Calls 1

generateInternalTokenFunction · 0.90

Tested by

no test coverage detected