Skip to main content

puaa

An uaa test server in python. The main purpose is to serve as an easily configurable mock oauth server.

Attention: it's not a secured OAuth server and must never be used on production machines.

Install

Like any python package:

pip install puaa

Configure

The server is configured through a regular uaa.yml but uses only a small subset of it, mainly "jwt" and "oauth" sections:

issuer:
  uri: http://localhost:8080

oauth:
  clients:
    test:
      id: test
      secret: test
      authorized-grant-types: client_credentials
      scope: none
      authorities: uaa.admin,clients.admin,clients.read,clients.write,clients.secret

jwt:
 token:
   policy:
     accessTokenValiditySeconds: 3600
     activeKeyId: key-id-1
     keys:
       key-id-1:
         signingKey: |
           -----BEGIN RSA PRIVATE KEY-----
           ...
           -----END RSA PRIVATE KEY-----

Run locally

Needs few environment variables to start:

export AUTHLIB_INSECURE_TRANSPORT=true
export UAA_CONFIG_FILE=<PATH>/uaa.yaml
gunicorn -k gevent puaa.app:app

Then can retrieve a token with e.g.:

curl -sS 'http://localhost:8000/oauth/token' -u test:test -d 'grant_type=client_credentials'

Limitations

Supports the "client_credentials" grant only so far.

Alternatives

The full uaa server https://github.com/cloudfoundry/uaa/ But I gave up to configure it as I wish.

License

MIT License

Metadata

Release files for puaa 0.2.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 puaa 0.2.2
File Size Uploaded
puaa-0.2.2.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for puaa 0.2.2
File Interpreter ABI Platform
puaa-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / puaa-0.2.2.tar.gz

Download URL puaa-0.2.2.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
decce85294cd9b641d4636c88718096cb46834ddcf73d2022f26ce372a12ca90
BLAKE2b-256 checksum
How to use checksums
dfc971871d1cc684eb543096bc5e25cee67aa8e5c6b78d46e3d7c457211b6790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Release files / puaa-0.2.2-py3-none-any.whl

Download URL puaa-0.2.2-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5bebb3e81162f932c1f4f63cf0f8e618ce6c9e1afee71eccbd47f52d30bb5bba
BLAKE2b-256 checksum
How to use checksums
882a3a71493c28fe320c474efa344924a8304bc66bcee88dc47b827118926807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Release history Release notifications | RSS feed

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.2 This release

2 release files

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