Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@frontegg/e10s-client
Advanced tools
To install the package using npm, run the following
$ npm install @frontegg/e10s-client
Since the Entitlements Client is interacting with the Entitlements Agent, it is required to setup and run the agent.
Look for instructions here https://github.com/frontegg/entitlements-agent
import { EntitlementsClientFactory, RequestContextType } from '@frontegg/e10s-client';
const e10sClient = EntitlementsClientFactory.create({
pdpHost: 'localhost:8181' // Entitlements Agent Host
});
Subject context describes the user which performs the action, these can be taken from Frontegg JWT if authenticating with Frontegg
const subjectContext: SubjectContext = {
tenantId: 'my-tenant-id',
userId: 'my-user-id', // Optional
permissions: ['read', 'write'], // Optional
attributes: { 'my-custom-attribute': 'some-value' } // Optional
};
The Entitlements client allows you to query for a feature, permission or a route entitlement, each requires different context information.
const e10sResult = await e10sClient.isEntitledTo(
subjectContext,
{
type: RequestContextType.Feature,
featureKey: 'my-cool-feature'
}
);
if (!e10sResult.result) {
console.log(`User is not entitled to "my-cool-feature" feature, reason: ${e10sResult.justification}`);
}
const e10sResult = await e10sClient.isEntitledTo(
subjectContext,
{
type: RequestContextType.Permission,
permissionKey: 'read'
}
);
if (!e10sResult.result) {
console.log(`User is not entitled to "read" permission, reason: ${e10sResult.justification}`);
}
const e10sResult = await e10sClient.isEntitledTo(
subjectContext,
{
type: RequestContextType.Route,
method: "GET",
path: "/users"
}
);
if (!e10sResult.result) {
console.log(`User is not entitled to "GET /users" route, reason: ${e10sResult.justification}`);
}
List of possible justifications
Justification | Meaning |
---|---|
MISSING_FEATURE | User is missing the feature |
MISSING_PERMISSION | User is missing the permission |
PLAN_EXPIRED | User has a plan that covers the feature, but the plan is expired |
MISSING_ROUTE | Requested route is not configured |
ROUTE_DENIED | Requested route is configured to be blocked |
In case monitoring mode is enabled, the result object will always return as the following:
{
"result": true,
"monitoring": true
}
The real result, well be logged.
FAQs
Unknown package
We found that @frontegg/e10s-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.