Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CyonAlexRDX committed Jan 14, 2025
1 parent 1194bb5 commit 274b333
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions crates/system/os/factors/src/sargon_os_apply_shield.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ impl OsShieldApplying for SargonOS {
let security_structure_of_factor_instances =
security_structures_of_factor_instances
.shift_remove(&entity_address)
.unwrap();
.expect(
"Should have a security structure for each entity",
);

let mut entity = self.entity_by_address(entity_address)?;
entity.set_provisional(
Expand Down Expand Up @@ -184,7 +186,7 @@ impl OsShieldApplying for SargonOS {
let key_derivation_interactors = self.keys_derivation_interactor();

// We only consume ROLA factors for:
// * Unsecured entities (because they do not yet have nay ROLA key)
// * Unsecured entities (because they do not yet have any ROLA key)
// * Securified entities where the ROLA key's FactorSource does not match the one of the shield
let mut existing_rola_key_for_entities = IndexMap::<
AddressOfAccountOrPersona,
Expand Down
6 changes: 3 additions & 3 deletions crates/system/os/factors/src/sargon_os_security_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub trait OsSecurityStructuresQuerying {
&self,
) -> Result<SecurityStructuresOfFactorSourceIDs>;

fn security_structure_of_factor_source_ids_from_security_structure_id(
fn security_structure_of_factor_source_ids_by_security_structure_id(
&self,
shield_id: SecurityStructureID,
) -> Result<SecurityStructureOfFactorSourceIDs>;
Expand All @@ -20,7 +20,7 @@ pub trait OsSecurityStructuresQuerying {
shield_id: SecurityStructureID,
) -> Result<SecurityStructureOfFactorSources> {
let shield_id_level = self
.security_structure_of_factor_source_ids_from_security_structure_id(
.security_structure_of_factor_source_ids_by_security_structure_id(
shield_id,
)?;
self.security_structure_of_factor_sources_from_security_structure_of_factor_source_ids(&shield_id_level)

Check warning on line 26 in crates/system/os/factors/src/sargon_os_security_structures.rs

View check run for this annotation

Codecov / codecov/patch

crates/system/os/factors/src/sargon_os_security_structures.rs#L26

Added line #L26 was not covered by tests
Expand Down Expand Up @@ -84,7 +84,7 @@ impl OsSecurityStructuresQuerying for SargonOS {
})
}

fn security_structure_of_factor_source_ids_from_security_structure_id(
fn security_structure_of_factor_source_ids_by_security_structure_id(
&self,
shield_id: SecurityStructureID,
) -> Result<SecurityStructureOfFactorSourceIDs> {
Expand Down

0 comments on commit 274b333

Please sign in to comment.