Sfoglia il codice sorgente

Merge pull request #5247 from ThomasWaldmann/blackwhite

use allow/deny list wording
TW 4 anni fa
parent
commit
82542f286c
3 ha cambiato i file con 9 aggiunte e 9 eliminazioni
  1. 7 7
      src/borg/archiver.py
  2. 1 1
      src/borg/helpers/msgpack.py
  3. 1 1
      src/borg/remote.py

+ 7 - 7
src/borg/archiver.py

@@ -4415,27 +4415,27 @@ class Archiver:
                 # make sure we only process like normal if the client is executing
                 # the same command as specified in the forced command, otherwise
                 # just skip this block and return the forced command (== result).
-                # client is allowed to specify the whitelisted options,
+                # client is allowed to specify the allowlisted options,
                 # everything else comes from the forced "borg serve" command (or the defaults).
-                # stuff from blacklist must never be used from the client.
-                blacklist = {
+                # stuff from denylist must never be used from the client.
+                denylist = {
                     'restrict_to_paths',
                     'restrict_to_repositories',
                     'append_only',
                     'storage_quota',
                     'umask',
                 }
-                whitelist = {
+                allowlist = {
                     'debug_topics',
                     'lock_wait',
                     'log_level',
                 }
                 not_present = object()
-                for attr_name in whitelist:
-                    assert attr_name not in blacklist, 'whitelist has blacklisted attribute name %s' % attr_name
+                for attr_name in allowlist:
+                    assert attr_name not in denylist, 'allowlist has denylisted attribute name %s' % attr_name
                     value = getattr(client_result, attr_name, not_present)
                     if value is not not_present:
-                        # note: it is not possible to specify a whitelisted option via a forced command,
+                        # note: it is not possible to specify a allowlisted option via a forced command,
                         # it always gets overridden by the value specified (or defaulted to) by the client commmand.
                         setattr(result, attr_name, value)
 

+ 1 - 1
src/borg/helpers/msgpack.py

@@ -183,7 +183,7 @@ def is_supported_msgpack():
     # DO NOT CHANGE OR REMOVE! See also requirements and comments in setup.py.
     import msgpack
     return (0, 5, 6) <= msgpack.version <= (1, 0, 0) and \
-           msgpack.version not in []  # < blacklist bad releases here
+           msgpack.version not in []  # < add bad releases here to deny list
 
 
 def get_limited_unpacker(kind):

+ 1 - 1
src/borg/remote.py

@@ -107,7 +107,7 @@ class UnexpectedRPCDataFormatFromServer(Error):
 # For the client the return of the negotiate method is either 2 if the server is in the version range [0.29.0, 1.0.x]
 # inclusive, or it is a dict which includes the server version.
 #
-# All method calls on the remote repository object must be whitelisted in RepositoryServer.rpc_methods and have api
+# All method calls on the remote repository object must be allowlisted in RepositoryServer.rpc_methods and have api
 # stubs in RemoteRepository. The @api decorator on these stubs is used to set server version requirements.
 #
 # Method parameters are identified only by name and never by position. Unknown parameters are ignored by the server side.