-
Notifications
You must be signed in to change notification settings - Fork 17
Changes as an effect of changing persistent storage model. #80
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #80 +/- ##
==========================================
- Coverage 78.39% 77.16% -1.23%
==========================================
Files 41 41
Lines 4193 4283 +90
Branches 808 822 +14
==========================================
+ Hits 3287 3305 +18
- Misses 648 716 +68
- Partials 258 262 +4
Continue to review full report at Codecov.
|
pyproject.toml
Outdated
@@ -22,7 +22,7 @@ exclude_lines = [ | |||
|
|||
[tool.poetry] | |||
name = "cryptojwt" | |||
version = "1.4.1" | |||
version = "1.4.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a minor version bump, 1.5.0 perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
src/cryptojwt/key_bundle.py
Outdated
@@ -751,7 +751,7 @@ def difference(self, bundle): | |||
|
|||
return [k for k in self._keys if k not in bundle] | |||
|
|||
def dump(self): | |||
def dump(self, cutoff: Optional[list] = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat confusing attribute name (at least for me). Perhaps excluded_attrs
is better?
The type should be Optional[List[str]]
I think (I assume attribute names are strings)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Horticultural term :-)
Imaging that you are dealing with something that looks like a tree and there are branches you don't want to be included so you cut them off.
Yes, attribute names are strings.
src/cryptojwt/key_issuer.py
Outdated
""" | ||
Returns the content as a dictionary. | ||
|
||
:param exclude: Issuer that should not be include in the dump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exclude_issuer
(perhaps make itexclude_issuers
and aOptional[List[str]]
to allow multiple issuers to be excluded?)exclude_attrs
(orexclude_attributes
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK then.
@@ -32,7 +32,6 @@ def __init__( | |||
remove_after=3600, | |||
httpc=None, | |||
httpc_params=None, | |||
storage=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we assume that no one (excluding closing family) has used the storage class yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, perhaps we should use plural for some kwargs (see comments)
src/cryptojwt/key_bundle.py
Outdated
@@ -751,7 +752,7 @@ def difference(self, bundle): | |||
|
|||
return [k for k in self._keys if k not in bundle] | |||
|
|||
def dump(self): | |||
def dump(self, exclude_attribute: Optional[List[str]] = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exclude_attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
src/cryptojwt/key_issuer.py
Outdated
@@ -350,16 +352,17 @@ def __len__(self): | |||
nr += len(kb) | |||
return nr | |||
|
|||
def dump(self, exclude=None): | |||
def dump(self, exclude_attribute: Optional[List[str]] = None) -> dict: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exclude_attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
src/cryptojwt/key_jar.py
Outdated
""" | ||
Returns the key jar content as dictionary | ||
|
||
:param exclude_issuer: A list of issuers you don't want included. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exclude_issuers
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Instead of having class instances doing the storage we instead want to put the burden on the frontend.
This will among other things decrease the number of DB calls significantly.
The frontend will have the methods dump, flush and load to store, clear and retrieve state.