mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
ircd::resource: Add a node_id to the resource request struct.
This commit is contained in:
parent
ba4b3fa145
commit
fc3fd6a8b2
2 changed files with 5 additions and 1 deletions
|
@ -94,6 +94,7 @@ struct ircd::resource::request
|
||||||
vector_view<string_view> parv;
|
vector_view<string_view> parv;
|
||||||
string_view param[8];
|
string_view param[8];
|
||||||
m::user::id::buf user_id;
|
m::user::id::buf user_id;
|
||||||
|
m::node::id::buf node_id;
|
||||||
|
|
||||||
request(const http::request::head &head,
|
request(const http::request::head &head,
|
||||||
const string_view &content)
|
const string_view &content)
|
||||||
|
@ -116,6 +117,7 @@ struct ircd::resource::request::object
|
||||||
const http::query::string &query;
|
const http::query::string &query;
|
||||||
const decltype(r.origin) &origin;
|
const decltype(r.origin) &origin;
|
||||||
const decltype(r.user_id) &user_id;
|
const decltype(r.user_id) &user_id;
|
||||||
|
const decltype(r.node_id) &node_id;
|
||||||
const decltype(r.access_token) &access_token;
|
const decltype(r.access_token) &access_token;
|
||||||
const vector_view<string_view> &parv;
|
const vector_view<string_view> &parv;
|
||||||
const json::object &body;
|
const json::object &body;
|
||||||
|
@ -128,6 +130,7 @@ struct ircd::resource::request::object
|
||||||
,query{r.query}
|
,query{r.query}
|
||||||
,origin{r.origin}
|
,origin{r.origin}
|
||||||
,user_id{r.user_id}
|
,user_id{r.user_id}
|
||||||
|
,node_id{r.node_id}
|
||||||
,access_token{r.access_token}
|
,access_token{r.access_token}
|
||||||
,parv{r.parv}
|
,parv{r.parv}
|
||||||
,body{r}
|
,body{r}
|
||||||
|
|
|
@ -207,7 +207,8 @@ try
|
||||||
object.verify(x_matrix.key, x_matrix.sig)
|
object.verify(x_matrix.key, x_matrix.sig)
|
||||||
};
|
};
|
||||||
|
|
||||||
request.origin = x_matrix.origin;
|
request.node_id = {"", x_matrix.origin};
|
||||||
|
request.origin = request.node_id.host();
|
||||||
return verified;
|
return verified;
|
||||||
}
|
}
|
||||||
catch(const std::exception &e)
|
catch(const std::exception &e)
|
||||||
|
|
Loading…
Reference in a new issue