mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 07:20:55 +01:00
modules/federation: Split up user_keys module.
This commit is contained in:
parent
08c5de6e2b
commit
7f9b06e2c3
3 changed files with 61 additions and 42 deletions
|
@ -396,7 +396,8 @@ federation_federation_event_auth_la_SOURCES = federation/event_auth.cc
|
||||||
federation_federation_query_auth_la_SOURCES = federation/query_auth.cc
|
federation_federation_query_auth_la_SOURCES = federation/query_auth.cc
|
||||||
federation_federation_publicrooms_la_SOURCES = federation/publicrooms.cc
|
federation_federation_publicrooms_la_SOURCES = federation/publicrooms.cc
|
||||||
federation_federation_user_devices_la_SOURCES = federation/user_devices.cc
|
federation_federation_user_devices_la_SOURCES = federation/user_devices.cc
|
||||||
federation_federation_user_keys_la_SOURCES = federation/user_keys.cc
|
federation_federation_user_keys_query_la_SOURCES = federation/user_keys_query.cc
|
||||||
|
federation_federation_user_keys_claim_la_SOURCES = federation/user_keys_claim.cc
|
||||||
federation_federation_federation_la_SOURCES = federation/federation.cc
|
federation_federation_federation_la_SOURCES = federation/federation.cc
|
||||||
|
|
||||||
federation_module_LTLIBRARIES = \
|
federation_module_LTLIBRARIES = \
|
||||||
|
@ -420,7 +421,8 @@ federation_module_LTLIBRARIES = \
|
||||||
federation/federation_query_auth.la \
|
federation/federation_query_auth.la \
|
||||||
federation/federation_publicrooms.la \
|
federation/federation_publicrooms.la \
|
||||||
federation/federation_user_devices.la \
|
federation/federation_user_devices.la \
|
||||||
federation/federation_user_keys.la \
|
federation/federation_user_keys_query.la \
|
||||||
|
federation/federation_user_keys_claim.la \
|
||||||
federation/federation_federation.la \
|
federation/federation_federation.la \
|
||||||
###
|
###
|
||||||
|
|
||||||
|
|
49
modules/federation/user_keys_claim.cc
Normal file
49
modules/federation/user_keys_claim.cc
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
// Matrix Construct
|
||||||
|
//
|
||||||
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
||||||
|
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
|
||||||
|
//
|
||||||
|
// Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
// purpose with or without fee is hereby granted, provided that the above
|
||||||
|
// copyright notice and this permission notice is present in all copies. The
|
||||||
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
|
using namespace ircd;
|
||||||
|
|
||||||
|
mapi::header
|
||||||
|
IRCD_MODULE
|
||||||
|
{
|
||||||
|
"Federation 21 :End-to-End Encryption"
|
||||||
|
};
|
||||||
|
|
||||||
|
resource
|
||||||
|
user_keys_claim_resource
|
||||||
|
{
|
||||||
|
"/_matrix/federation/v1/user/keys/claim",
|
||||||
|
{
|
||||||
|
"federation user keys claim",
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static resource::response
|
||||||
|
post__user_keys_claim(client &client,
|
||||||
|
const resource::request &request);
|
||||||
|
|
||||||
|
resource::method
|
||||||
|
user_keys_claim__post
|
||||||
|
{
|
||||||
|
user_keys_claim_resource, "POST", post__user_keys_claim,
|
||||||
|
{
|
||||||
|
user_keys_claim__post.VERIFY_ORIGIN
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
resource::response
|
||||||
|
post__user_keys_claim(client &client,
|
||||||
|
const resource::request &request)
|
||||||
|
{
|
||||||
|
return resource::response
|
||||||
|
{
|
||||||
|
client, http::NOT_FOUND
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
// Matrix Construct
|
// Matrix Construct
|
||||||
//
|
//
|
||||||
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
||||||
// Copyright (C) 2016-2018 Jason Volk <jason@zemos.net>
|
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, and/or distribute this software for any
|
// Permission to use, copy, modify, and/or distribute this software for any
|
||||||
// purpose with or without fee is hereby granted, provided that the above
|
// purpose with or without fee is hereby granted, provided that the above
|
||||||
|
@ -16,15 +16,6 @@ IRCD_MODULE
|
||||||
"Federation 21 :End-to-End Encryption"
|
"Federation 21 :End-to-End Encryption"
|
||||||
};
|
};
|
||||||
|
|
||||||
resource
|
|
||||||
user_keys_claim_resource
|
|
||||||
{
|
|
||||||
"/_matrix/federation/v1/user/keys/claim",
|
|
||||||
{
|
|
||||||
"federation user keys claim",
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
resource
|
resource
|
||||||
user_keys_query_resource
|
user_keys_query_resource
|
||||||
{
|
{
|
||||||
|
@ -34,12 +25,15 @@ user_keys_query_resource
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static resource::response
|
static bool
|
||||||
post__user_keys_query(client &client,
|
_query_user_device(client &client,
|
||||||
const resource::request &request);
|
const resource::request &request,
|
||||||
|
const m::user::id &user_id,
|
||||||
|
const string_view &device_id,
|
||||||
|
json::stack::object &out);
|
||||||
|
|
||||||
static resource::response
|
static resource::response
|
||||||
post__user_keys_claim(client &client,
|
post__user_keys_query(client &client,
|
||||||
const resource::request &request);
|
const resource::request &request);
|
||||||
|
|
||||||
resource::method
|
resource::method
|
||||||
|
@ -51,32 +45,6 @@ user_keys_query__post
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
resource::method
|
|
||||||
user_keys_claim__post
|
|
||||||
{
|
|
||||||
user_keys_claim_resource, "POST", post__user_keys_claim,
|
|
||||||
{
|
|
||||||
user_keys_claim__post.VERIFY_ORIGIN
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
resource::response
|
|
||||||
post__user_keys_claim(client &client,
|
|
||||||
const resource::request &request)
|
|
||||||
{
|
|
||||||
return resource::response
|
|
||||||
{
|
|
||||||
client, http::NOT_FOUND
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
|
||||||
_query_user_device(client &client,
|
|
||||||
const resource::request &request,
|
|
||||||
const m::user::id &user_id,
|
|
||||||
const string_view &device_id,
|
|
||||||
json::stack::object &out);
|
|
||||||
|
|
||||||
resource::response
|
resource::response
|
||||||
post__user_keys_query(client &client,
|
post__user_keys_query(client &client,
|
||||||
const resource::request &request)
|
const resource::request &request)
|
Loading…
Reference in a new issue