Initial commit
This commit is contained in:
30
config/shield.js
Normal file
30
config/shield.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import { defineConfig } from '@adonisjs/shield';
|
||||
const shieldConfig = defineConfig({
|
||||
csp: {
|
||||
enabled: false,
|
||||
directives: {},
|
||||
reportOnly: false,
|
||||
},
|
||||
csrf: {
|
||||
enabled: true,
|
||||
exceptRoutes: (ctx) => {
|
||||
const p = ctx.route?.pattern ?? '';
|
||||
return p.startsWith('/api') || p.startsWith('/admin');
|
||||
},
|
||||
enableXsrfCookie: false,
|
||||
methods: ['POST', 'PUT', 'PATCH', 'DELETE'],
|
||||
},
|
||||
xFrame: {
|
||||
enabled: true,
|
||||
action: 'DENY',
|
||||
},
|
||||
hsts: {
|
||||
enabled: true,
|
||||
maxAge: '180 days',
|
||||
},
|
||||
contentTypeSniffing: {
|
||||
enabled: true,
|
||||
},
|
||||
});
|
||||
export default shieldConfig;
|
||||
//# sourceMappingURL=shield.js.map
|
||||
Reference in New Issue
Block a user