MCPcopy Create free account
hub / github.com/massCodeIO/massCode / interpolateAuth

Function interpolateAuth

src/renderer/components/http/requestPreview.ts:172–191  ·  view source on GitHub ↗
(
  auth: HttpAuth,
  variables: Record<string, string>,
)

Source from the content-addressed store, hash-verified

170}
171
172function interpolateAuth(
173 auth: HttpAuth,
174 variables: Record<string, string>,
175): HttpAuth {
176 return {
177 type: auth.type,
178 token:
179 auth.token !== undefined
180 ? interpolateHttpVariables(auth.token, variables)
181 : auth.token,
182 username:
183 auth.username !== undefined
184 ? interpolateHttpVariables(auth.username, variables)
185 : auth.username,
186 password:
187 auth.password !== undefined
188 ? interpolateHttpVariables(auth.password, variables)
189 : auth.password,
190 }
191}
192
193function interpolateDraft(
194 draft: HttpRequestDraft,

Callers 1

interpolateDraftFunction · 0.70

Calls 1

interpolateHttpVariablesFunction · 0.90

Tested by

no test coverage detected