mirror of
https://github.com/matrix-construct/construct
synced 2025-02-18 01:30:12 +01:00
ircd:Ⓜ️:rooms: Add requesting user_id/node_id to query opts for access ctrl.
This commit is contained in:
parent
db4ebe1ba7
commit
ede3d5a651
3 changed files with 10 additions and 1 deletions
|
@ -83,6 +83,14 @@ struct ircd::m::rooms::opts
|
|||
/// Specify prefetching to increase iteration performance.
|
||||
size_t prefetch {0};
|
||||
|
||||
/// Pass the c2s user_id making the request to determine access to features
|
||||
/// and visibility of results. Note the endpoint does not require auth.
|
||||
string_view request_user_id;
|
||||
|
||||
/// Pass the s2s server making the request to determine access to features
|
||||
/// and visibility of results.
|
||||
string_view request_node_id;
|
||||
|
||||
opts() = default;
|
||||
opts(const string_view &search_term) noexcept; // special
|
||||
};
|
||||
|
|
|
@ -133,7 +133,7 @@ get__publicrooms(client &client,
|
|||
opts.search_term = search_term;
|
||||
opts.lower_bound = true;
|
||||
opts.room_id = since;
|
||||
|
||||
opts.request_user_id = request.user_id;
|
||||
if(m::valid(m::id::USER, search_term))
|
||||
opts.user_id = search_term;
|
||||
|
||||
|
|
|
@ -113,6 +113,7 @@ handle_get(client &client,
|
|||
opts.lower_bound = true;
|
||||
opts.room_id = since;
|
||||
opts.search_term = search_term;
|
||||
opts.request_node_id = request.node_id;
|
||||
|
||||
size_t count{0};
|
||||
m::room::id::buf prev_batch_buf;
|
||||
|
|
Loading…
Add table
Reference in a new issue