Commit graph

538 commits

Author SHA1 Message Date
Tom Hughes
3c00ed8dc3 Set a custom user agent for the faraday http client 2024-07-09 18:18:09 +01:00
Tom Hughes
c38e3d6144 Enforce changeset size limit for API calls which make changes 2024-06-19 00:46:34 +01:00
Tom Hughes
f61ac2586f Add support for per-user limits on the size of changes that can be made 2024-06-19 00:46:34 +01:00
Anton Khorev
c7353c9ac1 Add image method to get first image from rich text 2024-06-06 17:09:21 +03:00
Tom Hughes
d3d0da0328 Fix new rubocop warnings 2024-05-28 17:39:33 +01:00
Tom Hughes
938037d6a2 Update eslint to v9 2024-04-07 12:13:06 +01:00
Anton Khorev
16cc2e75a7 Remove unused includes of ConsistencyValidations 2024-03-28 11:49:49 +03:00
Tom Hughes
71cb2c50fc Merge remote-tracking branch 'upstream/pull/4272' 2024-02-25 13:40:11 +00:00
Tom Hughes
741ed58838 Add a limit on the number of points in a GPS trace 2024-02-25 09:50:02 +00:00
Anton Khorev
daa2543511 Add oauth scope for redactions 2023-12-21 17:37:17 +03:00
Anton Khorev
fb1ebf8925 Highlight moderator-only scopes when showing authorizations 2023-12-21 17:37:17 +03:00
Tom Hughes
0c2e471708 Fix new rubocop warnings 2023-12-05 18:13:13 +00:00
Tom Hughes
12b4d11d44 Use SecureRandom to generate user tokens 2023-12-04 17:25:57 +00:00
Anton Khorev
de793fb01d Separate pagination item computation and output 2023-11-16 13:21:14 +03:00
Anton Khorev
b7ce0f09e6 Move bootstrap pagination list wrapper to template 2023-11-16 13:21:14 +03:00
Anton Khorev
d104736809 Adjust sizes of changeset element headers/pagination 2023-11-16 13:21:14 +03:00
Anton Khorev
13823c988f Highlight current changeset node/way/relation page 2023-11-16 13:21:14 +03:00
Anton Khorev
8f57efe850 Add Bootstrap styling to changeset node/way/relation page links 2023-11-16 13:21:13 +03:00
Tom Hughes
cebda5ffb9 Merge remote-tracking branch 'upstream/pull/4319' 2023-11-15 17:14:49 +00:00
Tom Hughes
55a05d9e80 Use secure_compare to compare passwords and tokens
It's unlikely there is an explotable attack here given than network
latencies and variability will swamp any local timing differences but
it's best practice and there's no reason not to.
2023-11-07 17:22:40 +00:00
Tom Hughes
ef4c9a3306 Make change set comment rate limit errors display properly
Fixes #4320
2023-11-02 10:08:19 +00:00
Tom Hughes
2f11b77309 Add support for per-user limits on the rate changes can be made 2023-11-02 08:59:57 +00:00
Tom Hughes
0e74b21cb2 Fix new rubocop warnings 2023-10-31 18:16:46 +00:00
Tom Hughes
a6b5f2f56d Adjust code for rails internal changes 2023-10-18 18:26:14 +01:00
Gregory Igelmund
aa573ce1bb
.github/workflows/lint.yml: Add task verifying annotations are up2date 2023-10-14 11:28:44 +08:00
Milan Cvetkovic
64bcf7652b Add openid connect support using doorkeeper-openid_connect gem
... as discussed in [Issue 507](https://github.com/openstreetmap/operations/issues/507)
and described by @mmd-osm.

To activate, set the value of `doorkeeper_signing_key` to RSA private key.

Allows using openstreetmap as an identity provider.

Adds `openid` scope to OAuth2 authorizations, required to login to OSM.

Currently, the only claims returned are:
 - "openid" scope: "sub" and "preferred_username"
 - "read_email" scope: "email"
2023-10-03 18:53:47 +01:00
Anton Khorev
0ef4a299bb Check required bbox parameter presence outside of BoundingBox class 2023-09-03 09:47:27 +03:00
Andy Allan
a1657f03a8
Merge pull request #4202 from tomhughes/changeset-comment-limit
Add rate limiting for changeset comments
2023-08-30 11:12:40 +01:00
Tom Hughes
a274726f46 Add rate limiting for changeset comments
Fixes #4196
2023-08-25 19:53:04 +01:00
Tom Hughes
63bf18a3c3 Add support for rate limiting signup requests 2023-08-22 18:45:17 +01:00
Milan Cvetkovic
ad164d384e Change provider name to "microsoft" 2023-08-20 10:19:30 +01:00
Milan Cvetkovic
568bf4939d Replace references to windowslive with microsoft_graph 2023-08-17 13:01:15 +00:00
Milan Cvetkovic
7428da74c2 Use omniauth-microsoft_graph instead of omniauth-windowslive
Omniauth-microsoft_graph correctly populates 'email' and 'name' fields used by OpenStreetMap.
It also  uses updated endpoints for Microsoft identity provider.

Use email address returned by microsoft_graph provider as a verified address.

Upgrading exisiting users from windowslive to microsoft_graph:
 - upon next login existing `windowslive` users will have to authorizei
   OpenStreetMap application to "Read Your Profile," required for proper reading
   of display name field.

The name of the identity provider in OSM is kept to 'windowslive':
 - the entries in users table with `provider == 'windowslive'`
   can be reused for microsoft_graph provider, since
   the uid field is preserved. Users will not need to repeat the sign up process.
 - OAuth2 callback is still `/auth/windowslive`, no updates to Microsoft Identity Provider portal
   App registration are necessary.
2023-08-17 13:01:15 +00:00
Tom Hughes
466de96a91 Fix new rubocop warnings 2023-06-27 18:13:33 +01:00
Tom Hughes
c599f2bfaf Fix new rubocop warnings 2023-01-24 18:23:49 +00:00
Andy Allan
4ab134d869 Use fallbacks for OCI resource names
This uses the fallbacks for OCI translations. For example, if a
local chapter doesn't have an explicitly translated name, it will
use a template for osm-lc resources and fill in the appropriate
translated community name.

Fixes #3814
2022-12-14 14:54:01 +00:00
Tom Hughes
8cef62cd2c Merge remote-tracking branch 'upstream/pull/3301' 2022-11-22 18:47:24 +00:00
Andy Allan
b755db57a6 Use Pathname.glob to fetch the files 2022-11-02 18:33:32 +00:00
Andy Allan
af6fec502a Validate URLs against supply-chain attacks
Unfortunately validates_url gem doesn't support mailto or xmpp urls,
so we need to write our own validation.
2022-11-02 18:21:00 +00:00
Brian DeRocher
8eb2abc10c get_text("reversegeocode/result") returns an XML node. We want to get the text value of that node.
This will unescape ' into an apostrophe.

All callers of this function will later re-encode it depending out output whether it be HTML in an email, or XML in an RSS feed.

* app/mailers/user_mail.rb
* app/helpers/geocode_helper.rb
* app/views/api/notes/feed.rss.builder
* app/views/api/notes/_note.rss.builder

Fixes openstreetmap/openstreetmap-website#3761
2022-10-23 16:04:01 -04:00
Adam Hoyle
7e5cbe87ed Merge branch 'master' into feature/add-communities-page
# Conflicts:
#	Gemfile.lock
#	package.json
#	yarn.lock
2022-09-10 16:13:17 +01:00
Tom Hughes
9cd96bd452 Fix new rubocop warnings 2022-09-09 22:45:58 +01:00
Tom Hughes
fa93526f76 Use nominatim_url setting more consistently 2022-09-07 08:45:27 +01:00
Andy Allan
7e62e2b5ed Filter out the communities before loading the translations
This avoids loading excessive numbers of translations
2022-08-10 17:34:24 +01:00
Andy Allan
bf1f882eb8 Genericese comment 2022-08-10 17:19:46 +01:00
Andy Allan
87bb2a717d Use each_with_object 2022-08-10 14:01:42 +01:00
Andy Allan
5dcb4aa8fd Use member syntax for accessing communities 2022-08-10 13:54:14 +01:00
Andy Allan
d20632de9c Restrict files read from directory 2022-08-10 13:48:27 +01:00
Andy Allan
83a0ea14f1 Refactor i18n so that all community information is available
This makes it easier to use non-chapter communities on the site in future.
2022-08-03 10:11:30 +01:00
Andy Allan
bb7f5ac2c8 Switch to using FrozenRecord for loading communities
This allows us to query the records to get the local chapters, which
is more flexible and allows us to use other resources too.
2022-07-27 16:19:08 +01:00