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

Add Baseclass for ClientDatabase #478

Closed
tpazderka opened this issue Feb 1, 2018 · 0 comments
Closed

Add Baseclass for ClientDatabase #478

tpazderka opened this issue Feb 1, 2018 · 0 comments
Assignees

Comments

@tpazderka
Copy link
Collaborator

tpazderka commented Feb 1, 2018

There is no BaseClass for implementation of custom client databases. We should create one that defines the basic expected API.

The class should probably reside in oic.utils.cdb and the basic API can be based on oic.utils.client_management.CDB object which can then inherit from the new class.

The basic expected API should be along these lines:

class BaseClientDatabase(object)
    def __init__(self)
    def get(self, item, default=None)
    def __getitem__(self, item)
    def __setitem__(self, item, value)
    def __delitem__(self, key)
    def __contains__(self, item)
    def keys(self)
    def items(self)
   def __len__(self)

The __init__ methods in providers can then warn if the cdb argument doesn't inherit from the new BaseClientDatabase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant