Skip to content

Commit

Permalink
chore(cleversafe): verify requests by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Avantol13 committed Jan 5, 2024
1 parent 493f922 commit 44f2c92
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions fence/config-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,10 @@ GS_BUCKETS: {}
# bucket3:
# region: 'us-east-1'

# When using the Cleversafe storageclient, whether or not to send verify=true
# for requests
VERIFY_CLEVERSAFE_CERT: true

# Names of the S3 buckets to which data files can be uploaded. They should be
# configured in `S3_BUCKETS`.
ALLOWED_DATA_UPLOAD_BUCKETS: []
Expand Down
8 changes: 7 additions & 1 deletion fence/resources/storage/storageclient/cleversafe.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from .base import StorageClient, User, Bucket, handle_request
from .errors import RequestError, NotFoundError

from fence.config import config


class CleversafeClient(StorageClient):
"""
Expand Down Expand Up @@ -182,7 +184,11 @@ def _request(self, method, operation, payload=None, **kwargs):
)
url = base_url + "?" + urlencode(dict(**kwargs))
return requests.request(
method, url, auth=self._auth, data=payload, verify=False
method,
url,
auth=self._auth,
data=payload,
verify=config["VERIFY_CLEVERSAFE_CERT"],
) # self-signed certificate

@property
Expand Down

0 comments on commit 44f2c92

Please sign in to comment.