VercelでDeployment Protectionができるらしい
これです
Vercel offers the following Deployment Protection features:
- Vercel Authentication: Restricts access to your deployments to only Vercel users with suitable access rights. Vercel Authentication is available on all plans
- Password Protection: Restricts access to your deployments to only users with the correct password. Password Protection is available on the Enterprise plan, or as a paid add-on for Pro plans
- Trusted IPs: Restricts access to your deployments to only users with the correct IP address. Trusted IPs is available on the Enterprise plan
欲しいやつは一通りあるな、パスワード認証は有料プランから
Basic認証用のミドルウェア書いてたの消せそう
あ、Password ProtectionはただのProプランじゃだめなのか
With Password Protection enabled, visitors to your deployment must enter the pre-defined password to gain access. You can set the desired password from your project settings when enabling the feature, and update it any time
When you enable Advanced Deployment Protection, you will be charged $150 per month for the add-on, and will have access to all Advanced Deployment Protection features.
きちー
Vercel Authだとキツすぎなんだよねー
Ensures visitors to your deployments are logged in to Vercel and are a member of your team.
やり方
- From the dashboard, select the project you wish to set Deployment Protection on
- Once selected, navigate to the Settings tab
- From the list, select the Deployment Protection tab
たしかに下の方にDeployment Protectionあるな
admin権限があればすぐできそうだった
プロテクション対象について
You can configure the type of Deployment Protection for each environment in your project depending on your projects security needs. When choosing your protection method, you can select from three options:
- Standard Protection: Protects both preview and generated production URLs. Standard Protection is available on all plans
- Only Preview Deployments: Protects only preview URLs. Protecting preview deployments is available on all plans
- All Deployments: Protects all URLs. Protecting all deployments is available on Pro and Enterprise plans
Standard Protectionでよさげ
Enabling Standard Protection restricts public access to the production generated deployment URL. This affects VERCEL_URL from System Environment Variables and VERCEL_URL from Framework Environment Variables, making them unsuitable for fetch requests.
If you are using VERCEL_URL to make fetch requests, you will need to be update them to instead target same domain that the user has requested.
たしかに、こういう懸念があるか