mirror of
https://github.com/matrix-construct/construct
synced 2024-05-29 00:03:45 +02:00
ircd:Ⓜ️:rooms: Add requesting user_id/node_id to query opts for access ctrl.
This commit is contained in:
parent
db4ebe1ba7
commit
ede3d5a651
|
@ -83,6 +83,14 @@ struct ircd::m::rooms::opts
|
||||||
/// Specify prefetching to increase iteration performance.
|
/// Specify prefetching to increase iteration performance.
|
||||||
size_t prefetch {0};
|
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() = default;
|
||||||
opts(const string_view &search_term) noexcept; // special
|
opts(const string_view &search_term) noexcept; // special
|
||||||
};
|
};
|
||||||
|
|
|
@ -133,7 +133,7 @@ get__publicrooms(client &client,
|
||||||
opts.search_term = search_term;
|
opts.search_term = search_term;
|
||||||
opts.lower_bound = true;
|
opts.lower_bound = true;
|
||||||
opts.room_id = since;
|
opts.room_id = since;
|
||||||
|
opts.request_user_id = request.user_id;
|
||||||
if(m::valid(m::id::USER, search_term))
|
if(m::valid(m::id::USER, search_term))
|
||||||
opts.user_id = search_term;
|
opts.user_id = search_term;
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,7 @@ handle_get(client &client,
|
||||||
opts.lower_bound = true;
|
opts.lower_bound = true;
|
||||||
opts.room_id = since;
|
opts.room_id = since;
|
||||||
opts.search_term = search_term;
|
opts.search_term = search_term;
|
||||||
|
opts.request_node_id = request.node_id;
|
||||||
|
|
||||||
size_t count{0};
|
size_t count{0};
|
||||||
m::room::id::buf prev_batch_buf;
|
m::room::id::buf prev_batch_buf;
|
||||||
|
|
Loading…
Reference in a new issue