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
Metadata
Release files for mkdocs-vercel-pw-plugin 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mkdocs_vercel_pw_plugin-0.1.0.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mkdocs_vercel_pw_plugin-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.6 kB
Release files / mkdocs_vercel_pw_plugin-0.1.0.tar.gz
| Download URL | mkdocs_vercel_pw_plugin-0.1.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
416a84da8dac511524275c9bfcfd4cc3f194e6d9d966aa816931213d62fe5f17
|
|
BLAKE2b-256 checksum How to use checksums |
2f2a55c204b01d884b2f5cafc447bbc87f7c884e3bb3470321ebcde74c91b0c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.6
|
Release files / mkdocs_vercel_pw_plugin-0.1.0-py3-none-any.whl
| Download URL | mkdocs_vercel_pw_plugin-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3464ec1ea094dee7f67b37fb9a7b1c4f12aa544fb6d5e2f2178a96dd3cb21613
|
|
BLAKE2b-256 checksum How to use checksums |
86bb9be235726fa227d699ffb2a4660d13409d4e65144a30a66fcd6d711289d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.6
|