fission-codes / fission-server

Apache License 2.0
9 stars 0 forks source link

`/api/v0/capabilities` route #193

Closed matheus23 closed 11 months ago

matheus23 commented 11 months ago

Implements the GET /api/v0/capabilities route.

This allows you to get all UCANs that point to the provided DID (provided in the authorization UCAN as the capability/fetch capability resource) as the audience.

The UCAN server will do this caching anyways - and it's useful to give access to this data to the user, so e.g. you can log in to another device very easily, in case you're using a device-syncing passkey.

Closes #182 Closes #183

codecov[bot] commented 11 months ago

Codecov Report

Merging #193 (4ef878e) into main (bd21c05) will increase coverage by 0.19%. Report is 1 commits behind head on main. The diff coverage is 21.21%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/fission-codes/fission-server/pull/193/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/193?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 #193 +/- ## ========================================== + Coverage 20.89% 21.09% +0.19% ========================================== Files 55 58 +3 Lines 1991 2181 +190 Branches 1231 1353 +122 ========================================== + Hits 416 460 +44 - Misses 1029 1090 +61 - Partials 546 631 +85 ``` | [Files](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?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/auth.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL3JvdXRlcy9hdXRoLnJz) | `22.22% <ø> (ø)` | | | [fission-server/src/test\_utils/mod.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL3Rlc3RfdXRpbHMvbW9kLnJz) | `30.76% <ø> (ø)` | | | [fission-server/src/test\_utils/test\_context.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL3Rlc3RfdXRpbHMvdGVzdF9jb250ZXh0LnJz) | `32.07% <ø> (ø)` | | | [...ission-server/src/test\_utils/test\_ipfs\_database.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL3Rlc3RfdXRpbHMvdGVzdF9pcGZzX2RhdGFiYXNlLnJz) | `0.00% <ø> (ø)` | | | [fission-server/src/db/connection.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL2RiL2Nvbm5lY3Rpb24ucnM=) | `5.88% <0.00%> (ø)` | | | [fission-server/src/models/account.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL21vZGVscy9hY2NvdW50LnJz) | `43.63% <25.00%> (-1.47%)` | :arrow_down: | | [fission-server/src/router.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL3JvdXRlci5ycw==) | `17.14% <0.00%> (-2.22%)` | :arrow_down: | | [fission-core/src/capabilities/indexing.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1jb3JlL3NyYy9jYXBhYmlsaXRpZXMvaW5kZXhpbmcucnM=) | `68.75% <68.75%> (ø)` | | | [fission-server/src/routes/capability\_indexing.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?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% <26.66%> (ø)` | | | [fission-server/src/db/schema.rs](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes#diff-Zmlzc2lvbi1zZXJ2ZXIvc3JjL2RiL3NjaGVtYS5ycw==) | `12.50% <14.28%> (+0.96%)` | :arrow_up: | | ... and [3 more](https://app.codecov.io/gh/fission-codes/fission-server/pull/193?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fission-codes) | |