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

Add API for Retrieving All Documents #677

Open
devleejb opened this issue Nov 15, 2023 · 8 comments
Open

Add API for Retrieving All Documents #677

devleejb opened this issue Nov 15, 2023 · 8 comments
Assignees
Labels
enhancement 🌟 New feature or request good first issue 🐤 Good for newcomers

Comments

@devleejb
Copy link
Member

devleejb commented Nov 15, 2023

Description:

Proposing the addition of a REST API to retrieve the contents of Yorkie Documents, enabling developers using Yorkie to utilize the data.

Why:

During the operation of our service, the need for data analysis, such as inspecting accumulated data in Yorkie Documents, has arisen.

@devleejb devleejb added the enhancement 🌟 New feature or request label Nov 15, 2023
@krapie
Copy link
Member

krapie commented Nov 16, 2023

Currently, there is an GetDocumentSummary() admin gRPC API for getting a snapshot of a document.
Are you suggesting an HTTP REST API in JSON format to get document snapshots?

@devleejb
Copy link
Member Author

Exactly. I think I need an HTTP REST API. The service data is needed more for data analysis rather than in real-time, and gRPC has significant technical overhead.

@hackerwins
Copy link
Member

hackerwins commented Nov 17, 2023

@krapie I remember connect-rpc also exposing the APIs in HTTP as well as gRPC. Am I right?

@krapie
Copy link
Member

krapie commented Nov 17, 2023

@hackerwins Yes, connect-rpc also exposes plain HTTP along with gRPC. I think we can also resolve this issue when we switch current server rpc to connect-rpc.

@hackerwins
Copy link
Member

Great. We will soon be using Secret Key for the Admin API too.
Screenshot 2023-11-17 at 2 25 53 PM

@krapie
Copy link
Member

krapie commented Nov 27, 2023

I have confirmed that we can use ConnectRPC to retrieve document with HTTP POST

Screenshot 2023-11-27 at 3 44 05 PM

Very excited to see this working :)

@krapie krapie self-assigned this Nov 27, 2023
@krapie krapie mentioned this issue Dec 12, 2023
2 tasks
@hackerwins
Copy link
Member

hackerwins commented Jan 3, 2024

After migrating to Connect RPC, we can use REST API.

I think this issue could be solved by using the Private Key created in the Dashboard during the authentication step.

func VerifyAccess(ctx context.Context, be *backend.Backend, accessInfo *types.AccessInfo) error {
md := metadata.From(ctx)
project := projects.From(ctx)
if !project.RequireAuth(accessInfo.Method) {
return nil
}
return verifyAccess(
ctx,
be,
project.AuthWebhookURL,
md.Authorization,
accessInfo,
)
}

@hackerwins hackerwins added the good first issue 🐤 Good for newcomers label Jan 3, 2024
@devleejb
Copy link
Member Author

devleejb commented Jan 4, 2024

Then, is it possible to provide API for other features? (Document Editing, ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request good first issue 🐤 Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

3 participants