Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@janeirodigital/interop-authorization-agent
Advanced tools
Top level module for authorization agents confirming to Solid Application Interoperability specification
Specifications this library implements are still a work in progress. While we track changes to the public API of this library with semver, the underlying data will be slightly changing for the rest of 2021. We are commited to keep this implementation up to date. If you plan to use your application in production please ask the specification editors on the public chatroom about the stability of the data model.
An open-source implementation of a full service using this library is also available: sai-impl-service (under active development)
Authorization Agent class provides a static build
method to create instances.
It expects:
webId
- WebID of the user which this instance will be an authorization agent of.agentId
- Unique IRI denoting this instance. The user will add it to their WebID
and it will be used
as client_id
in Solid-OIDCfetch
- an authenticated fetch, for example solid-client-authn-noderandomUUID()
- random UUID generator conforming to the specificationimport { randomUUID } from 'crypto';
import { getSessionFromStorage, Session } from '@inrupt/solid-client-authn-node';
import { AuthorizationAgent } from '@janeirodigital/interop-authorization-agent';
import { storage } from './oidc-storage';
const webId = 'https://alice.example/#id';
const agentId = 'https://authz.alice.example/';
// we assume that webId was used as sessionId the when session was created
const session = await getSessionFromStorage(webId, storage);
const agent = AuthorizationAgent.build(webId, clientId, {
fetch: oidcSession.fetch,
randomUUID
});
An instance of Authorization Agent provides a useful method for accessing agent registrations
applicationRegistrations(): AsyncIterable<CRUDApplicationRegistration
is an async iterable over all the application registrations
for await (const registration of agent.applicationRegistrations) {
// do something with the application registration
}
async findApplicationRegistration(iri: string): Promise<CRUDApplicationRegistration | undefined>
finds an application registration based on client_id
, if one exists
const clientId = 'https://projectron.example/#app';
const registration = await agent.findApplicationRegistration(clientId);
socialAgentRegistrations(): AsyncIterable<CRUDSocialAgentRegistration>
is an async iterable over all the social agent registrations
for await (const registration of agent.socialAgentRegistrations) {
// do something with the social agent registration
}
findSocialAgentRegistration(iri: string): Promise<CRUDSocialAgentRegistration | undefined>
finds a social registration based on webid
, if one exists
const webId = 'https://alice.example/#id';
const registration = await agent.findSocialAgentRegistration(webId);
Creating Access Authorizations is the primary responsibility of an Authorization Agent.
async recordAccessAuthorization(authorization: AccessAuthorizationStructure): Promise<ReadableAccessAuthorization>
Since access authorization is immutable, it is required to create a new one to replace the old one.
type AccessAuthorizationStructure = {
grantee: string; // webid or clientid
hasAccessNeedGroup: string; // iri
dataAuthorizations: DataAuthorizationData[];
};
type DataAuthorizationData = {
grantee: string; // webid or clientid
registeredShapeTree: string;
scopeOfAuthorization: string;
accessMode: string[];
dataOwner?: string; // webid
hasDataRegistration?: string;
inheritsFromAuthorization?: string;
creatorAccessMode?: string[];
hasDataInstance?: string[];
};
Based on existing Access Authorization an Access Grant can be created
async generateAccessGrant(accessAuthorizationIri: string): Promise<void>
This method updates the appropriate agent registration to reference the newly created access grant.
const authorizationData: AccessAuthorizationStructure = {
/* all the data */
};
const authorization = await agent.recordAccessAuthorization(authorizationData);
await agent.generateAccessGrant(authorization.iri);
This project is funded through the NGI Zero Entrust Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.
FAQs
Top level module for authorization agents confirming to Solid Application Interoperability specification
We found that @janeirodigital/interop-authorization-agent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.