Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need verify ssl with boto3 #74

Open
qxiddd opened this issue Sep 30, 2022 · 0 comments
Open

need verify ssl with boto3 #74

qxiddd opened this issue Sep 30, 2022 · 0 comments

Comments

@qxiddd
Copy link

qxiddd commented Sep 30, 2022

Hello!

I need ssl verification and option to set path to my selfsigned certificate when work with S3.

There's no support of parametres verify and use_ssl для boto3.resource (boto3 docs).

Can you add this support to your depot.io.boto3.S3Storage?

Something like this

class S3Storage:
     ...

     def __init__(self, access_key_id, secret_access_key, bucket=None, region_name=None,
                 policy=None, storage_class=None, endpoint_url=None, prefix='',
                 use_ssl=None, verify=None):
         ...
         kw = {}
         ...
         if use_ssl is not None:
             kw['use_ssl'] = use_ssl
         if verify is not None:
             kw['verify'] = verify
         self._s3 = self._conn.resource('s3', **kw)
         ...

Or even this (support of all S3 configuration parametres)

class S3Storage:
     ...

     def __init__(
        self,
        access_key_id,
        secret_access_key,
        bucket=None,
        policy=None,
        storage_class=None,
        prefix='',
        s3_params=None,
    ):
         ...
         s3_params = s3_params or {}
         self._s3 = self._conn.resource('s3', **s3_params)
         ...

so I can configure depot like this

depot.manager.DepotManager.configure(
    'default',
    {
        'depot.backend': 'depot.io.boto3.S3Storage',
        'depot.access_key_id': settings.depot_access_key_id,
        'depot.secret_access_key': settings.depot_secret_access_key,
        'depot.bucket': 'bububucket',
        'depot.policy': settings.depot_policy,

        'depot.s3_params': {
            'endpoint_url': settings.depot_endpoint_url,
            'use_ssl': True,
            'verify': 'certs.pem',
            'config': botocore.config.Config(
                retries={
                    "max_attempts": MAX_RETRIES,
                    "mode": "standard",
                },
                s3={
                    "addressing_style": 'virtual',
                },
            ),
        },
        'depot.prefix': 'default_prefix'
    },
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant