![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@locker/instrumentation
Advanced tools
The instrumentation package provides utility functions, also known as beacons, to facilitate instrumenting Locker vNext code without having to bind the entire codebase to an external interface.
There are 3 beacons provided, 1 for instrumenting errors, 1 for generic logging and 1 for metrics (activity).
import { LockerInstrumentation } from '@locker/instrumentation';
const { activityBeacon, errorBeacon, logBeacon } = new LockerInstrumentation();
The beacons can now be used to instrument code in Locker.
Due to possible restrictions on the instrumentation service, the high volume of method calls and privacy considerations in sandboxed code, Locker cannot instrument serialized method parameters or method return values. As a consequence, the beacons will invoke the instrumentation client using specific information.
const { activityBeacon } = new LockerInstrumentation(myService);
// instrumented activity is started for current sandboxKey
const myActivity = activityBeacon(sandboxKey, 'fooActivity');
myActivity.start();
// or use chaining
// const myActivity = activityBeacon(sandboxKey, 'fooActivity').start();
foo();
// we stop the activity after last instrumeted call
myActivity.stop();
const { logBeacon } = new LockerInstrumentation(myService);
const foo: Array = bar();
logBeacon(sandboxKey, `bar method returned ${foo.length} results.`);
const { errorBeacon } = new LockerInstrumentation(myService);
try {
foo();
} catch (e) {
errorBeacon(sandboxKey, e);
throw e;
}
To plug in an external service in Locker vNext the following steps are required:
class MyInstrumentation extends LockerInstrumentation {
activityBeacon(sandboxKey, nameOrDescription) {
return new Activity(sandboxKey, nameOrDescription, startCallback, stopCallback);
}
errorBeacon(sandboxKey, e) {
errorCallback(sandboxKey, e.message, e.type, e.stack);
}
logBeacon(sandboxKey, message) {
logCallback(sandboxKey, message);
}
}
evaluateInSandbox
or evaluateInCoreSandbox
and provide MyInstrumentation
as an argumentconst instrumentation = new MyInstrumentation();
evaluateInSandbox(key, code, null, null, instrumentation);
FAQs
Lightning Web Security instrumentation utilities
The npm package @locker/instrumentation receives a total of 305 weekly downloads. As such, @locker/instrumentation popularity was classified as not popular.
We found that @locker/instrumentation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.