jfrog / jfrog/workers-sample

Cannot import https package to use cert for external endpoint.

Open
#29 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
17
Forks
16
Avg merge
3d 3h
Merged PRs (30d)
3

Description

Jfrog worker's PlatformContext interface provide an AxiosInstance to user to communicate with external web resources. The cert of the external web can be passed through httpsAgent in axios request config

import https from 'https';
const agent = new https.Agent({ cert: "..." });
response = await context.clients.axios.get("https://external-website", { httpsAgent: agent });

The problem is jfrog worker code does not allow import statement, only JavaScript natives are allowed.
However the https library is not javascript native.
I've also tried "fetch" and "XMLHttpRequest", but none of them is defined.
How to send request to external endpoint with cert in jfrog worker?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the worker runtime's import restrictions and the PlatformContext Axios client documentation, including the axios request config reference linked in the issue. Done means identifying and documenting or enabling a supported way to make an external request with a client certificate.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.