feat(core): add support for combo security #1416#1417
Conversation
3cb531e to
a3cf324
Compare
bfd7a91 to
ebabb88
Compare
|
I am just adding this lingk |
Sorry, but I don't get your point. Are you referring to this statement?
If that's so, I'm ok to return all the schemes referred in the oneOf field. |
|
I believe we could also handle the case of oneOf , by passing a structure of resolved scheme downward. At the end of the day, the binding need to be made aware of the oneOf security scheme and choose one of them. |
9efc831 to
6fc35a3
Compare
…web#1416 This commit refines the implementation of combo security schemes by introducing explicit AllOfSecurityScheme and OneOfSecurityScheme types. The getSecuritySchemes method in ConsumedThing has been updated to recursively resolve these schemes, and the tests have been expanded to cover nested allOf and oneOf scenarios.
6fc35a3 to
0bc5c88
Compare
| oneOf, | ||
| }; | ||
| } | ||
| return undefined; // not supported , but handled gracefully |
There was a problem hiding this comment.
@danielpeintner, what do you think here? This is sort of a bad erroneous condition. It means that initial validation of the consumed thing didn't spot an unsupported security scheme, and we are returning an undefined that will result in a final sparse scs array (with undefined elements).
I believe it should be better to throw ...
There was a problem hiding this comment.
Agree with @relu91 that throwing in such a case is the better solution
There was a problem hiding this comment.
Instead of returning undefined, we could returning null. This would cause the scheme to be simply ignored.
In both cases this might cause unpredicable results, expecitally in the credentials settings ( could be ignored or by-passed) so I am i favor of throwing an exception too. ( defensive rather than accommodating )
I would always point to published standards as that URL is more volatile: https://www.w3.org/TR/2023/REC-wot-thing-description11-20231205/#combosecurityscheme |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1417 +/- ##
==========================================
- Coverage 77.58% 77.54% -0.04%
==========================================
Files 79 79
Lines 15331 15381 +50
Branches 1445 1452 +7
==========================================
+ Hits 11894 11927 +33
- Misses 3414 3432 +18
+ Partials 23 22 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…b#1416 This commit introduces validation for combo security schemes to ensure that a combo scheme contains either 'allOf' or 'oneOf', but not both. - Throws an error if a combo scheme is invalid. - Adds unit tests to verify the new validation logic.
9ffcaa2 to
c9fa3db
Compare
|
Thank you, @erossignon 👍 |
No description provided.