
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@travetto/auth-rest-context
Advanced tools
Rest authentication context integration support for the Travetto framework
Install: @travetto/auth-rest-context
npm install @travetto/auth-rest-context
# or
yarn add @travetto/auth-rest-context
This module exposes a service AuthContextService that is @Injectable, and will provide access to the user's authentication context without access to the request object. This is extremely useful for auditing, logging, and other enforcement patterns.
This module intercepts the auth field on the http request object, and persists it using the Async Context module, meaning this information is now able to be retrieved outside of the normal execution flow, while the http request is still processing.
Code: AuthContextService
import { Principal } from '@travetto/auth';
import { AsyncContext } from '@travetto/context';
import { Inject, Injectable } from '@travetto/di';
const PrincipalⲐ = Symbol.for('@travetto/auth:principal');
/**
* Provides global context to accessing principal
*/
@Injectable()
export class AuthContextService {
@Inject()
context: AsyncContext;
/**
* Set principal
* @param p The auth principal
*/
set = (p: Principal | undefined): void => this.context.set(PrincipalⲐ, p);
/**
* Get the principal from the context
* @returns principal if authenticated
* @returns undefined if not authenticated
*/
get = <T = { [key: string]: unknown }>(): (Principal<T> | undefined) => this.context.get<Principal<T>>(PrincipalⲐ);
}
FAQs
Rest authentication context integration support for the Travetto framework
We found that @travetto/auth-rest-context 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.