# vercel-pw-protection
This plugin overwrites your `vercel.json`'s `routes` attribute so that your deployment is password protected.
Login on demo: <https://mkdocs-vercel-pw-plugin.vercel.app/#Täßt😀Emoji>
This plugin is an implementation of the cookie method from `https://github.com/six-two/mkdocs-vercel-basic-auth-example`.
Prerequesites:
You have created a `vercel.json` file and it does not have any existing `routes`.
## Usage
Install the package via pip:
```bash
pip install mkdocs-vercel-pw-plugin
```
Then add the plugin to your `mkdocs.yml`:
```yaml
plugins:
- vercel_pw:
cookie_name: JSESSIONID
password: Monkey123!
restrict_to_domain: mkdocs-pw-protection.vercel.app
vercel_json_path: ../vercel.json
```
Optional:
You can link to `/logout.html`.
You need to run a successful build (`mkdocs build` or `mkdocs serve`) after changing the config before pushing your changes to Vercel.
This is because the `vercel.json` is only updated after a build is performed.
## Customization
By default the "login" page mimics the Vercel deployment not found page.
This serves as a small security by obscurity measure.
Of course you can also provide your own `docs/deployment_not_found.html` that instead shows a login form or something like that.
## Notable changes
### Version 0.1.0
- Use hex encoding instead of base64.
The issue is that vercel's header matching is case insensitive, which makes password brute forcing much easier.
For example if the password was `aa` (`YWE=`), the password `c` (`YwE=`) would also be accepted.
The new encoding should also accept Unicode characters like Umlauts, emojis, etc.
But I would recommend sticking to ASCII, since Unicode is tricky and I am not sure if JavaScript and Python handle encoding exactly the same.
### Version 0.0.2
- Hide the `Plugin 'vercel_pw' was specified multiple times` warning
Raw data
{
"_id": null,
"home_page": "https://github.com/six-two/mkdocs-vercel-pw-plugin",
"name": "mkdocs-vercel-pw-plugin",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "six-two",
"author_email": "pip@six-two.dev",
"download_url": "https://files.pythonhosted.org/packages/2f/2a/55c204b01d884b2f5cafc447bbc87f7c884e3bb3470321ebcde74c91b0c1/mkdocs_vercel_pw_plugin-0.1.0.tar.gz",
"platform": null,
"description": "# vercel-pw-protection\n\nThis plugin overwrites your `vercel.json`'s `routes` attribute so that your deployment is password protected.\n\nLogin on demo: <https://mkdocs-vercel-pw-plugin.vercel.app/#T\u00e4\u00dft\ud83d\ude00Emoji>\n\nThis plugin is an implementation of the cookie method from `https://github.com/six-two/mkdocs-vercel-basic-auth-example`.\n\nPrerequesites:\nYou have created a `vercel.json` file and it does not have any existing `routes`.\n\n## Usage\n\nInstall the package via pip:\n```bash\npip install mkdocs-vercel-pw-plugin\n```\n\nThen add the plugin to your `mkdocs.yml`:\n```yaml\nplugins:\n- vercel_pw:\n cookie_name: JSESSIONID\n password: Monkey123!\n restrict_to_domain: mkdocs-pw-protection.vercel.app\n vercel_json_path: ../vercel.json\n```\n\nOptional:\nYou can link to `/logout.html`.\n\nYou need to run a successful build (`mkdocs build` or `mkdocs serve`) after changing the config before pushing your changes to Vercel.\nThis is because the `vercel.json` is only updated after a build is performed.\n\n## Customization\n\nBy default the \"login\" page mimics the Vercel deployment not found page.\nThis serves as a small security by obscurity measure.\nOf course you can also provide your own `docs/deployment_not_found.html` that instead shows a login form or something like that.\n\n## Notable changes\n\n### Version 0.1.0\n\n- Use hex encoding instead of base64.\n The issue is that vercel's header matching is case insensitive, which makes password brute forcing much easier.\n For example if the password was `aa` (`YWE=`), the password `c` (`YwE=`) would also be accepted.\n The new encoding should also accept Unicode characters like Umlauts, emojis, etc.\n But I would recommend sticking to ASCII, since Unicode is tricky and I am not sure if JavaScript and Python handle encoding exactly the same.\n\n### Version 0.0.2\n\n- Hide the `Plugin 'vercel_pw' was specified multiple times` warning\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Add routes to your vercel.json that enforces password authentication",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/six-two/mkdocs-vercel-pw-plugin"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "86bb9be235726fa227d699ffb2a4660d13409d4e65144a30a66fcd6d711289d3",
"md5": "6ff20d10490ed51f636e54d117b7dc02",
"sha256": "3464ec1ea094dee7f67b37fb9a7b1c4f12aa544fb6d5e2f2178a96dd3cb21613"
},
"downloads": -1,
"filename": "mkdocs_vercel_pw_plugin-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6ff20d10490ed51f636e54d117b7dc02",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 8391,
"upload_time": "2024-07-21T15:39:57",
"upload_time_iso_8601": "2024-07-21T15:39:57.628736Z",
"url": "https://files.pythonhosted.org/packages/86/bb/9be235726fa227d699ffb2a4660d13409d4e65144a30a66fcd6d711289d3/mkdocs_vercel_pw_plugin-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2f2a55c204b01d884b2f5cafc447bbc87f7c884e3bb3470321ebcde74c91b0c1",
"md5": "79bf249dfef986d7956e216008ae4592",
"sha256": "416a84da8dac511524275c9bfcfd4cc3f194e6d9d966aa816931213d62fe5f17"
},
"downloads": -1,
"filename": "mkdocs_vercel_pw_plugin-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "79bf249dfef986d7956e216008ae4592",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 7215,
"upload_time": "2024-07-21T15:39:58",
"upload_time_iso_8601": "2024-07-21T15:39:58.925870Z",
"url": "https://files.pythonhosted.org/packages/2f/2a/55c204b01d884b2f5cafc447bbc87f7c884e3bb3470321ebcde74c91b0c1/mkdocs_vercel_pw_plugin-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-21 15:39:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "six-two",
"github_project": "mkdocs-vercel-pw-plugin",
"github_not_found": true,
"lcname": "mkdocs-vercel-pw-plugin"
}