Compare commits
4 Commits
89522c0536
...
master
Author | SHA1 | Date | |
---|---|---|---|
c61e97a761 | |||
0b2cfbd760 | |||
35cce46eed | |||
4b264b22fd |
19
.drone.yml
19
.drone.yml
@ -28,6 +28,25 @@ steps:
|
|||||||
- find . -name "*.py" -exec python3 -m mccabe --min 3 '{}' + || if [ $? -eq 1 ]; then echo "you fail"; fi
|
- find . -name "*.py" -exec python3 -m mccabe --min 3 '{}' + || if [ $? -eq 1 ]; then echo "you fail"; fi
|
||||||
- bandit -r . + || if [ $? -eq 1 ]; then echo "you fail"; fi
|
- bandit -r . + || if [ $? -eq 1 ]; then echo "you fail"; fi
|
||||||
|
|
||||||
|
- name: unit_test
|
||||||
|
image: python:3.8
|
||||||
|
environment:
|
||||||
|
PRODUCER_REDIS: cache
|
||||||
|
commands:
|
||||||
|
- pip3 install --cache-dir='./.pipcache' -r requirements.txt
|
||||||
|
- pip3 install --cache-dir='./.pipcache' -r requirements_dev.txt
|
||||||
|
- pytest
|
||||||
|
|
||||||
|
- name: coverage
|
||||||
|
image: python:3.8
|
||||||
|
environment:
|
||||||
|
PRODUCER_REDIS: cache
|
||||||
|
commands:
|
||||||
|
- pip3 install --cache-dir='./.pipcache' -r requirements.txt
|
||||||
|
- pip3 install --cache-dir='./.pipcache' -r requirements_dev.txt
|
||||||
|
- coverage run -m pytest
|
||||||
|
- coverage report -m
|
||||||
|
|
||||||
- name: build-app
|
- name: build-app
|
||||||
image: banzaicloud/drone-kaniko
|
image: banzaicloud/drone-kaniko
|
||||||
settings:
|
settings:
|
||||||
|
@ -9,6 +9,14 @@ class SyncView(FlaskView):
|
|||||||
|
|
||||||
def post(self):
|
def post(self):
|
||||||
remote_uuid = request.json['uuid']
|
remote_uuid = request.json['uuid']
|
||||||
|
|
||||||
|
if 'ip' in request.json:
|
||||||
|
remote_ip = request.json['ip']
|
||||||
|
|
||||||
|
if request.remote_addr != remote_ip:
|
||||||
|
current_app.logger.debug(f"IP was overriden by the remote consumer {remote_ip} instead of {request.remote_addr}")
|
||||||
|
|
||||||
|
else:
|
||||||
remote_ip = request.remote_addr
|
remote_ip = request.remote_addr
|
||||||
|
|
||||||
cust_key = f"consumer_{remote_uuid}"
|
cust_key = f"consumer_{remote_uuid}"
|
||||||
|
Reference in New Issue
Block a user