Skip to content

Commit

Permalink
OAuth 1.0a removal
Browse files Browse the repository at this point in the history
  • Loading branch information
mmd-osm committed Dec 20, 2023
1 parent 9f270a0 commit 23b85b8
Show file tree
Hide file tree
Showing 29 changed files with 8 additions and 2,155 deletions.
3 changes: 1 addition & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ cgimap_include_HEADERS = \
include/cgimap/logger.hpp \
include/cgimap/mime_types.hpp \
include/cgimap/basicauth.hpp \
include/cgimap/oauth.hpp \
include/cgimap/oauth2.hpp \
include/cgimap/output_buffer.hpp \
include/cgimap/output_formatter.hpp \
Expand Down Expand Up @@ -108,7 +107,7 @@ cgimap_staticxml_include_HEADERS = \

TESTS = test/map.testcore test/node.testcore test/anon.testcore test/way.testcore test/relation.testcore
TESTS += test/empty.testcore test/way_full.testcore test/relation_full.testcore
TESTS += test/test_parse_id_list test/test_basicauth test/test_oauth test/test_oauth2 test/test_http
TESTS += test/test_parse_id_list test/test_basicauth test/test_oauth2 test/test_http
TESTS += test/test_parse_options test/test_parse_time
TESTS += test/changesets.testcore test/message.testcore test/routes.testcore
TESTS += test/redactions.testcore
Expand Down
8 changes: 0 additions & 8 deletions include/cgimap/backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <boost/program_options.hpp>
#include "cgimap/data_update.hpp"
#include "cgimap/data_selection.hpp"
#include "cgimap/oauth.hpp"

/* implement this interface to add a new backend which will be selectable
* on the command line.
Expand All @@ -37,9 +36,6 @@ struct backend {
// create a data update factory from the arguments passed to cgimap.
virtual std::unique_ptr<data_update::factory>
create_data_update(const boost::program_options::variables_map &) = 0;
// create an oauth store based on arguments.
virtual std::unique_ptr<oauth::store>
create_oauth_store(const boost::program_options::variables_map &) = 0;
};

// figures out which backend should be selected and adds its options to the
Expand All @@ -56,10 +52,6 @@ create_backend(const boost::program_options::variables_map &);
std::unique_ptr<data_update::factory>
create_update_backend(const boost::program_options::variables_map &);

// singleton call to create an OAuth store from options.
std::unique_ptr<oauth::store>
create_oauth_store(const boost::program_options::variables_map &);

// this function registers a backend for use when creating backends
// from user-provided options.
bool register_backend(std::unique_ptr<backend>);
Expand Down
34 changes: 0 additions & 34 deletions include/cgimap/backend/apidb/oauth_store.hpp

This file was deleted.

169 changes: 0 additions & 169 deletions include/cgimap/oauth.hpp

This file was deleted.

1 change: 0 additions & 1 deletion include/cgimap/oauth2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include "cgimap/data_selection.hpp"
#include "cgimap/http.hpp"
#include "cgimap/oauth.hpp"
#include "cgimap/request_helpers.hpp"

namespace oauth2 {
Expand Down
49 changes: 0 additions & 49 deletions include/cgimap/oauth_io.hpp

This file was deleted.

13 changes: 0 additions & 13 deletions include/cgimap/options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class global_settings_base {
virtual std::optional<uint32_t> get_relation_max_members() const = 0;
virtual std::optional<uint32_t> get_element_max_tags() const = 0;
virtual bool get_basic_auth_support() const = 0;
virtual bool get_oauth_10_support() const = 0;
virtual uint32_t get_ratelimiter_ratelimit(bool) const = 0;
virtual uint32_t get_ratelimiter_maxdebt(bool) const = 0;
virtual bool get_ratelimiter_upload() const = 0;
Expand Down Expand Up @@ -86,10 +85,6 @@ class global_settings_default : public global_settings_base {
return true;
}

bool get_oauth_10_support() const override {
return true;
}

uint32_t get_ratelimiter_ratelimit(bool moderator) const override {
if (moderator) {
return 1024 * 1024; // 1MB/s
Expand Down Expand Up @@ -171,10 +166,6 @@ class global_settings_via_options : public global_settings_base {
return m_basic_auth_support;
}

bool get_oauth_10_support() const override {
return m_oauth_10_support;
}

uint32_t get_ratelimiter_ratelimit(bool moderator) const override {
if (moderator) {
return m_moderator_ratelimiter_ratelimit;
Expand Down Expand Up @@ -224,7 +215,6 @@ class global_settings_via_options : public global_settings_base {
std::optional<uint32_t> m_relation_max_members;
std::optional<uint32_t> m_element_max_tags;
bool m_basic_auth_support;
bool m_oauth_10_support;
uint32_t m_ratelimiter_ratelimit;
uint32_t m_moderator_ratelimiter_ratelimit;
uint32_t m_ratelimiter_maxdebt;
Expand Down Expand Up @@ -272,9 +262,6 @@ class global_settings final {
// Enable HTTP basic authentication support
static bool get_basic_auth_support() { return settings->get_basic_auth_support(); }

// Enable legacy OAuth 1.0 support
static bool get_oauth_10_support() { return settings->get_oauth_10_support(); }

// average number of bytes/s to allow each client/moderator
static uint32_t get_ratelimiter_ratelimit(bool moderator) { return settings->get_ratelimiter_ratelimit(moderator); }

Expand Down
4 changes: 1 addition & 3 deletions include/cgimap/process_request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "cgimap/data_selection.hpp"
#include "cgimap/routes.hpp"
#include "cgimap/basicauth.hpp"
#include "cgimap/oauth.hpp"
#include "cgimap/oauth2.hpp"
#include <string>

Expand All @@ -26,7 +25,6 @@
void process_request(request &req, rate_limiter &limiter,
const std::string &generator, const routes &route,
data_selection::factory& factory,
data_update::factory* update_factory,
oauth::store* store = nullptr);
data_update::factory* update_factory);

#endif /* PROCESS_REQUEST_HPP */
Loading

0 comments on commit 23b85b8

Please sign in to comment.