Wizard: Add FIPS state management infrastructure
- Add fips field to wizardState type with enabled boolean property - Add fips configuration to initialState with default value false - Add selectFips selector to access FIPS state from store - Add changeFips reducer action to update FIPS enabled state This provides the Redux state management foundation for FIPS mode configuration. UI components and wizard steps will be added separately.
This commit is contained in:
parent
3b8b2ad240
commit
acc79e149c
2 changed files with 31 additions and 1 deletions
|
|
@ -70,6 +70,7 @@ import {
|
|||
selectCustomRepositories,
|
||||
selectDistribution,
|
||||
selectFileSystemConfigurationType,
|
||||
selectFips,
|
||||
selectFirewall,
|
||||
selectFirstBootScript,
|
||||
selectGcpAccountType,
|
||||
|
|
@ -364,6 +365,9 @@ function commonRequestToState(
|
|||
disabled: request.customizations.firewall?.services?.disabled || [],
|
||||
},
|
||||
},
|
||||
fips: {
|
||||
enabled: request.customizations.fips?.enabled || false,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -631,7 +635,7 @@ const getCustomizations = (state: RootState, orgID: string): Customizations => {
|
|||
fdo: undefined,
|
||||
ignition: undefined,
|
||||
partitioning_mode: undefined,
|
||||
fips: undefined,
|
||||
fips: getFips(state),
|
||||
cacerts:
|
||||
satCert && selectRegistrationType(state) === 'register-satellite'
|
||||
? {
|
||||
|
|
@ -869,6 +873,18 @@ const getPayloadRepositories = (state: RootState) => {
|
|||
return payloadAndRecommendedRepositories;
|
||||
};
|
||||
|
||||
const getFips = (state: RootState) => {
|
||||
const fips = selectFips(state);
|
||||
|
||||
if (!fips.enabled) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
enabled: fips.enabled,
|
||||
};
|
||||
};
|
||||
|
||||
const getKernel = (state: RootState) => {
|
||||
const kernel = selectKernel(state);
|
||||
const kernelAppendString = selectKernel(state).append.join(' ');
|
||||
|
|
|
|||
|
|
@ -170,6 +170,9 @@ export type wizardState = {
|
|||
disabled: string[];
|
||||
};
|
||||
};
|
||||
fips: {
|
||||
enabled: boolean;
|
||||
};
|
||||
metadata?: {
|
||||
parent_id: string | null;
|
||||
exported_at: string;
|
||||
|
|
@ -270,6 +273,9 @@ export const initialState: wizardState = {
|
|||
disabled: [],
|
||||
},
|
||||
},
|
||||
fips: {
|
||||
enabled: false,
|
||||
},
|
||||
firstBoot: { script: '' },
|
||||
users: [],
|
||||
};
|
||||
|
|
@ -494,6 +500,10 @@ export const selectFirewall = (state: RootState) => {
|
|||
return state.wizard.firewall;
|
||||
};
|
||||
|
||||
export const selectFips = (state: RootState) => {
|
||||
return state.wizard.fips;
|
||||
};
|
||||
|
||||
export const wizardSlice = createSlice({
|
||||
name: 'wizard',
|
||||
initialState,
|
||||
|
|
@ -1131,6 +1141,9 @@ export const wizardSlice = createSlice({
|
|||
state.users[action.payload.index].groups.splice(groupIndex, 1);
|
||||
}
|
||||
},
|
||||
changeFips: (state, action: PayloadAction<boolean>) => {
|
||||
state.fips.enabled = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -1231,5 +1244,6 @@ export const {
|
|||
addUserGroupByIndex,
|
||||
removeUserGroupByIndex,
|
||||
changeRedHatRepositories,
|
||||
changeFips,
|
||||
} = wizardSlice.actions;
|
||||
export default wizardSlice.reducer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue