Pyramid AuthService
Project description
AuthService README
==================
Getting Started
---------------
include secret in pyramid application as well as any jwt auth settings if using jwt and session based auth(web auth)
EXAMPLE ADDITION TO INI
=======================
secret = seekrit
jwt.private_key = seekrit
jwt.expiration = 43200
========================
next include the package in the __init__.py like so:
web auth
========
config.include('authservice.views.web_auth')
config.include('authservice.web_security')
jwt auth
========
config.include('authservice.views.jwt_auth')
config.include('authservice.jwt_security')
==========================================
You will also want to include an initialize_auth_db.py script in your scripts directory
initialize_auth_db.ini
======================
import os
import sys
from authservice.scripts import initializedb
from pyramid.paster import (
get_appsettings,
setup_logging,
)
from pyramid.scripts.common import parse_vars
def usage(argv):
cmd = os.path.basename(argv[0])
print('usage: %s <config_uri> [var=value]\n'
'(example: "%s development.ini")' % (cmd, cmd))
sys.exit(1)
def main(argv=sys.argv):
if len(argv) < 2:
usage(argv)
config_uri = argv[1]
options = parse_vars(argv[2:])
setup_logging(config_uri)
settings = get_appsettings(config_uri, options=options)
inv = initializedb.InitializeDb(settings['sqlalchemy.url'])
inv.initialize_db()
======================================================
Also add this as an entry point in setup.py
[console_scripts]
initialize_auth_db = myapp.scripts.initialize_auth_db:main
Then after running python setup.py develop you can initialize the auth db like so:
initialize_auth_db development.ini
0.0
---
- Initial version
==================
Getting Started
---------------
include secret in pyramid application as well as any jwt auth settings if using jwt and session based auth(web auth)
EXAMPLE ADDITION TO INI
=======================
secret = seekrit
jwt.private_key = seekrit
jwt.expiration = 43200
========================
next include the package in the __init__.py like so:
web auth
========
config.include('authservice.views.web_auth')
config.include('authservice.web_security')
jwt auth
========
config.include('authservice.views.jwt_auth')
config.include('authservice.jwt_security')
==========================================
You will also want to include an initialize_auth_db.py script in your scripts directory
initialize_auth_db.ini
======================
import os
import sys
from authservice.scripts import initializedb
from pyramid.paster import (
get_appsettings,
setup_logging,
)
from pyramid.scripts.common import parse_vars
def usage(argv):
cmd = os.path.basename(argv[0])
print('usage: %s <config_uri> [var=value]\n'
'(example: "%s development.ini")' % (cmd, cmd))
sys.exit(1)
def main(argv=sys.argv):
if len(argv) < 2:
usage(argv)
config_uri = argv[1]
options = parse_vars(argv[2:])
setup_logging(config_uri)
settings = get_appsettings(config_uri, options=options)
inv = initializedb.InitializeDb(settings['sqlalchemy.url'])
inv.initialize_db()
======================================================
Also add this as an entry point in setup.py
[console_scripts]
initialize_auth_db = myapp.scripts.initialize_auth_db:main
Then after running python setup.py develop you can initialize the auth db like so:
initialize_auth_db development.ini
0.0
---
- Initial version
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
File details
Details for the file PyramidAuthService-0.1.tar.gz.
File metadata
- Download URL: PyramidAuthService-0.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bd6cfa0ae3321781e47b34eb803e24ff12f2f839322d1f35bf4fe139ddf4fc2
|
|
| MD5 |
8d924c3a5fe976ffb8d3c6196a2a621d
|
|
| BLAKE2b-256 |
613b16ea3a8ecbbf17758b9a5a07a9c49e465e04ee6300055e103ec75109f58b
|