MCPcopy Index your code
hub / github.com/adonisjs/shield

github.com/adonisjs/shield @v9.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v9.0.0 ↗ · + Follow
56 symbols 139 edges 30 files 19 documented · 34% 2 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

@adonisjs/shield

gh-workflow-image npm-image [license-image]license-url

Introduction

A package to keep AdonisJS applications safe from common Web attacks like XSS, CSRF Protection and a lot more.

Official Documentation

The documentation is available on the AdonisJS website

Contributing

One of the primary goals of AdonisJS is to have a vibrant community of users and contributors who believes in the principles of the framework.

We encourage you to read the contribution guide before contributing to the framework.

Code of Conduct

In order to ensure that the AdonisJS community is welcoming to all, please review and abide by the Code of Conduct.

License

AdonisJS Shield is open-sourced software licensed under the MIT license.

Extension points exported contracts — how you extend this code

HttpRequest (Interface)
* Extended Request interface with CSRF token support.
src/shield_middleware.ts
ContentSecurityPolicyOptions (Interface)
(no doc)
src/helmet_csp.ts
ApiRequest (Interface)
(no doc)
src/plugins/api_client.ts
HttpResponse (Interface)
* Extended Response interface with CSP nonce support.
src/shield_middleware.ts
ContentSecurityPolicy (Interface)
(no doc)
src/helmet_csp.ts
ServerResponse (Interface)
(no doc)
src/shield_middleware.ts

Core symbols most depended-on inside this repo

handle
called by 23
src/guards/csrf.ts
setup
called by 21
tests/helpers.ts
csrfFactory
called by 20
src/guards/csrf.ts
cspFactory
called by 7
src/guards/csp/main.ts
hstsFactory
called by 6
src/guards/hsts.ts
frameGuardFactory
called by 5
src/guards/frame_guard.ts
register
called by 3
src/guards/csp/keywords.ts
assertDirectiveValueIsValid
called by 2
src/helmet_csp.ts

Shape

Function 24
Method 16
Class 10
Interface 6

Languages

TypeScript100%

Modules by API surface

src/guards/csrf.ts10 symbols
src/helmet_csp.ts9 symbols
src/shield_middleware.ts7 symbols
src/plugins/api_client.ts4 symbols
src/guards/csp/keywords.ts4 symbols
src/errors.ts4 symbols
providers/shield_provider.ts4 symbols
tests/helpers.ts3 symbols
src/guards/hsts.ts2 symbols
tests/hsts.spec.ts1 symbols
tests/frame_guard.spec.ts1 symbols
tests/csrf.spec.ts1 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add shield \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact