Feature: Admin PKI fields (#619)

* Add admin PKI fields

* Renaming state ref

* WIP: Refactoring

* Refactoring Security Config

* Ensure admin keys have been set before allowing managed mode
This commit is contained in:
philon-
2025-05-16 10:24:41 -04:00
committed by GitHub
parent 513a285fee
commit 1274584497
5 changed files with 257 additions and 105 deletions
@@ -7,10 +7,6 @@ export function securityReducer(
switch (action.type) {
case "SET_PRIVATE_KEY":
return { ...state, privateKey: action.payload };
case "TOGGLE_PRIVATE_KEY_VISIBILITY":
return { ...state, privateKeyVisible: !state.privateKeyVisible };
case "TOGGLE_ADMIN_KEY_VISIBILITY":
return { ...state, adminKeyVisible: !state.adminKeyVisible };
case "SET_PRIVATE_KEY_BIT_COUNT":
return { ...state, privateKeyBitCount: action.payload };
case "SET_PUBLIC_KEY":
@@ -26,11 +22,8 @@ export function securityReducer(
publicKey: action.payload.publicKey,
privateKeyDialogOpen: false,
};
case "REGENERATE_ADMIN_KEY":
return {
...state,
adminKey: action.payload.adminKey,
};
case "SET_TOGGLE":
return { ...state, [action.field]: action.payload };
default:
return state;
}