Skip to content

Commit

Permalink
fix: trust chain storage and example data
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Feb 25, 2022
1 parent 91d49d3 commit b018cec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/federation_authority/dumps/example.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spid_cie_oidc/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.0"
__version__ = "0.3.1"
7 changes: 3 additions & 4 deletions spid_cie_oidc/entity/trust_chain_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ def get_or_create_trust_chain(
statement = ta_conf.payload,
jwt = ta_conf.jwt
)

fetched_trust_anchor = fetched_trust_anchor.first()
else:
fetched_trust_anchor = fetched_trust_anchor.first()
ta_conf = fetched_trust_anchor.get_entity_configuration_as_obj()

tc = TrustChain.objects.filter(
sub = subject,
trust_anchor__sub = fetched_trust_anchor.sub
trust_anchor__sub = trust_anchor
).first()

if not tc or not tc.is_active or tc.is_expired:
Expand All @@ -177,7 +177,7 @@ def get_or_create_trust_chain(
tc = TrustChain.objects.filter(
sub = subject,
type = metadata_type,
trust_anchor__sub = fetched_trust_anchor.sub
trust_anchor__sub = trust_anchor
)

data = dict(
Expand All @@ -188,7 +188,6 @@ def get_or_create_trust_chain(
status = 'valid',
is_active = True
)

if tc:
tc.update(**data)
else:
Expand Down

0 comments on commit b018cec

Please sign in to comment.