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/#Monkey123!
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.0.2
- Hide the
Plugin 'vercel_pw' was specified multiple times
warning
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
Hashes for mkdocs_vercel_pw_plugin-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee9befc2af5bcccf726777546836a7534696983e6d08b281979e3f772ece5858 |
|
MD5 | 684fb3b0e52b8889275ff2d858cc4080 |
|
BLAKE2b-256 | bd8b206163890e4309fb5e0148c9c671722be48c4018e8824a32a6bf7bfeea7f |
Hashes for mkdocs_vercel_pw_plugin-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2c61850633bf8bdce122d0ef99535f2f5707df560b17bb577638e1673f19da7 |
|
MD5 | 8619d14dd1829657e25923cf37aac3d2 |
|
BLAKE2b-256 | d6d926078e43bede5cdd3440ed4a3fcdf2ce95ef7053fdd91d3ff9a4a9e16b5c |