
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.
access-policy
Advanced tools
{
"statements": [ //Array
{
"effect": "deny", // String
"action": "*", // String or Array
"resource": [ // String or Array
"/user/${user.id}/*"
],
"condition": { // Object
"equals": { // Object
"key": "value"
}
},
"restiction": {
"equals": { // Object
"key": "value"
}
}
}
]
}
deny
.GET
, POST
, PUT
, DELETE
)Encoding a statement happens at run time (if the provided statement hasn't already been encoded) and evaluated against data provided.
When encoding a policy variables are provided via template literal style strings.
{
"key": "${value}"
}
The following object is what the parser expects to recieve.
{
Action: 'GET',
Resource: 'user/12345',
property: 'value',
property2: {
key: 'value',
key2: 'value'
}
}
The following properties are required for validation:
GET
, POST
, PUT
, DELETE
)pathname
of the requesting URLBeyond the required properties you can inlude arbitrary properties that can be nested and accessed during encoding.
// Template
{
"statements": [
{
"effect": "deny",
"action": "*",
"resource": [
"/user/${user.id}/*"
],
"restiction": {
"equals": {
"account_id": "${accountId}"
}
}
}
]
}
// Data
{
Action: "GET",
Resource: "/user/1234",
accountId: "5678"
}
FAQs
Encodes and decodes policy JSON files for use with web applications.
We found that access-policy 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.
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.