Add authentication against Keystone.
Change-Id: Ifb581cc809074354d7db1404c28561ec722cf0f0 Implements-feature: MRN-1146.
This commit is contained in:
parent
367d90f116
commit
b6613f9ecb
@ -3,7 +3,13 @@
|
|||||||
host = localhost
|
host = localhost
|
||||||
# Port the bind the server to
|
# Port the bind the server to
|
||||||
port = 5000
|
port = 5000
|
||||||
|
# Keystone related stuff
|
||||||
|
auth_host = 172.18.124.202
|
||||||
|
auth_port = 5000
|
||||||
|
auth_protocol = http
|
||||||
|
admin_user = admin
|
||||||
|
admin_password = swordfish
|
||||||
|
admin_tenant_name = admin
|
||||||
|
|
||||||
# Provide information about data types
|
# Provide information about data types
|
||||||
# absolute path to manifest location(root directory)
|
# absolute path to manifest location(root directory)
|
||||||
|
@ -143,7 +143,7 @@ def create_dirs(data_type, path):
|
|||||||
|
|
||||||
|
|
||||||
@v1_api.route('/admin/<data_type>/<path:path>', methods=['DELETE'])
|
@v1_api.route('/admin/<data_type>/<path:path>', methods=['DELETE'])
|
||||||
def delete_dirictory_or_file(data_type, path):
|
def delete_directory_or_file(data_type, path):
|
||||||
_check_data_type(data_type)
|
_check_data_type(data_type)
|
||||||
result_path = _compose_path(data_type, path)
|
result_path = _compose_path(data_type, path)
|
||||||
if not os.path.exists(result_path):
|
if not os.path.exists(result_path):
|
||||||
|
@ -52,7 +52,14 @@ def main():
|
|||||||
|
|
||||||
log.setup('muranorepository')
|
log.setup('muranorepository')
|
||||||
|
|
||||||
app = server.make_app()
|
app = server.make_app({
|
||||||
|
'auth_host': cfg.CONF.auth_host,
|
||||||
|
'auth_port': cfg.CONF.auth_port,
|
||||||
|
'auth_protocol': cfg.CONF.auth_protocol,
|
||||||
|
'admin_user': cfg.CONF.admin_user,
|
||||||
|
'admin_password': cfg.CONF.admin_password,
|
||||||
|
'admin_tenant_name': cfg.CONF.admin_tenant_name
|
||||||
|
})
|
||||||
|
|
||||||
wsgi.server(eventlet.listen((cfg.CONF.host, cfg.CONF.port),
|
wsgi.server(eventlet.listen((cfg.CONF.host, cfg.CONF.port),
|
||||||
backlog=500),
|
backlog=500),
|
||||||
|
@ -19,6 +19,12 @@ from muranorepository.consts import *
|
|||||||
server_opts = [
|
server_opts = [
|
||||||
cfg.StrOpt('host', default='127.0.0.1'),
|
cfg.StrOpt('host', default='127.0.0.1'),
|
||||||
cfg.IntOpt('port', default=5000),
|
cfg.IntOpt('port', default=5000),
|
||||||
|
cfg.StrOpt('auth_host', default=None),
|
||||||
|
cfg.IntOpt('auth_port', default=5000),
|
||||||
|
cfg.StrOpt('auth_protocol', default='http'),
|
||||||
|
cfg.StrOpt('admin_user', default='admin'),
|
||||||
|
cfg.StrOpt('admin_password', default=None),
|
||||||
|
cfg.StrOpt('admin_tenant_name', default='admin')
|
||||||
]
|
]
|
||||||
|
|
||||||
type_dirs_opts = [cfg.StrOpt(x) for x in DATA_TYPES]
|
type_dirs_opts = [cfg.StrOpt(x) for x in DATA_TYPES]
|
||||||
|
@ -13,9 +13,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
import flask
|
import flask
|
||||||
from api.v1 import v1_api
|
from api.v1 import v1_api
|
||||||
|
from keystoneclient.middleware import auth_token
|
||||||
|
|
||||||
|
|
||||||
def make_app():
|
def make_app(kwargs):
|
||||||
"""
|
"""
|
||||||
App builder (wsgi)
|
App builder (wsgi)
|
||||||
Entry point
|
Entry point
|
||||||
@ -23,4 +24,6 @@ def make_app():
|
|||||||
|
|
||||||
app = flask.Flask(__name__)
|
app = flask.Flask(__name__)
|
||||||
app.register_blueprint(v1_api, url_prefix='/v1')
|
app.register_blueprint(v1_api, url_prefix='/v1')
|
||||||
|
app.wsgi_app = auth_token.filter_factory(
|
||||||
|
app.config, **kwargs)(app.wsgi_app)
|
||||||
return app
|
return app
|
||||||
|
@ -9,3 +9,4 @@ PyYAML
|
|||||||
iso8601>=0.1.4
|
iso8601>=0.1.4
|
||||||
kombu>=2.4.8
|
kombu>=2.4.8
|
||||||
Babel>=1.3
|
Babel>=1.3
|
||||||
|
python-keystoneclient>=0.2.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user