Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
resource-action-api
Advanced tools
Requests to `/resources` must have a body that has the following format:
POST
/resources
Requests to /resources
must have a body that has the following format:
{
[actionKey]: {
[resourceKey]: <params|[params]>,
...
},
...
}
actionKey
:
get
- request data for resource(s)create
- create resource(s)update
- update resource(s)destroy
- delete resource(s)resourceKey
:
resourceKey
s, such as products
and projects
.resourceKey
s can be:
product
, in which case it is considered a one
request (which has one corresponding result)resourceKey
will be an object - params
resourceKey
will be an array of params
objects - [params, ...]
param | behavior | value format | works with |
---|---|---|---|
where | WHERE field = value AND ... | {<field>:<value>} | get , update , destroy |
props | SET field = value | {<field>:<value>} | create , update |
fields | SELECT field, ... | [<field>] | get |
order | ORDER BY field, ... | `[<field | {field, direction}>]` |
include | include related resource s | {<resourceKey>: <params>> | get |
limit | LIMIT X | int | get |
page | LIMIT X, Y | {count: int, number: int} | get |
where
default behavior: AND
- {where: {id: 1, type: 2}}
-> WHERE id = 1 AND type = 2
to achieve more complex where statements, the following syntax may be used (TODO):
{where: ['and', ['or', {productId: 1, materialId: 2}], {type: 'image'}]}
Responses come back in a format that corresponds to the request:
{success: true, data: {
[actionKey]: {
[singular resourceKey]: {props: {}}
[plural resourceKey]: [{props: {}}]
}
}}
resource
:
{props: {}}
get
, and create
respond with resources, so data.resources
will never have the keys update
or destroy
var request = {
get: {
project: {where: {id: 1}},
products: {where: {categoryId: 1}, order: ['rank'], fields: ['id', 'title']},
},
update: {
project: {where: {id: 1}, props: {title: 'p1'}},
projects: {where: {zip: 10000}, props: {title: 'p2'}},
elevations: [{where: {id: 1}, props: {title: 'p3'}}, {where: {id: 2}, props: {title: 'p4'}}]
},
create: {
product: {where: {zip: 10000}, props: {title: 'p1'}},
projects: [{props: {title: 'p1'}}, {props: {title: 'p2'}}]
},
destroy: {
product: {where: {id: 1}},
projects: {where: {zip: 10000}}
}
};
var response = {
resources: {
get: {
project: {},
products: [{}, ...],
},
update: {
project: {},
projects: [{}, ...],
elevations: [{}, ...]
},
create: {
product: {},
projects: [{}, ...]
},
destroy: {
product: {},
projects: [{}, ...]
}
}
}
FAQs
Requests to `/resources` must have a body that has the following format:
The npm package resource-action-api receives a total of 64 weekly downloads. As such, resource-action-api popularity was classified as not popular.
We found that resource-action-api 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.