Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_vercel_pw_plugin-0.0.2.tar.gz (6.9 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_vercel_pw_plugin-0.0.2-py3-none-any.whl (8.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page