@nitra/cf-security
v4.5.4
Published
check header in serverless
Downloads
291
Readme
cf-security
Check security header in Cloud Functions
X_NITRA_CF_KEY: secret
const { cfSecurity } = require('@nitra/cf-security')
exports.function = async (req, res) => {
if (!cfSecurity(req)) {
res.send(`Nitra security not passed`)
return
}
import runSecurity from '@nitra/cf-security'
if (!runSecurity(req, ["role1","role2"])) {
res.send(`Nitra security not passed`)
return
}