Skip to content

Commit 6dd16a5

Browse files
authored
Merge pull request zerebubuth#354 from mmd-osm/patch/oauth10a_removal
OAuth 1.0a removal
2 parents 24709f1 + 888e35b commit 6dd16a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+260
-2423
lines changed

README

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ https://github.com/zerebubuth/openstreetmap-cgimap/pull/213 has additional confi
179179
## Database Permissions
180180

181181
The read only apidb backend requires permissions to SELECT on the Postgres server.
182-
OAuth and update database connections require additional permissions to INSERT/UPDATE/DELETE
182+
Update database connections require additional permissions to INSERT/UPDATE/DELETE
183183
data, as well as creating temporary tables.
184184

185185
It is recommended that a separate unix account is used for

include/cgimap/backend.hpp

-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <boost/program_options.hpp>
1717
#include "cgimap/data_update.hpp"
1818
#include "cgimap/data_selection.hpp"
19-
#include "cgimap/oauth.hpp"
2019

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

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

59-
// singleton call to create an OAuth store from options.
60-
std::unique_ptr<oauth::store>
61-
create_oauth_store(const boost::program_options::variables_map &);
62-
6355
// this function registers a backend for use when creating backends
6456
// from user-provided options.
6557
bool register_backend(std::unique_ptr<backend>);

include/cgimap/backend/apidb/oauth_store.hpp

-34
This file was deleted.

include/cgimap/oauth.hpp

-169
This file was deleted.

include/cgimap/oauth2.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#include "cgimap/data_selection.hpp"
1717
#include "cgimap/http.hpp"
18-
#include "cgimap/oauth.hpp"
1918
#include "cgimap/request_helpers.hpp"
2019

2120
namespace oauth2 {

include/cgimap/oauth_io.hpp

-49
This file was deleted.

include/cgimap/options.hpp

-14
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class global_settings_base {
3333
virtual std::optional<uint32_t> get_relation_max_members() const = 0;
3434
virtual std::optional<uint32_t> get_element_max_tags() const = 0;
3535
virtual bool get_basic_auth_support() const = 0;
36-
virtual bool get_oauth_10_support() const = 0;
3736
virtual uint32_t get_ratelimiter_ratelimit(bool) const = 0;
3837
virtual uint32_t get_ratelimiter_maxdebt(bool) const = 0;
3938
virtual bool get_ratelimiter_upload() const = 0;
@@ -86,10 +85,6 @@ class global_settings_default : public global_settings_base {
8685
return true;
8786
}
8887

89-
bool get_oauth_10_support() const override {
90-
return true;
91-
}
92-
9388
uint32_t get_ratelimiter_ratelimit(bool moderator) const override {
9489
if (moderator) {
9590
return 1024 * 1024; // 1MB/s
@@ -171,10 +166,6 @@ class global_settings_via_options : public global_settings_base {
171166
return m_basic_auth_support;
172167
}
173168

174-
bool get_oauth_10_support() const override {
175-
return m_oauth_10_support;
176-
}
177-
178169
uint32_t get_ratelimiter_ratelimit(bool moderator) const override {
179170
if (moderator) {
180171
return m_moderator_ratelimiter_ratelimit;
@@ -207,7 +198,6 @@ class global_settings_via_options : public global_settings_base {
207198
void set_relation_max_members(const po::variables_map &options);
208199
void set_element_max_tags(const po::variables_map &options);
209200
void set_basic_auth_support(const po::variables_map &options);
210-
void set_oauth_10_support(const po::variables_map &options);
211201
void set_ratelimiter_ratelimit(const po::variables_map &options);
212202
void set_ratelimiter_maxdebt(const po::variables_map &options);
213203
void set_ratelimiter_upload(const po::variables_map &options);
@@ -224,7 +214,6 @@ class global_settings_via_options : public global_settings_base {
224214
std::optional<uint32_t> m_relation_max_members;
225215
std::optional<uint32_t> m_element_max_tags;
226216
bool m_basic_auth_support;
227-
bool m_oauth_10_support;
228217
uint32_t m_ratelimiter_ratelimit;
229218
uint32_t m_moderator_ratelimiter_ratelimit;
230219
uint32_t m_ratelimiter_maxdebt;
@@ -272,9 +261,6 @@ class global_settings final {
272261
// Enable HTTP basic authentication support
273262
static bool get_basic_auth_support() { return settings->get_basic_auth_support(); }
274263

275-
// Enable legacy OAuth 1.0 support
276-
static bool get_oauth_10_support() { return settings->get_oauth_10_support(); }
277-
278264
// average number of bytes/s to allow each client/moderator
279265
static uint32_t get_ratelimiter_ratelimit(bool moderator) { return settings->get_ratelimiter_ratelimit(moderator); }
280266

include/cgimap/process_request.hpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "cgimap/data_selection.hpp"
1717
#include "cgimap/routes.hpp"
1818
#include "cgimap/basicauth.hpp"
19-
#include "cgimap/oauth.hpp"
2019
#include "cgimap/oauth2.hpp"
2120
#include <string>
2221

@@ -26,7 +25,6 @@
2625
void process_request(request &req, rate_limiter &limiter,
2726
const std::string &generator, const routes &route,
2827
data_selection::factory& factory,
29-
data_update::factory* update_factory,
30-
oauth::store* store = nullptr);
28+
data_update::factory* update_factory);
3129

3230
#endif /* PROCESS_REQUEST_HPP */

0 commit comments

Comments
 (0)