aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/state_impl/concrete_state.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/proxy/state_impl/concrete_state.py')
-rw-r--r--src/hydrilla/proxy/state_impl/concrete_state.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/hydrilla/proxy/state_impl/concrete_state.py b/src/hydrilla/proxy/state_impl/concrete_state.py
index 4781baa..8bd25a9 100644
--- a/src/hydrilla/proxy/state_impl/concrete_state.py
+++ b/src/hydrilla/proxy/state_impl/concrete_state.py
@@ -158,12 +158,14 @@ class ConcreteHaketiloState(base.HaketiloStateWithFields):
_operations.pull_missing_files(cursor)
def rebuild_structures(self) -> None:
- with self.cursor(transaction=True) as cursor:
+ with self.cursor() as cursor:
cursor.execute(
'''
SELECT
- p.payload_id, p.pattern, p.eval_allowed,
- p.cors_bypass_allowed,
+ p.payload_id,
+ p.pattern,
+ p.eval_allowed,
+ p.cors_bypass_allowed,
ms.enabled,
i.identifier
FROM
@@ -175,7 +177,7 @@ class ConcreteHaketiloState(base.HaketiloStateWithFields):
'''
)
- rows = cursor.fetchall()
+ rows = cursor.fetchall()
new_policy_tree = base.PolicyTree()
@@ -214,12 +216,13 @@ class ConcreteHaketiloState(base.HaketiloStateWithFields):
pattern_path_segments = parsed_pattern.path_segments
payload_data = st.PayloadData(
- payload_ref = payload_ref,
+ ref = payload_ref,
explicitly_enabled = enabled_status == 'E',
unique_token = token,
pattern_path_segments = pattern_path_segments,
eval_allowed = eval_allowed,
- cors_bypass_allowed = cors_bypass_allowed
+ cors_bypass_allowed = cors_bypass_allowed,
+ global_secret = self.secret
)
new_payloads_data[payload_ref] = payload_data
@@ -245,8 +248,11 @@ class ConcreteHaketiloState(base.HaketiloStateWithFields):
def resource_version_store(self) -> st.ResourceVersionStore:
return items.ConcreteResourceVersionStore(self)
- def get_payload(self, payload_id: str) -> st.PayloadRef:
- raise NotImplementedError()
+ def payload_store(self) -> st.PayloadStore:
+ return payloads.ConcretePayloadStore(self)
+
+ def get_secret(self) -> bytes:
+ return self.secret
def get_settings(self) -> st.HaketiloGlobalSettings:
return st.HaketiloGlobalSettings(