Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

feat(proxy): org API endpoints #300

Merged
merged 5 commits into from Apr 22, 2020
Merged

feat(proxy): org API endpoints #300

merged 5 commits into from Apr 22, 2020

Conversation

MeBrei
Copy link
Contributor

@MeBrei MeBrei commented Apr 21, 2020

Implements the get and register org endpoints in the rest api and connects them to the registry as part of #277

@MeBrei MeBrei added proxy feature Something that doesn't exist yet labels Apr 21, 2020
@MeBrei MeBrei self-assigned this Apr 21, 2020
Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

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

Looks real good already. Wouldn't have done it differently. Looks like it's relatively straightforward to boostrap another set of endpoints. Curious to hear what gave you trouble or wasn't that approachable.

.and(warp::post())
.and(super::with_registry(registry))
.and(warp::body::json())
.and(super::with_subscriptions(subscriptions))
Copy link
Contributor

Choose a reason for hiding this comment

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

I tend to order the params for the handler with datastores first and inputs, params last. So would swap line 38 and 39.

use crate::registry;

/// The org with identifier and avatar
pub struct Org {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should live in registry.rs, or alternatively in a seperate org.rs. Similar to how we have our own identity, this seems to be upstreams understanding of an org.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it to registry.rs

get_filter().or(register_filter(registry, subscriptions))
}

/// POST /orgs/register
Copy link
Contributor

Choose a reason for hiding this comment

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

The only real write operation we have on top-level orgs is the registration, so synonymous with creation. Would say we can just do POST /orgs for that endpoint.

@xla xla changed the title Get and register org endpoints feat(proxy): org API endpoints Apr 21, 2020
@xla
Copy link
Contributor

xla commented Apr 22, 2020

@MeBrei Org retrieval should be as trivial as the get_user method. This is what we likely wanna use in the registry client; https://github.com/radicle-dev/radicle-registry/blob/1ecf004bb1e27f152e73716b1b316e0db878b0fd/client/src/interface.rs#L129

@MeBrei
Copy link
Contributor Author

MeBrei commented Apr 22, 2020

@MeBrei Org retrieval should be as trivial as the get_user method. This is what we likely wanna use in the registry client; https://github.com/radicle-dev/radicle-registry/blob/1ecf004bb1e27f152e73716b1b316e0db878b0fd/client/src/interface.rs#L129

Yes, that part I already have I think. Not sure yet, how I can test it (ie test the querying of an existing user) and I need to add the avatar to the response.

@MeBrei MeBrei marked this pull request as ready for review April 22, 2020 09:33
Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

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

🖖 🛰 💪 🦃

proxy/src/http/org.rs Outdated Show resolved Hide resolved
Co-Authored-By: Alexander Simmerl <a.simmerl@gmail.com>
@MeBrei MeBrei mentioned this pull request Apr 22, 2020
18 tasks
@MeBrei MeBrei merged commit b480bc4 into master Apr 22, 2020
@MeBrei MeBrei deleted the merle/basic-org-endpoints branch April 22, 2020 12:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Something that doesn't exist yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants