Skip to content

Commit f092274

Browse files
committed
sentry - routes - docs for validator-messages routes
1 parent 01ea165 commit f092274

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

sentry/src/routes.rs

+28-9
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,17 @@
8787
//!
8888
//! #### GET `/v5/channel/:id/validator-messages`
8989
//!
90+
//! Retrieve the latest validator [`MessageTypes`] for a given [`Channel`].
91+
//!
92+
//! The query `limit` parameter is constraint to a maximum of [`Config.msgs_find_limit`],
93+
//! if a large value is passed it will use the [`Config.msgs_find_limit`] instead.
94+
//!
95+
//!
96+
//! **Sub-routes** with additional filtering:
97+
//!
9098
//! - GET `/v5/channel/:id/validator-messages/:addr` - filter by the given [`ValidatorId`]
9199
//! - GET `/v5/channel/:id/validator-messages/:addr/:validator_messages` - filters by the given [`ValidatorId`] and
92-
//! Validator [`MessageTypes`].
100+
//! validator [`MessageTypes`].
93101
//! - `:validator_messages` - url encoded list of Validator [`MessageTypes`] separated by a `+`.
94102
//!
95103
//! E.g. `NewState+ApproveState` becomes `NewState%2BApproveState`
@@ -116,6 +124,12 @@
116124
//!
117125
//! #### POST `/v5/channel/:id/validator-messages` (auth required)
118126
//!
127+
//! Create new validator [`MessageTypes`] for the given [`Channel`],
128+
//! used when propagating messages from the validator worker.
129+
//!
130+
//! **Authentication is required** to validate that the [`Auth.uid`] is either
131+
//! the [`Channel.leader`] or [`Channel.follower`].
132+
//!
119133
//! The route is handled by [`channel::validator_message::create_validator_messages()`].
120134
//!
121135
//! Request body (json): [`ValidatorMessagesCreateRequest`](primitives::sentry::ValidatorMessagesCreateRequest)
@@ -238,9 +252,9 @@
238252
//!
239253
//! #### POST `/v5/campaign` (auth required)
240254
//!
241-
//! Create a new Campaign. Request must be sent by the [`Campaign.creator`](primitives::Campaign::creator).
255+
//! Create a new Campaign. Request must be sent by the [`Campaign.creator`].
242256
//!
243-
//! **Authentication is required** to validate [`Campaign.creator`](primitives::Campaign::creator) == [`Auth.uid`](crate::Auth::uid)
257+
//! **Authentication is required** to validate [`Campaign.creator`] == [`Auth.uid`]
244258
//!
245259
//! It will make sure the `Channel` is created if new and it will update
246260
//! the spendable amount using the [`Adapter.get_deposit()`](adapter::client::Locked::get_deposit).
@@ -259,9 +273,9 @@
259273
//!
260274
//! #### POST `/v5/campaign/:id` (auth required)
261275
//!
262-
//! Modify the [`Campaign`]. Request must be sent by the [`Campaign.creator`](primitives::Campaign::creator).
276+
//! Modify the [`Campaign`]. Request must be sent by the [`Campaign.creator`].
263277
//!
264-
//! **Authentication is required** to validate [`Campaign.creator`](primitives::Campaign::creator) == [`Auth.uid`](crate::Auth::uid)
278+
//! **Authentication is required** to validate [`Campaign.creator`] == [`Auth.uid`]
265279
//!
266280
//! The route is handled by [`campaign::update_campaign::handle_route()`].
267281
//!
@@ -292,9 +306,9 @@
292306
//!
293307
//! The route is handled by [`campaign::close_campaign()`].
294308
//!
295-
//! Request must be sent by the [`Campaign.creator`](primitives::Campaign::creator).
309+
//! Request must be sent by the [`Campaign.creator`].
296310
//!
297-
//! **Authentication is required** to validate [`Campaign.creator`](primitives::Campaign::creator) == [`Auth.uid`](crate::Auth::uid)
311+
//! **Authentication is required** to validate [`Campaign.creator`] == [`Auth.uid`]
298312
//!
299313
//! Closes the campaign by setting [`Campaign.budget`](primitives::Campaign::budget) so that `remaining budget = 0`.
300314
//!
@@ -326,7 +340,7 @@
326340
//!
327341
//! #### GET `/v5/analytics/for-publisher` (auth required)
328342
//!
329-
//! Returns all analytics where the currently authenticated address [`Auth.uid`](crate::Auth::uid) is a **publisher**.
343+
//! Returns all analytics where the currently authenticated address [`Auth.uid`] is a **publisher**.
330344
//!
331345
//! All [`ALLOWED_KEYS`] are allowed for this route.
332346
//!
@@ -342,7 +356,7 @@
342356
//!
343357
//! #### GET `/v5/analytics/for-advertiser` (auth required)
344358
//!
345-
//! Returns all analytics where the currently authenticated address [`Auth.uid`](crate::Auth::uid) is an **advertiser**.
359+
//! Returns all analytics where the currently authenticated address [`Auth.uid`] is an **advertiser**.
346360
//!
347361
//! All [`ALLOWED_KEYS`] are allowed for this route.
348362
//!
@@ -381,10 +395,15 @@
381395
//! [`ApproveState`]: primitives::validator::ApproveState
382396
//! [`Accounting`]: crate::db::accounting::Accounting
383397
//! [`AccountingResponse`]: primitives::sentry::AccountingResponse
398+
//! [`Auth.uid`]: crate::Auth::uid
384399
//! [`Campaign`]: primitives::Campaign
400+
//! [`Campaign.creator`]: primitives::Campaign::creator
385401
//! [`CampaignId`]: primitives::CampaignId
386402
//! [`ChannelId`]: primitives::ChannelId
387403
//! [`Channel`]: primitives::Channel
404+
//! [`Channel.leader`]: primitives::Channel::leader
405+
//! [`Channel.follower`]: primitives::Channel::follower
406+
//! [`Config.msgs_find_limit`]: primitives::Config::msgs_find_limit
388407
//! [`MessageTypes`]: primitives::validator::MessageTypes
389408
//! [`NewState`]: primitives::validator::NewState
390409
//! [`Event`]: primitives::sentry::Event

0 commit comments

Comments
 (0)