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.
nestjs-hmac256-guard
Advanced tools
This module implement HMAC256 request verification base on requirement here - (https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-authentication-hmac)
import { HMacModule } from 'nestjs-hmac256-guard';
@Module({
imports: [
HMacModule.register({ HMAC_HASH_SECRET: 'this is my hash secret' }),
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
Then use Guard
import { HmacGuard } from 'nestjs-hmac256-guard';
@Controller()
@UseGuards(HmacGuard)
export class AppController {
}
import { HMacModule } from 'nestjs-hmac256-guard';
@Module({
imports: [
HMacModule.register({
HMAC_HASH_SECRET: 'this is my hash secret',
HMAC_SIGNATURE_HEADER_NAME : 'x-my-hmac256-signature'
REQUEST_CONTENT_HASH_HEADER_NAME: 'x-content-sha26',
REQUEST_DATE_HEADER_NAME: 'x-date',
MAX_REQUEST_MINUTES_ALLOW = 900
}),
],
controllers: [AppController],
providers: [AppService],
})
Default value
HMAC_SIGNATURE_HEADER_NAME: x-signature
REQUEST_CONTENT_HASH_HEADER_NAME: x-content-sha26
MAX_REQUEST_MINUTES_ALLOW: 900
REQUEST_DATE_HEADER_NAME: x-date
import { HMacModule } from 'nestjs-hmac256-guard';
@Module({
imports: [
HMacModule.register({
HMAC_HASH_SECRET: 'this is my hash secret',
getStringToHash: ({
verb,
url,
host,
date,
contentHash,
}) => {
return 'your custom string format if that not same with default '
}
}),
],
controllers: [AppController],
providers: [AppService],
})
FAQs
HMAC authentication guard for NestJS
The npm package nestjs-hmac256-guard receives a total of 20 weekly downloads. As such, nestjs-hmac256-guard popularity was classified as not popular.
We found that nestjs-hmac256-guard 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.
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.