crypto: add colon seperator for fingerprint
This commit is contained in:
parent
c00e01626e
commit
169475ab39
|
@ -56,7 +56,9 @@ class CertificateKeyPair(CreatedUpdatedModel):
|
|||
@property
|
||||
def fingerprint(self) -> str:
|
||||
"""Get SHA256 Fingerprint of certificate_data"""
|
||||
return hexlify(self.certificate.fingerprint(hashes.SHA256())).decode("utf-8")
|
||||
return hexlify(self.certificate.fingerprint(hashes.SHA256()), ":").decode(
|
||||
"utf-8"
|
||||
)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"Certificate-Key Pair {self.name} {self.fingerprint}"
|
||||
|
|
|
@ -23,4 +23,4 @@ def get_client_ip(request: Optional[HttpRequest]) -> Optional[str]:
|
|||
Returns none if no IP Could be found"""
|
||||
if request:
|
||||
return _get_client_ip_from_meta(request.META)
|
||||
return ""
|
||||
return None
|
||||
|
|
|
@ -14,7 +14,6 @@ def invalidate_policy_cache(sender, instance, **_):
|
|||
from passbook.policies.models import Policy, PolicyBinding
|
||||
|
||||
if isinstance(instance, Policy):
|
||||
LOGGER.debug("Invalidating policy cache", policy=instance)
|
||||
total = 0
|
||||
for binding in PolicyBinding.objects.filter(policy=instance):
|
||||
prefix = (
|
||||
|
@ -23,4 +22,4 @@ def invalidate_policy_cache(sender, instance, **_):
|
|||
keys = cache.keys(prefix)
|
||||
total += len(keys)
|
||||
cache.delete_many(keys)
|
||||
LOGGER.debug("Deleted keys", len=total)
|
||||
LOGGER.debug("Invalidating policy cache", policy=instance, keys=total)
|
||||
|
|
|
@ -9,7 +9,7 @@ from passbook.policies.expression.models import ExpressionPolicy
|
|||
from passbook.policies.models import Policy, PolicyBinding, PolicyBindingModel
|
||||
|
||||
|
||||
class PolicyTestEngine(TestCase):
|
||||
class TestPolicyEngine(TestCase):
|
||||
"""PolicyEngine tests"""
|
||||
|
||||
def setUp(self):
|
Reference in a new issue