Skip to content

Commit

Permalink
Merge pull request #27 from oesteban/master
Browse files Browse the repository at this point in the history
[ENH] Reset old default token
  • Loading branch information
oesteban authored Jun 5, 2017
2 parents b97c6fa + d6264b9 commit 80d5137
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
dependencies:
override:
- pip install docker-compose
- pip install docker-compose
- pip install requests

machine:
environment:
SECRET_KEY: CI
MONGODB_HOST: mongodb
MONGODB_PORT: 27017
API_TOKEN: afaketoken
API_TOKEN: <secret_token>
API_URL: "http://localhost/docs/api"
services:
- docker
Expand Down
2 changes: 1 addition & 1 deletion dockereve-master/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MONGODB_HOST=mongodb
MONGODB_PORT=27017

API_TOKEN=afaketoken
API_TOKEN=<secret_token>
API_URL=http://localhost/docs/api
4 changes: 3 additions & 1 deletion dockereve-master/eve-app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
from eve_swagger import swagger
from settings import settings

API_TOKEN = os.environ.get("API_TOKEN")

class TokenAuth(TokenAuth):
def check_auth(self, token, allowed_roles, resource, method):
return token == os.environ.get("API_TOKEN", '<secret_token>')
return token == API_TOKEN

app = Eve(settings=settings, auth=TokenAuth)
app.register_blueprint(swagger, url_prefix='/docs/api')
Expand Down

0 comments on commit 80d5137

Please sign in to comment.