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: document GET /reframe?q= #326

Merged
merged 3 commits into from
Sep 30, 2022
Merged

fix: document GET /reframe?q= #326

merged 3 commits into from
Sep 30, 2022

Conversation

lidel
Copy link
Member

@lidel lidel commented Sep 29, 2022

This PR is a small fix that aligns Reframe specs with existing Implementation.

Percent-encoded DAG-JSON sent over ?q= is what Kubo 0.16.0-rc1 uses, and what is implemented in https://github.com/ipfs/go-delegated-routing v0.6.0.

I decided to add this to the spec, because it saves us time and does not block Kubo/Indexer work (we don't need to change the wire format).

It is a safe path: makes the spec both backward-compatible (with Kubo and go-delegated-routing) and forward-compatible (with proper CBOR support proposed in separate IPIP from #327).

cc @guseggert @petar @willscott

@lidel lidel self-assigned this Sep 29, 2022
Copy link
Contributor

@willscott willscott left a comment

Choose a reason for hiding this comment

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

can confirm that this appears to reflect what kubo is currently doing.

Copy link
Contributor

@Jorropo Jorropo left a comment

Choose a reason for hiding this comment

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

😭

Comment on lines -33 to -36
- `GET /reframe/{mbase64url-dag-cbor}`
- Cachable HTTP `GET` requests with message passed as DAG-CBOR in HTTP path segment, encoded as URL-safe [`base64url` multibase](https://docs.ipfs.io/concepts/glossary/#base64url) string
- DAG-CBOR in multibase `base64url` is used instead of DAG-JSON because JSON may include characters that are not safe to be used in URLs, and re-encoding JSON in base would take too much space
- Suitable for sharing links, sending smaller messages, and when a query result MUST benefit from HTTP caching (see _HTTP Caching Considerations_ below).
Copy link
Member Author

@lidel lidel Sep 29, 2022

Choose a reason for hiding this comment

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

ℹ️ Removing this for now since there is no implementation.

I believe we still want to implement this, so I re-introduced it as part of the IPIP which adds proper DAG-CBOR support (#327)

@lidel lidel requested a review from BigLep September 29, 2022 14:57
Copy link
Contributor

@BigLep BigLep left a comment

Choose a reason for hiding this comment

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

Bummer we're in this situation, but your path forward makes sense here @lidel . Feel free to ship (although lint markdown check is failing)

This is what Kubo 0.16.0-rc1 uses,
and what is implemented in https://github.com/ipfs/go-delegated-routing
not implemented anywhere, we will add it as a separate IPIP
@lidel lidel force-pushed the fix/dag-json-reframe-queries branch from f5a023e to aa5d122 Compare September 30, 2022 21:56
@lidel lidel merged commit ce16ee5 into main Sep 30, 2022
@lidel lidel deleted the fix/dag-json-reframe-queries branch September 30, 2022 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants