Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: upload/add capability root validation #136

Merged
merged 1 commit into from
Nov 4, 2022
Merged

Conversation

alanshaw
Copy link
Member

@alanshaw alanshaw commented Nov 4, 2022

@Gozala should root be the root CID of the data, not a CAR CID? This is how it's implemented AFAIK. Or were you thinking it was the CID of the CAR that has the root data CID?

This PR switches root to allow any CID, not just a CAR CID.

Also, for a separate PR, maybe neither of these fields should be optional. Like, an "upload" should always have a data root CID and be present in at least 1 shard?

Copy link
Contributor

@ice-breaker-tg ice-breaker-tg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

We should also look into extending the array (and maybe some other validators) to have minimum length, etc?

Something like, in the todo app example, could be like "item name" as an nb, and needs to be
string.minimumLength(4);

Somewhat unrelated, but just should maybe think about it

@Gozala Gozala merged commit aae5b66 into main Nov 4, 2022
@Gozala Gozala deleted the fix/upload-add-root branch November 4, 2022 17:02
@Gozala
Copy link
Contributor

Gozala commented Nov 4, 2022

@Gozala should root be the root CID of the data, not a CAR CID?

Correct! Thanks for catching and fixing

alanshaw pushed a commit that referenced this pull request Nov 4, 2022
🤖 I have created a release *beep* *boop*
---


##
[4.0.2](access-v4.0.1...access-v4.0.2)
(2022-11-04)


### Bug Fixes

* upload/add capability root validation
([#136](#136))
([aae5b66](aae5b66))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
@Gozala
Copy link
Contributor

Gozala commented Nov 4, 2022

Also, for a separate PR, maybe neither of these fields should be optional. Like, an "upload" should always have a data root CID and be present in at least 1 shard?

making root required sounds good! It was only optional because of some bug in ucanto which has been fixed.

As of shards I’m hesitant it’s really just a hint and there’s no guarantee about the accuracy. I would say let’s keep it optional at least until we have some validation in place that would reject operation when root isn’t in the shard.

As a side it may be a good idea to have separate field for the root shard so we won’t have to check every single one

@heyjay44 heyjay44 mentioned this pull request Jan 4, 2023
95 tasks
gobengo pushed a commit that referenced this pull request Apr 11, 2023
gobengo pushed a commit that referenced this pull request Apr 11, 2023
🤖 I have created a release *beep* *boop*
---


##
[4.0.2](access-v4.0.1...access-v4.0.2)
(2022-11-04)


### Bug Fixes

* upload/add capability root validation
([#136](#136))
([9267885](9267885))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Peeja referenced this pull request in storacha/upload-service Jan 17, 2025
"Headless" UI React components

`react-{keyring|uploader|uploads-list}` now all provide "headless" UI
components modeled after https://headlessui.com/

The Big Idea with these is that they provide functionality and look like
regular UI components but don't force developers into any particular
markup or styling choices. They're very useful "lego" building blocks
that work together to encapsulate the details of interacting with our
services and let developer focus on building UI however they prefer to
do so. Properties like `className` are passed along to the underlying
component.

Co-authored-by: Alan Shaw <[email protected]>
Co-authored-by: Yusef Napora <[email protected]>
Co-authored-by: Nathan Vander Wilt <[email protected]>
Peeja referenced this pull request in storacha/upload-service Jan 17, 2025
This just extends #136 to add the new components to the markdown docs in
the `docs/` dir. I pretty much just copied over the doc comments, so
nothing really ground breaking here :)

Co-authored-by: Alan Shaw <[email protected]>
Co-authored-by: Travis Vachon <[email protected]>
Co-authored-by: Nathan Vander Wilt <[email protected]>
Peeja referenced this pull request in storacha/upload-service Jan 17, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.1.0](storacha/w3ui@react-keyring-v2.0.1...react-keyring-v2.1.0)
(2023-02-03)


### Features

* "Headless" UI components
([#136](storacha/w3ui#136))
([46583e0](storacha/w3ui@46583e0))
* delegate access to spaces
([storacha#293](storacha/w3ui#293))
([441d757](storacha/w3ui@441d757))
* support `as` prop in uploader component
([storacha#236](storacha/w3ui#236))
([c802e99](storacha/w3ui@c802e99)),
closes [storacha#235](storacha/w3ui#235)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Travis Vachon <[email protected]>
Co-authored-by: Travis Vachon <[email protected]>
Peeja referenced this pull request in storacha/upload-service Jan 17, 2025
🤖 I have created a release *beep* *boop*
---


##
[3.0.0](storacha/w3ui@react-keyring-v2.1.0...react-keyring-v3.0.0)
(2023-02-06)


### ⚠ BREAKING CHANGES

* no breaking changes, but a major version bump because I made an error operating release-please

### Features

* "Headless" UI components
([#136](storacha/w3ui#136))
([46583e0](storacha/w3ui@46583e0))
* delegate access to spaces
([storacha#293](storacha/w3ui#293))
([441d757](storacha/w3ui@441d757))
* import a space into w3console
([storacha#309](storacha/w3ui#309))
([a69a95b](storacha/w3ui@a69a95b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Travis Vachon <[email protected]>
Peeja referenced this pull request in storacha/upload-service Jan 17, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.1.0](storacha/w3ui@react-uploads-list-v2.0.1...react-uploads-list-v2.1.0)
(2023-02-06)


### Features

* "Headless" UI components
([#136](storacha/w3ui#136))
([46583e0](storacha/w3ui@46583e0)

### Bug Fixes

* load first page of uploads list in provider
([storacha#288](storacha/w3ui#288))
([6778d6c](storacha/w3ui@6778d6c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Travis Vachon <[email protected]>
Peeja referenced this pull request in storacha/upload-service Jan 17, 2025
🤖 I have created a release *beep* *boop*
---


##
[3.1.0](storacha/w3ui@react-uploader-v3.0.1...react-uploader-v3.1.0)
(2023-02-06)


### Features

* "Headless" UI components
([#136](storacha/w3ui#136))
([46583e0](storacha/w3ui@46583e0))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Travis Vachon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants