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

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
zenhack committed Jun 15, 2016
1 parent e805241 commit 6db3834
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 6db3834

Please sign in to comment.