fission-codes / fission-server

Apache License 2.0
9 stars 0 forks source link

feat: Narrow down capability indexing #205

Closed matheus23 closed 9 months ago

matheus23 commented 9 months ago

This introduces some tests to models/capability_indexing.rs including a test that would've failed previously.

Previously we returned any UCANs that match up via issuer/audience, irrespective of whether they refer to each other in the prf array or whether they talk about the same capability.

Now, we make sure that they're talking about exactly the same resource (in the capability). This needs to be improved in the future to also check for e.g. the ucan:<...> scheme, unless UCAN 1.0 comes out first.

We don't actually make use of the prf array, anticipating its deprecation in UCAN 1.0.

codecov[bot] commented 9 months ago

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (e01425f) 19.64% compared to head (9ee179b) 19.78%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/fission-codes/fission-server/pull/205/graphs/tree.svg?width=650&height=150&src=pr&token=GO3TTZLDO0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes)](https://app.codecov.io/gh/fission-codes/fission-server/pull/205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes) ```diff @@ Coverage Diff @@ ## main #205 +/- ## ========================================== + Coverage 19.64% 19.78% +0.14% ========================================== Files 67 67 Lines 2718 2729 +11 Branches 1665 1675 +10 ========================================== + Hits 534 540 +6 Misses 1466 1466 - Partials 718 723 +5 ``` | [Files](https://app.codecov.io/gh/fission-codes/fission-server/pull/205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes) | Coverage Δ | | |---|---|---| | [fission-server/src/routes/capability\_indexing.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL3JvdXRlcy9jYXBhYmlsaXR5X2luZGV4aW5nLnJz) | `26.66% <ø> (ø)` | | | [fission-server/src/models/capability\_indexing.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL21vZGVscy9jYXBhYmlsaXR5X2luZGV4aW5nLnJz) | `28.28% <7.69%> (-1.27%)` | :arrow_down: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/fission-codes/fission-server/pull/205/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes)