Skip to content

[server] 🐛 correct misspelled csurf key to csrf for config.security object in server(config) method#59141

Merged
typescript-bot merged 2 commits intoDefinitelyTyped:masterfrom
jjloneman:master
Mar 16, 2022
Merged

[server] 🐛 correct misspelled csurf key to csrf for config.security object in server(config) method#59141
typescript-bot merged 2 commits intoDefinitelyTyped:masterfrom
jjloneman:master

Conversation

@jjloneman
Copy link
Copy Markdown

@jjloneman jjloneman commented Mar 5, 2022

Fixes #59140

Please fill in this template

If changing an existing definition

  • Provide a URL to documentation or source code which provides context for the suggested changes:
    • Source code
      // ...
      
      module.exports = {
        name: 'security',
        options: {
          csrf: {
            // ...
    • Documentation

      Security

      It combines Csurf and Helmet to give extra security:

      server({
        security: {
          csrf: {
            ignoreMethods: ['GET', 'HEAD', 'OPTIONS'],
            value: req => req.body.csnowflakerf
          },
          frameguard: {
            action: 'deny'
          }
        }
      });

      ...

      Individual parts can also be disabled like this. This makes sense if you use other mechanisms to avoid CSRF, such as JWT:

      server({
        security: {
          csrf: false
        }
      });
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header. (Not applicable)

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Mar 5, 2022

@jjloneman Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners, DT maintainers or others

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 59141,
  "author": "jjloneman",
  "headCommitOid": "9656d9a38aab8d2ebe8dc2e3a2fc2645b7fc44da",
  "mergeBaseOid": "db23239e64168b3bf75e62d78aad6225c005e0b1",
  "lastPushDate": "2022-03-05T06:14:32.000Z",
  "lastActivityDate": "2022-03-16T15:06:33.000Z",
  "mergeOfferDate": "2022-03-16T14:55:07.000Z",
  "mergeRequestDate": "2022-03-16T15:06:33.000Z",
  "mergeRequestUser": "sant123",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "server",
      "kind": "edit",
      "files": [
        {
          "path": "types/server/server-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/server/typings/options.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "sant123",
        "iddan",
        "DazSanchez"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "sant123",
      "date": "2022-03-16T14:42:47.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 1059705181,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @sant123 @iddan @DazSanchez — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@DangerBotOSS
Copy link
Copy Markdown

Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files.
The check for missing properties isn't always right, so take this list as advice, not a requirement.

server (unpkg)

was missing the following properties:

  1. utils
  2. plugins

Generated by 🚫 dangerJS against 9656d9a

@jjloneman
Copy link
Copy Markdown
Author

jjloneman commented Mar 5, 2022

Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files. The check for missing properties isn't always right, so take this list as advice, not a requirement.

server (unpkg)

was missing the following properties:

  1. utils
  2. plugins

Generated by 🚫 dangerJS against 9656d9a

Re: @DangerBotOSS, I would be happy to provide these type definitions as well in another PR as the amount of properties for server.plugins is quite lengthy.

@jjloneman jjloneman changed the title [@types/server] fix(options): 🐛 fix misspelled csrf key [server] fix(options): 🐛 fix misspelled csrf key Mar 5, 2022
@jjloneman jjloneman changed the title [server] fix(options): 🐛 fix misspelled csrf key [server] 🐛 correct misspelled csurf key to csrf for config.security object in server(config) method Mar 5, 2022
@jjloneman
Copy link
Copy Markdown
Author

Hi @sant123 @iddan @DazSanchez, just checking to see if there are any issues with the PR or if it's good to merge? Thanks!

@DazSanchez
Copy link
Copy Markdown
Contributor

@jjloneman Hi, I checked the source code, tests and documentation and everything seems to be correct

@jjloneman
Copy link
Copy Markdown
Author

@jjloneman Hi, I checked the source code, tests and documentation and everything seems to be correct

@DazSanchez Great! Would you be able to hit the approve button on the PR then? 🙂

@DazSanchez
Copy link
Copy Markdown
Contributor

@jjloneman Sorry, but I have no write access to the repository. I'm not able to merge PR's.

@typescript-bot typescript-bot added the Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. label Mar 16, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

Re-ping @sant123, @iddan, @DazSanchez:

This PR has been out for over a week, yet I haven't seen any reviews.

Could someone please give it some attention? Thanks!

Copy link
Copy Markdown
Contributor

@sant123 sant123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner and removed Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. labels Mar 16, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@jjloneman: Everything looks good here. I am ready to merge this PR (at 9656d9a) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@sant123, @iddan, @DazSanchez: you can do this too.)

@sant123
Copy link
Copy Markdown
Contributor

sant123 commented Mar 16, 2022

Ready to merge

@typescript-bot typescript-bot merged commit 7020115 into DefinitelyTyped:master Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants