Skip to main content

who_dev

Testing Authenticataion for repoze.who v2 WSGI Applications

This plugin is intented for quickly configuring test users for development purposes. Its use is not recommended in production systems.

Installing

pip install who_dev

Installing the mainline development branch

The plugin is hosted in a git branch hosted at github.com. To get the latest source code, run:

git clone git@github.com:m-martinez/who_dev.git

Then run the command below:

pip install -e who_dev/

Configuring repoze.who in a INI file

You can configure your repoze.who based authentication via a *.ini file, and then load such settings in your application.

Say we have a file called who.ini with the following contents:

[general]
request_classifier = repoze.who.classifiers:default_request_classifier
challenge_decider = repoze.who.classifiers:default_challenge_decider

[identifiers]
plugins =
  auth_tkt

[authenticators]
plugins =
  auth_tkt
  dev_auth

[challengers]
plugins =
    form;browser

[mdproviders]
plugins =
  dev_properties
  dev_groups

[plugin:form]
use = repoze.who.plugins.form:make_plugin
rememberer_name = auth_tkt

[plugin:auth_tkt]
use = repoze.who.plugins.auth_tkt:make_plugin
secret = s3kr1t

[plugin:dev_auth]
use = who_dev:JSONAuthenticatorPlugin
data = {
  "someuser":  {
    "password": "abc123",
    "properties": {
      "first_name": "Some",
      "last_name": "User",
      "email": "someuser@localhost"
    },
    "groups": ["members", "editors"]
  }
}

[plugin:dev_properties]
use = who_dev:JSONPropertiesPlugin
source_key = properties

[plugin:dev_groups]
use = who_dev:JSONPropertiesPlugin
source_key = groups

Framework-specific documentation

You may want to check the following framework-specific documents to learn tips on how to implement repoze.who in the framework you are using:

Configuration

JSONAuthenticatorPlugin

This plugin uses a JSON object as a database, where each key in the object is the userid and the value is another object with specific details about the user, which can then be used along ith JSONPropertiesPlugin to retrieve specific details about the user.

Each record for a user must at a minimum contain a password entry so that the user can authenticate, for example:

data={
  "someuser": {"password": "abc123"},
  "otheruser": {"password": "xyz789"}
}

Setting

Default

Description

data

Required A JSON object contaiing records for each test userid.

JSONPropertiesPlugin

This plugin uses the specific key in the authenticator data to lookup specific details about a user.

Setting

Default

Description

source_key

Required Sets the remote user data to the value located at source_key for the currently authenticated userid.

Changelog

0.0.2 (2016-06-22)

  • Converted to actual module so setup.py packages correctly

0.0.1 (2015-10-19)

  • The initial release.

Metadata

Release files for who_dev 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for who_dev 0.0.2
File Size Uploaded Provenance Actions
who_dev-0.0.2.tar.gz 5.2 kB Without provenance Details for who_dev-0.0.2.tar.gz

Release files / who_dev-0.0.2.tar.gz

Download URL who_dev-0.0.2.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
25f9ebcad1cf272cefdfeeb745a234fe38868bde4c9204ad57401e41eb99265d
BLAKE2b-256 checksum
How to use checksums
c15f57791589b94364e740d0928f7322f93170458e9a8469b13f81345bad3593
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for who_dev 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page