Skip to content

Commit ff12bba

Browse files
authored
Merge pull request #240 from reef-technologies/ProviderToPublicApi
Encryption settings, types and providers are now part of the public API
2 parents afbe05a + 4cbb470 commit ff12bba

File tree

9 files changed

+58
-30
lines changed

9 files changed

+58
-30
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
* Make `B2Api.get_bucket_by_id` return populated bucket objects in v2
2020
* Add proper support of `recommended_part_size` and `absolute_minimum_part_size` in `AccountInfo`
2121
* Refactored `minimum_part_size` to `recommended_part_size` (tha value used stays the same)
22+
* Encryption settings, types and providers are now part of the public API
2223

2324
### Removed
2425
* Remove `Bucket.copy_file` and `Bucket.start_large_file`

b2sdk/sync/encryption_provider.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ def get_setting_for_upload(
3232
) -> Optional[EncryptionSetting]:
3333
"""
3434
Return an EncryptionSetting for uploading an object or None if server should decide.
35-
36-
WARNING: the signature of this method is not final yet and not part of the public interface
3735
"""
3836

3937
@abstractmethod
@@ -44,8 +42,6 @@ def get_source_setting_for_copy(
4442
) -> Optional[EncryptionSetting]:
4543
"""
4644
Return an EncryptionSetting for a source of copying an object or None if not required
47-
48-
WARNING: the signature of this method is not final yet and not part of the public interface
4945
"""
5046

5147
@abstractmethod
@@ -58,8 +54,6 @@ def get_destination_setting_for_copy(
5854
) -> Optional[EncryptionSetting]:
5955
"""
6056
Return an EncryptionSetting for a destination for copying an object or None if server should decide
61-
62-
WARNING: the signature of this method is not final yet and not part of the public interface
6357
"""
6458

6559
@abstractmethod
@@ -70,8 +64,6 @@ def get_setting_for_download(
7064
) -> Optional[EncryptionSetting]:
7165
"""
7266
Return an EncryptionSetting for downloading an object from, or None if not required
73-
74-
WARNING: the signature of this method is not final yet and not part of the public interface
7567
"""
7668

7769

@@ -101,8 +93,6 @@ class BasicSyncEncryptionSettingsProvider(AbstractSyncEncryptionSettingsProvider
10193
"""
10294
Basic encryption setting provider that supports exactly one encryption setting per bucket for reading
10395
and one encryption setting per bucket for writing
104-
105-
WARNING: This class can be used by B2CLI for SSE-B2, but it's still in development
10696
"""
10797

10898
def __init__(
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. _encryption_setting:
2+
3+
Encryption Settings
4+
===================
5+
6+
.. autoclass:: b2sdk.v1.EncryptionKey()
7+
:no-members:
8+
:special-members: __init__
9+
10+
11+
.. autoclass:: b2sdk.v1.EncryptionSetting()
12+
:no-members:
13+
:special-members: __init__, as_dict
14+
15+
16+
.. autoattribute:: b2sdk.v1.SSE_NONE
17+
18+
Commonly used "no encryption" setting
19+
20+
21+
.. autoattribute:: b2sdk.v1.SSE_B2_AES
22+
23+
Commonly used SSE-B2 setting
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _encryption_types:
22

3-
:mod:`b2sdk.encryption.types`
4-
=============================
3+
Encryption Types
4+
================
55

66
.. automodule:: b2sdk.encryption.types

doc/source/api/internal/encryption/setting.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

doc/source/api/internal/sync/encryption_provider.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

doc/source/api/sync.rst

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,14 @@ also uploaded a new version of f2.txt to bucket using B2 web.
189189
190190
191191
Handling encryption
192-
===================
192+
-------------------
193193
The `Synchronizer` object may need `EncryptionSetting` instances to perform downloads and copies. For this reason, the
194-
`sync_folder` method accepts an `EncryptionSettingsProvider`, see :ref:`server_side_encryption` for details.
194+
`sync_folder` method accepts an `EncryptionSettingsProvider`, see :ref:`server_side_encryption` for further explanation
195+
and :ref:`encryption_provider` for public API.
196+
197+
198+
Public API classes
199+
==================
195200

196201
.. autoclass:: b2sdk.v1.ScanPoliciesManager()
197202
:special-members: __init__
@@ -204,3 +209,22 @@ The `Synchronizer` object may need `EncryptionSetting` instances to perform down
204209
.. autoclass:: b2sdk.v1.SyncReport()
205210
:special-members: __init__
206211
:members:
212+
213+
214+
.. _encryption_provider:
215+
216+
Sync Encryption Settings Providers
217+
==================================
218+
219+
220+
.. autoclass:: b2sdk.v1.AbstractSyncEncryptionSettingsProvider()
221+
:members:
222+
223+
224+
.. autoclass:: b2sdk.v1.ServerDefaultSyncEncryptionSettingsProvider()
225+
:no-members:
226+
227+
228+
.. autoclass:: b2sdk.v1.BasicSyncEncryptionSettingsProvider()
229+
:special-members: __init__
230+
:no-members:

doc/source/api_reference.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Public API
3333
api/transfer/emerge/write_intent
3434
api/transfer/outbound/outbound_source
3535
api/download_dest
36+
api/encryption/setting
37+
api/encryption/types
3638

3739
.. _api_internal:
3840

@@ -62,9 +64,6 @@ Internal API
6264
api/internal/sync/policy_manager
6365
api/internal/sync/scan_policies
6466
api/internal/sync/sync
65-
api/internal/sync/encryption_provider
66-
api/internal/encryption/setting
67-
api/internal/encryption/types
6867
api/internal/transfer/inbound/downloader/abstract
6968
api/internal/transfer/inbound/downloader/parallel
7069
api/internal/transfer/inbound/downloader/range

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@
104104
extras_require={
105105
'doc':
106106
[
107-
'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'sphinxcontrib-plantuml',
107+
'sphinx<4.0', # sphinx>=4.0 doesn't support Python 3.5
108+
'sphinx-autobuild',
109+
'sphinx_rtd_theme',
110+
'sphinxcontrib-plantuml',
108111
'sadisplay'
109112
],
110113
},

0 commit comments

Comments
 (0)