Skip to content

Commit

Permalink
Ensure that 'set_properties_from_env' is part of every keyring's init…
Browse files Browse the repository at this point in the history
…ialization. Fixes #495.
  • Loading branch information
jaraco committed Mar 6, 2021
1 parent 9a73294 commit bab15d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v23.0.0
-------

* Backends now all invoke ``set_properties_from_env`` on
self in the initializer. Derived backends should be sure
to invoke ``super().__init__()``.

v22.4.0
-------

Expand Down
3 changes: 3 additions & 0 deletions keyring/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class KeyringBackend(metaclass=KeyringBackendMeta):
this interface.
"""

def __init__(self):
self.set_properties_from_env()

# @abc.abstractproperty
def priority(cls):
"""
Expand Down
1 change: 0 additions & 1 deletion keyring/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def set_keyring(keyring):
if not isinstance(keyring, backend.KeyringBackend):
raise TypeError("The keyring must be a subclass of KeyringBackend")
_keyring_backend = keyring
keyring.set_properties_from_env()


def get_keyring() -> backend.KeyringBackend:
Expand Down

0 comments on commit bab15d0

Please sign in to comment.