
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@osohq/dev-server
Advanced tools
This package provides convenient access to the Oso Cloud Dev Server via a NodeJS package.
The package contains the following features:
postinstall
script. (See versioning).npx @osohq/dev-server
).This is primarily designed for usage in tests, for example, Jest tests using this might look like:
import { glob } from "glob";
import { Oso } from "oso-cloud";
import {
configureDevServer,
getEphemeralOsoKey,
stopRunningInstance,
} from "@osohq/dev-server";
async function testOso() {
const { url, apiKey } = await getEphemeralOsoKey();
const oso = new Oso(url, apiKey);
}
describe("Oso tests", () => {
beforeAll(async () => {
// load all policy files on starting the server
// these will be copied into each ephmeral test
// instance
const policyFiles = await glob("**/*.polar");
await configureDevServer({ policyFiles });
})
afterEach(async () => {
try {
// clean up any instances if they're still running
await stopRunningInstance();
} catch (e) {
// ignore
}
});
it("can get list results back", async () => {
const oso = await testOso();
const results = await oso.list(
{ type: "User", id: "alice" },
"read",
"Foo"
);
expect(results).toEqual(["123"]);
});
});
Versions of this package have two components:
0.0.1
1.10.6
-- captured as a build version.e.g. version 0.0.1 built to link against 1.10.6 is versioned as 0.0.1+1.10.6
.
If you wish to override the Dev Server build, you can do so by specifying the environment variable
OSO_DEV_SERVER_VERSION
FAQs
Utilities for running the Oso Dev Server from a Node.js application.
We found that @osohq/dev-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.