Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/tdf3/src/tdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,12 @@
for (const kao of keyAccess) {
const disjunction = splitPotentials[kao.sid ?? ''];
if (kao.url in disjunction) {
// TODO(DSPX-3454): Implement fallback to no split ids when repetition is detected.

Check warning on line 729 in lib/tdf3/src/tdf.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=opentdf_client-web&issues=AZ7xMlUBWPN9veXDbR00&open=AZ7xMlUBWPN9veXDbR00&pullRequest=952
Comment thread
davidaronhopper-dev marked this conversation as resolved.
Resolved
// Repetition occurs when multiple KAS keys share the same URL within a split.
// A proper fix would handle this by deduplicating or selecting the appropriate key.
throw new InvalidFileError(
`TODO: Fallback to no split ids. Repetition found for [${kao.url}] on split [${kao.sid}]`
`Unable to decrypt: Multiple keys detected for Key Access Server [${kao.url}]. ` +
`Please contact your administrator.`
);
}
if (allowed(kao)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/mocha/unit/tdf.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ describe('splitLookupTableFactory', () => {

expect(() => TDF.splitLookupTableFactory(keyAccess, allowedKases)).to.throw(
InvalidFileError,
'TODO: Fallback to no split ids. Repetition found for [https://kas1] on split [split1]'
'Unable to decrypt: Multiple keys detected for Key Access Server [https://kas1]. Please contact your administrator.'
);
});

Expand Down
Loading