Skip to content

Commit

Permalink
chore: Provided more information and changed the naming of things
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Lanser <[email protected]>
  • Loading branch information
Tommylans committed Nov 18, 2024
1 parent 76adab5 commit 726fd27
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/core/src/resolveTrustChains/resolveTrustChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ type Options = {
type TrustChain = {
chain: Awaited<ReturnType<typeof fetchEntityStatementChain>>
// TODO: Not sure if this needs to be the entity configuration with all the policies applied
entityConfiguration: Awaited<ReturnType<typeof fetchEntityConfiguration>>
leafEntityConfiguration: Awaited<ReturnType<typeof fetchEntityConfiguration>>
trustAnchorEntityConfiguration: Awaited<ReturnType<typeof fetchEntityConfiguration>>
}

// TODO: Apply the policies
Expand Down Expand Up @@ -68,9 +69,14 @@ export const resolveTrustChains = async (options: Options): Promise<Array<TrustC
if (!leafEntityConfiguration)
throw new OpenIdFederationError(ErrorCode.Validation, 'No leaf entity configuration found')

const trustAnchorEntityConfiguration = entityConfigurationChain[entityConfigurationChain.length - 1]
if (!trustAnchorEntityConfiguration)
throw new OpenIdFederationError(ErrorCode.Validation, 'No trust anchor entity configuration found')

trustChains.push({
chain: entityStatementChain,
entityConfiguration: leafEntityConfiguration,
trustAnchorEntityConfiguration,
leafEntityConfiguration,
})
}

Expand Down

0 comments on commit 726fd27

Please sign in to comment.