Skip to main content

Python UAA test server

Project description

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

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

puaa-0.2.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

puaa-0.2.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file puaa-0.2.2.tar.gz.

File metadata

  • Download URL: puaa-0.2.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for puaa-0.2.2.tar.gz
Algorithm Hash digest
SHA256 decce85294cd9b641d4636c88718096cb46834ddcf73d2022f26ce372a12ca90
MD5 7535e91f54c5b4189bf81a9ce06ebe56
BLAKE2b-256 dfc971871d1cc684eb543096bc5e25cee67aa8e5c6b78d46e3d7c457211b6790

See more details on using hashes here.

File details

Details for the file puaa-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: puaa-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for puaa-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5bebb3e81162f932c1f4f63cf0f8e618ce6c9e1afee71eccbd47f52d30bb5bba
MD5 b6da2d295318267e0986ee76bb9085e6
BLAKE2b-256 882a3a71493c28fe320c474efa344924a8304bc66bcee88dc47b827118926807

See more details on using hashes here.

Supported by

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