Skip to content

Commit

Permalink
feat: Add CSRF prevention plugin (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfoo1984 authored Dec 7, 2023
1 parent b25922a commit 64c8215
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .meshrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ sources:
source: ./sources/czid-schema.graphql
operationHeaders:
Cookie: "{context.headers['cookie']}"
"X-CSRF-Token": "{context.headers['x-csrf-token']}"
- name: CZIDREST
handler:
jsonSchema:
Expand Down Expand Up @@ -207,6 +206,9 @@ additionalTypeDefs: |
}
additionalResolvers:
- ./resolvers.ts
plugins:
- csrfPrevention:
requestHeaders: ['x-graphql-yoga-csrf']
serve:
port: 4444
endpoint: "/graphqlfed"
Expand Down
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@graphql-mesh/cli": "^0.87.15",
"@graphql-mesh/graphql": "^0.95.7",
"@graphql-mesh/json-schema": "^0.95.10",
"@graphql-yoga/plugin-csrf-prevention": "^3.0.0",
"graphql": "^16.8.1"
},
"overrides": {}
Expand Down

0 comments on commit 64c8215

Please sign in to comment.