-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Basic Auth Configuration for Multiple Paths #267
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small issue. If you revert it, it should be ready to review and further merge :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Hey @rathahin Could you please adjust the unit tests to fix the CI? |
…th starts with an exclusion but is not included
…obal site is permitted, with only the inclusion criteria taking effect.
Thanks @rathahin 💚 I will merge it now to the rc branch, conduct some tests and will release a new RC version today :) |
Thank you @rathahin ! 💚 |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [nuxt-security](https://nuxt-security.vercel.app) ([source](https://togithub.com/Baroshem/nuxt-security)) | [`1.0.0-rc.2` -> `1.0.0-rc.3`](https://renovatebot.com/diffs/npm/nuxt-security/1.0.0-rc.2/1.0.0-rc.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/nuxt-security/1.0.0-rc.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/nuxt-security/1.0.0-rc.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/nuxt-security/1.0.0-rc.2/1.0.0-rc.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/nuxt-security/1.0.0-rc.2/1.0.0-rc.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>Baroshem/nuxt-security (nuxt-security)</summary> ### [`v1.0.0-rc.3`](https://togithub.com/Baroshem/nuxt-security/releases/tag/v1.0.0-rc.3): 1.0.0-rc.3 [Compare Source](https://togithub.com/Baroshem/nuxt-security/compare/42f7399289e8edc50b2c68e1e70b1012ac95d8dd...v1.0.0-rc.3) > 1.0.0-rc.3 is the next release candidate #### 🗞️ Next steps We are planning to release one or two more release candidate versions with bugfixes before a stable 1.0.0 version will be released. #### ✅ Migration Guide This version includes⚠️ breaking changes but don't worry, we have prepared migration guide for you 😉 ##### In the previous version, `nonce` could be either an object with a type `NonceOptions` or `false`. ```ts export type NonceOptions = { enabled: boolean; mode?: 'renew' | 'check'; value?: (() => string); } ``` Now it is only a boolean value: ```ts export default defineNuxtConfig({ security: { nonce: true | false } } ``` This change was necessary to resolve security vulnerability for nonce reported by vejja [https://github.com/Baroshem/nuxt-security/pull/257](https://togithub.com/Baroshem/nuxt-security/pull/257). Read more about the new usage of nonce in this module https://nuxt-security.vercel.app/documentation/headers/csp#nonce 👉 Changelog [compare changes](https://togithub.com/Baroshem/nuxt-security/compare/v1.0.0-rc.1...v1.0.0-rc.3) #### 🚀 Enhancements - Add `credentialless` value to `Cross-Origin-Embedder-Policy` header - Export configuration type - Improve CSP Compliance - ensure csp plugins are added last - Extend CSP support of SSG mode - use cheerio HTML parser for CSP #### 🩹 Fixes - Basic Auth Configuration for Multiple Paths - Nonce value is injected in all pre-rendered pages if the `nonce` option is set to `true` #### 📖 Documentation - Clarify rateLimiter `interval` property #### 🏡 Chore - Improve TS config ####⚠️ Breaking Changes - CSP Compliance #### ❤️ Contributors - Espen Solli Grande ([@​espensgr](https://togithub.com/espensgr)) - vejja ([@​vejja](https://togithub.com/vejja)) - Tristan ([@​Tristan971](https://togithub.com/Tristan971)) - Jonas Thelemann ([@​dargmuesli](https://togithub.com/dargmuesli)) - nsratha ([@​rathahin](https://togithub.com/rathahin)) #### 🏋️♂️ New Contributors - [@​espensgr](https://togithub.com/espensgr) made their first contribution in [https://github.com/Baroshem/nuxt-security/pull/261](https://togithub.com/Baroshem/nuxt-security/pull/261) - [@​vejja](https://togithub.com/vejja) made their first contribution in [https://github.com/Baroshem/nuxt-security/pull/245](https://togithub.com/Baroshem/nuxt-security/pull/245) - [@​rathahin](https://togithub.com/rathahin) made their first contribution in [https://github.com/Baroshem/nuxt-security/pull/267](https://togithub.com/Baroshem/nuxt-security/pull/267) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/maevsi/maevsi). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMS41IiwidXBkYXRlZEluVmVyIjoiMzcuMzEuNSIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->
Types of changes
Description
The existing implementation of basic authentication works partially when multiple routes are specified. The
.some()
method used in the code causes it to return as soon as one matching path is found, leading to incorrect behavior for additional paths.This change replaces the
.some()
method with individual variables to track theexclude
andinclude
lists. It uses.some()
to update these variables and then checks them to decide whether to block the request.This fix ensures that all specified paths in both the
exclude
andinclude
arrays are correctly checked. It provides a clearer and more accurate way to handle basic authentication for multiple routes.Resolves: #[Issue Number]
Checklist: