Skip to content

Cannot import https package to use cert for external endpoint. #29

@zheng-gao

Description

@zheng-gao

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions