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

Future-proof CredentialManager API, make non-essential args kw-only #230

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions datalad_next/credman/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(self, cfg=None):

# main API
#
def get(self, name=None, _prompt=None, _type_hint=None, **kwargs):
def get(self, name=None, *, _prompt=None, _type_hint=None, **kwargs):
"""Get properties and secret of a credential.

This is a read-only method that never modifies information stored
Expand Down Expand Up @@ -237,6 +237,7 @@ def get(self, name=None, _prompt=None, _type_hint=None, **kwargs):

def set(self,
name,
*,
_lastused=False,
_suggested_name=None,
_context=None,
Expand Down Expand Up @@ -415,7 +416,7 @@ def set(self,
updated['secret'] = cred['secret']
return updated

def remove(self, name, type_hint=None):
def remove(self, name, *, type_hint=None):
"""Remove a credential, including all properties and secret

Presently, all supported backends require the specification of
Expand Down Expand Up @@ -516,7 +517,7 @@ def query_(self, **kwargs):
else:
continue

def query(self, _sortby=None, _reverse=True, **kwargs):
def query(self, *, _sortby=None, _reverse=True, **kwargs):
"""Query for all (matching) credentials, sorted by a property

This method is a companion of ``query_()``, and the same limitations
Expand Down