Commit Graph
71 Commits
Author SHA1 Message Date
Sebastian Martinez 9efea143ab httpd: Sort issues and patches by creation date
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-03-01 13:02:09 +01:00
Alexis Sellier ac0994a3be httpd: Don't load project payload twice 2023-02-28 18:37:26 +01:00
xphoniex da594fb521 httpd: Use repo.identity_doc() instead of repo.identity_of(..)
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-28 18:08:26 +01:00
Alexis Sellier 7e8030b82f cob: Use hashes for operation ids
It's fairly easy for a user to (by mistake or intentionally) create two
operations with the same OpId. This patch makes it much less likely,
and ensures that if the OpId is equal, it's because the operations
are identical.
2023-02-27 17:11:48 +01:00
Sebastian Martinez 6793b8e7d3 httpd: Add issue and patch counts
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-27 12:57:20 +01:00
xphoniex e7de186e0e httpd: Add /raw route
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-23 06:16:37 +00:00
xphoniex 9a03136516 httpd: Use State instead of Extension for root_handler
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-23 05:54:31 +00:00
xphoniex 8d5d84f31c httpd: Update /git test to use test helper fns
Update `axum` to 0.6.7 to be able to use fix in:
https://github.com/tokio-rs/axum/pull/1767

Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-22 17:06:32 +01:00
xphoniex b0b94fea18 httpd: Move test utility mod from inside api to root
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-22 17:06:32 +01:00
xphoniex 1185a1fc6b httpd: Change 500 into 404 when project doesn't exist
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-22 17:06:32 +01:00
xphoniex 1a2ee8da58 httpd: Move git router & handler into its own file
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-22 17:06:32 +01:00
Fintan Halpenny a3f8a0b524 Exchange From for TryFrom for PathBuf and Home
The `From` implementation would allow someone to create a `Home` in an
incorrect fashion, for example the path is not canonical.

Exchange `From` for a `TryFrom` implementation.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-17 10:37:39 +01:00
Sebastian Martinez 3cf1accddd Use Did in a bunch more places
Instead of showing just public keys we need to show the fully qualified
spec for a NID which is prefixed by `did🔑` While we want to maintain
`Author` and `ActorId` for internal use.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-16 18:01:42 +01:00
xphoniex 7e9b9c944b httpd: Return correct count for patches
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-16 16:51:02 +01:00
Alexis Sellier 8b90dd674f Make ReadStorage more usable
Previously, we were not able to access a `ReadRepository` instance
through `ReadStorage`. With this change, we are able to.
2023-02-15 22:08:20 +01:00
Sebastian Martinez 95dca98a43 httpd: Add delegates to project routes
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-14 14:50:42 +01:00
Sebastian Martinez 43f32c8360 httpd: Add assignees to Issues::create
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-13 13:47:15 +01:00
Alexis Sellier 2395d5c328 cli: Track projects we initialize 2023-02-12 16:48:46 +01:00
xphoniex 4a27cc3f6c Update radicle-git and radicle-surf
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-10 22:14:50 +01:00
Sebastian Martinez a6d120fa28 httpd: Add api::test::patch request method
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-10 12:17:03 +01:00
Sebastian Martinez d88858e58b radicle-httpd: Add DELETE to allowed methods
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-09 16:48:48 +01:00
Alexis Sellier 61902ca47b cli: Have init trigger routing table updates
Before this change, nodes had to be restarted to announce newly
initialized projects.
2023-02-08 16:29:42 +01:00
Sebastian Martinez 83a635976d httpd: Add DELETE route to remove sessions
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-07 20:59:06 +01:00
Sebastian Martinez 2335bc7ecc httpd: Add issue endpoints
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-06 14:14:06 +01:00
Sebastian Martinez 811b70a5cb Extract json! into api::json
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-04 19:42:14 +01:00
Sebastian Martinez d39ca8e404 httpd: Remove session serialization, improve tests
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-04 19:39:25 +01:00
Sebastian Martinez ffdf7c171d httpd: Refactor auth and session handling
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-04 19:38:26 +01:00
Sebastian Martinez f689cb2c9f httpd: Remove session serialize and rework
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-04 19:37:35 +01:00
Sebastian Martinez 585dcf4afe Add GET /api/v1/sessions/:id route to get session information
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-02-04 19:35:58 +01:00
Fintan Halpenny d8da80821b Rust 1.67
Rust 1.67 was announced[0]. Update the necessary files for running
1.67 and fix the clippy suggestions for string interpolation.

[0]: https://blog.rust-lang.org/2023/01/26/Rust-1.67.0.html

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-04 19:30:29 +01:00
xphoniex 6d9154d427 httpd: Extract issue json response
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-04 13:46:26 +00:00
xphoniex 49590bc72d httpd: Add routes for patch ops
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-02-04 13:22:09 +00:00
Alexis Sellier a8a24ec945 node: Check refs when getting local inventory
If we don't do this, we're going to be returning broken repos.
2023-01-30 11:38:00 +01:00
xphoniex b28b25c00f Update radicle-surf
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-28 20:19:23 +01:00
Sebastian Martinez 932d8d2ed8 Add web-based authentication
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-01-27 17:23:05 +01:00
Alexis Sellier 71edcfe7f2 Replace RAD_DEBUG with RAD_SEED
The latter is strictly more powerful.
2023-01-25 17:09:16 +01:00
xphoniex 2125128b5f httpd: Remove lastCommit in /tree for entries
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-25 15:35:24 +01:00
xphoniex 9d8c5f404b httpd: Clean up json.rs
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-25 15:35:24 +01:00
xphoniex f9e519296d httpd: Change sha1 into id
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-25 15:35:24 +01:00
xphoniex 05da23b707 httpd: Use commits/commit instead of headers/header
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-25 15:35:24 +01:00
xphoniex 24d19b69d2 httpd: change committerTime into committer.time
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-25 15:35:24 +01:00
xphoniex 59e3afac67 httpd: Update axum from 0.5.x to 0.6.x
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-18 14:09:48 +00:00
Han Xu 64a933dccd httpd: Dogfood the new radicle-surf API
Signed-off-by: Han Xu <keepsimple@gmail.com>
2023-01-18 14:22:01 +01:00
Alexis Sellier c5841cefb6 Rename profile::Paths to profile::Home
This makes the intent clearer.

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 11:01:36 +01:00
Alexis Sellier 1072fd1efc Speed up node E2E tests
By allowing the node to run using a `MockSigner`, we speed up tests
significantly, since PBKDF2 doesn't need to run.

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-17 11:01:36 +01:00
xphoniex d98073a55d httpd: Add api tests
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-01-12 20:30:53 +01:00
Alexis Sellier 134bb7a847 cob: Create proper OpId type
To still access a comment's author, we add a new `author` field.
2022-12-31 09:58:51 +01:00
xphoniex a93803c8ca httpd: Use TraceLayer on uppermost router
This allows prefix of each route e.g. `/api/*` to be visible in logs.

Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-12-26 15:56:21 +01:00
xphoniex 8e688fef34 Update radicle-git to 79a94721366490053e2d8ac1c1afa14fb0c25f09
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-12-23 13:22:55 +01:00
Alexis Sellier 10d450c751 cob: Implement comment edit action
This implementation intentionally preserves all edits such that
they may be displayed in an application as an edit history.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-16 12:32:20 +01:00