Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 6 additions & 1 deletion lib/tdf3/src/tdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,13 @@
for (const kao of keyAccess) {
const disjunction = splitPotentials[kao.sid ?? ''];
if (kao.url in disjunction) {
// TODO(DSPX-3454): Handle duplicate KAS URLs with different KIDs.

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
// Each KAO contains a KID - the function should be updated to use this
// information to differentiate between keys from the same KAS.
// Cross-SDK validation needed via xtest.
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