Commit ba44e5a5 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Added X-Token auth to swagger.

parent 03d405b0
......@@ -41,13 +41,18 @@ CORS(app)
authorizations = {
'HTTP Basic': {
'type': 'basic'
},
'X-Token': {
'type': 'apiKey',
'in': 'header',
'name': 'X-Token'
}
}
api = Api(
app, version='1.0', title='nomad@FAIRDI API', authorizations=authorizations,
description='Official API for nomad@FAIRDI services.')
""" Provides the flask restful api instance """
""" Provides the flask restplust api instance """
@app.errorhandler(HTTPException)
......
......@@ -65,7 +65,7 @@ def test_other_user_auth(other_test_user):
class TestAuth:
def test_xtoken_auth(self, client, test_user, no_warn):
rv = client.get('/uploads/', headers={
'X-Token': test_user.email
'X-Token': test_user.email # the test users have their email as tokens for convinience
})
assert rv.status_code == 200
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment