Skip to content

Commit

Permalink
Amke TrustChain dumpable. That is prepared for
Browse files Browse the repository at this point in the history
persistent storage.
  • Loading branch information
rohe committed Mar 19, 2024
1 parent a7829ab commit fc236ab
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
17 changes: 14 additions & 3 deletions src/fedservice/entity_statement/statement.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
import logging
from typing import List
from typing import Optional

from cryptojwt import KeyJar
from cryptojwt.jwt import utc_time_sans_frac
from idpyoidc.impexp import ImpExp

__author__ = 'roland'

logger = logging.getLogger(__name__)


class TrustChain(object):
class TrustChain(ImpExp):
"""
Class in which to store the parsed result from applying metadata policies on a
metadata statement.
"""

parameter = {
"anchor": "",
"chain": [],
"combined_policy": {},
"err": {},
"exp": 0,
"iss_path": [],
"metadata": {},
"verified_chain": []
}

def __init__(self,
exp: int = 0,
verified_chain: Optional[list] = None):
"""
:param exp: Expiration time
"""
ImpExp.__init__(self)
self.anchor = ""
self.iss_path = []
self.err = {}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_12_explicit_registration_oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def create_endpoint(self):
"session_params": SESSION_PARAMS,
"endpoint": _op_endpoints
}
},
}
}
}
)
Expand Down
7 changes: 4 additions & 3 deletions tests/test_60_automatic_registration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os

from fedservice.appserver import ServerEntity
import pytest
import responses
from idpyoidc.client.defaults import DEFAULT_KEY_DEFS
Expand All @@ -9,9 +10,9 @@

from fedservice.defaults import DEFAULT_OIDC_FED_SERVICES
from fedservice.defaults import LEAF_ENDPOINTS
from fedservice.op import ServerEntity
from fedservice.op.authorization import Authorization
from fedservice.op.registration import Registration
# from fedservice.op import ServerEntity
# from fedservice.op.authorization import Authorization
# from fedservice.op.registration import Registration
from fedservice.appclient import ClientEntity
from fedservice.utils import make_federation_combo
from fedservice.utils import make_federation_entity
Expand Down

0 comments on commit fc236ab

Please sign in to comment.