Skip to content

Commit

Permalink
fix: extract common logic (Yelp#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
XIANJUN ZHU authored and justineyster committed Sep 9, 2020
1 parent f6779c5 commit 996ba02
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion detect_secrets/plugins/ibm_cos_hmac.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ def verify_ibm_cos_hmac_credentials(
access_key,
secret_key,
host='s3.us.cloud-object-storage.appdomain.cloud',
):
response = query_ibm_cos_hmac(access_key, secret_key, host)
return response.status_code == 200


def query_ibm_cos_hmac(
access_key,
secret_key,
host='s3.us.cloud-object-storage.appdomain.cloud',
):
# Sample code referenced from link below
# https://cloud.ibm.com/docs/services/cloud-object-storage/api-reference?topic=cloud-object-storage-hmac-signature # noqa: E501
Expand Down Expand Up @@ -149,4 +158,4 @@ def verify_ibm_cos_hmac_credentials(

request = requests.get(request_url, headers=headers)

return request.status_code == 200
return request

0 comments on commit 996ba02

Please sign in to comment.