
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@asymmetrik/sof-scope-checker
Advanced tools
SOF-Scope-Checker
Utility for validating patient and user level scopes for the SMART on FHIR specification.
yarn add @asymmetrik/sof-scope-checker
const scopeChecker = require('@asymmetrik/sof-scope-checker');
let hasValidScopes = (name, action) => {
return function (req, res, next) {
let scopes = parseScopes(req && req.user);
let { error, success } = scopeChecker(name, action, scopes);
// Log the error, wrap in operation outcome or GraphQL specific error
// You can check the type of the error as well since we use custom errors
if (error) {
next(error);
} else {
next();
}
}
};
app.get(
'/Patient',
hasValidScopes('Patient', 'read'),
patientController
)
See sof-scope-checker tests for more usage examples.
NOTE: The error returned is an extension of the native JS error. It adds a type property to the error which can have a value of 'internal' representing a misconfiguration, or 'forbidden' representing a case where the scopes are not sufficient.
@asymmetrik/sof-scope-checker
exports a single function which takes three arguments.
name
Name of the resource or patient.
Type: String
Required: true
action
The action the user wants to take. Can be read
, write
, or *
.
Type: String
Required: true
scopes
The scopes available to the user.
Type: Array<String>
Required: true
FAQs
Smart on FHIR scope checker
The npm package @asymmetrik/sof-scope-checker receives a total of 1,205 weekly downloads. As such, @asymmetrik/sof-scope-checker popularity was classified as popular.
We found that @asymmetrik/sof-scope-checker demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.