Add routes to your vercel.json that enforces password authentication
Project description
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:
pip install mkdocs-vercel-pw-plugin
Then add the plugin to your mkdocs.yml:
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 passwordc(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 timeswarning
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_vercel_pw_plugin-0.1.0.tar.gz.
File metadata
- Download URL: mkdocs_vercel_pw_plugin-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
416a84da8dac511524275c9bfcfd4cc3f194e6d9d966aa816931213d62fe5f17
|
|
| MD5 |
79bf249dfef986d7956e216008ae4592
|
|
| BLAKE2b-256 |
2f2a55c204b01d884b2f5cafc447bbc87f7c884e3bb3470321ebcde74c91b0c1
|
File details
Details for the file mkdocs_vercel_pw_plugin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_vercel_pw_plugin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3464ec1ea094dee7f67b37fb9a7b1c4f12aa544fb6d5e2f2178a96dd3cb21613
|
|
| MD5 |
6ff20d10490ed51f636e54d117b7dc02
|
|
| BLAKE2b-256 |
86bb9be235726fa227d699ffb2a4660d13409d4e65144a30a66fcd6d711289d3
|