
Research
Malicious Go “crypto” Module Steals Passwords and Deploys Rekoobe Backdoor
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.
api-base-url-resolver
Advanced tools
Infers a url based on a current url, for instance, allows a front end to resolve a back-end api base url depending on it's running environment. Its very useful when running a lot of environment stages and the front-end must match the back-end environment
Infers a url based on a current url, for instance, allows a front end to resolve a back-end api base url depending on it's running environment.
Its very useful when running a lot of environment stages and the front-end must match the back-end environment
To install this package use npm install api-base-url-resolver
subDomainResolver(origin: string, subDomain: string, options?: Options): string;
origin : current domain, mostly location.hostnamesubDomain : the desired domain, mostly api subdomain is usedoptions :
replace : replaces the sub-domain to the provided oneprotocol : changes the protocolconditions : if there some specific condition to a specific env or url, useful for localhost developments envsenvVar : when provided, it will look for this env var and use it as url. useful for localhost developments envs or specific deploys like canary or betaimport apiBaseUrlResolver from "api-base-url-resolver";
apiBaseUrlResolver("https://domain.com", "api"); // => "https://api.domain.com"
apiBaseUrlResolver("http://domain.com", "api"); // => "http://api.domain.com"
apiBaseUrlResolver("https://env.domain.com", "api"); // => "https://api.env.domain.com"
apiBaseUrlResolver("https://some.other.app.env.domain.com", "api"); // => "https://api.some.other.app.env.domain.com"
apiBaseUrlResolver("http://domain.com", "api", { protocol: "https" }); // => "https://api.domain.com"
apiBaseUrlResolver("https://domain.com", "api", { protocol: "http" }); // => "http://api.domain.com"
apiBaseUrlResolver("https://app.env.domain.com", "api", { replace: true }); // => "https://api.env.domain.com"
apiBaseUrlResolver("https://app.other.env.domain.com", "api", { replace: true }); // => "https://api.other.env.domain.com"
const conditions = {
"localhost:8080": "https://custom.env.custom.com",
"localhost:8081": "http://localhost:8080"
};
subDomainResolver("localhost:8080", "api", { conditions }); // => "https://custom.env.custom.com"
subDomainResolver("localhost:8081", "api", { conditions }); // => "http://localhost:8080"
const envVar = "MAIN_API";
process.env.MAIN_API = "https://env-var-defined-url.com";
subDomainResolver("localhost:8080", "api", { envVar }); // => "https://env-var-defined-url.com"
subDomainResolver("localhost:8081", "api", { envVar }); // => "https://env-var-defined-url.com"
subDomainResolver("https://otherDomain.com", "api", { envVar }); // => "https://env-var-defined-url.com"
FAQs
Infers a url based on a current url, for instance, allows a front end to resolve a back-end api base url depending on it's running environment. Its very useful when running a lot of environment stages and the front-end must match the back-end environment
We found that api-base-url-resolver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.

Security News
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.