Skip to content

Commit

Permalink
Seeds: allow to skip verify
Browse files Browse the repository at this point in the history
  • Loading branch information
LifeDJIK committed Sep 14, 2023
1 parent 24a931f commit a0d01d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dusty/tools/seeds/centry/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ def handle(self, config_seed_data):
}
if environ.get("token"):
headers["Authorization"] = f"bearer {environ.get('token')}"

try:
test_type = config_seed_data.split('_')[0]
except Exception as e:
log.exception(e)
return "Invalid seed data format"


seed_ssl_verify = environ.get("SEED_SSL_VERIFY", "").lower() in ["true", "yes"]
seed_url = f"{environ.get('galloper_url')}/api/v1/{TEST_MAPPING[test_type]}/dispatcher/" \
f"{environ.get('project_id')}/{config_seed_data}"
return get(seed_url, params={"type": "dusty"}, headers=headers).content
return get(seed_url, params={"type": "dusty"}, headers=headers, verify=seed_ssl_verify).content

@staticmethod
def get_name():
Expand Down
3 changes: 2 additions & 1 deletion dusty/tools/seeds/galloper/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def handle(self, config_seed_data):
headers["Authorization"] = f"bearer {environ.get('token')}"
seed_url = f"{environ.get('galloper_url')}/api/v1/tests/" \
f"{environ.get('project_id')}/security/{config_seed_data}"
return get(seed_url, params={"type": "dusty"}, headers=headers).content
seed_ssl_verify = environ.get("SEED_SSL_VERIFY", "").lower() in ["true", "yes"]
return get(seed_url, params={"type": "dusty"}, headers=headers, verify=seed_ssl_verify).content

@staticmethod
def get_name():
Expand Down

0 comments on commit a0d01d6

Please sign in to comment.