Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Commit

Permalink
Start work on keystone auth backend proper
Browse files Browse the repository at this point in the history
Just rigs up the wsgi wrapper and loads the config; still WIP.
  • Loading branch information
zenhack committed Jun 23, 2016
1 parent 0708a3e commit 0731242
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions haas/ext/auth/keystone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from keystonemiddleware.auth_token import filter_factory
from haas.flaskapp import app
from haas.config import cfg
import logging
import sys

logger = logging.getLogger(__name__)


def setup(*args, **kwargs):
if not cfg.has_section(__name__):
logger.error('No section for [%s] in haas.cfg; authentication will '
'not work without this. Please add this section and try '
'again.' % __name__)
sys.exit(1)
keystone_cfg = {}
for key in cfg.options(__name__):
keystone_cfg[key] = cfg.get(__name__, key)

# Great job with the API design Openstack! </sarcasm>
factory = filter_factory(keystone_cfg)
app.wsgi_app = factory(app.wsgi_app)

0 comments on commit 0731242

Please sign in to comment.