1568 Commits

Author SHA1 Message Date
Klaus Zanders 38ce5a3e33 Merge branch 'dev' into merge-release/17.5-20260611050510 2026-06-11 09:17:51 +02:00
OpenProject Actions CI ff8d35a227 Merge branch 'release/17.4' into release/17.5 2026-06-10 12:10:20 +00:00
Tobias Dillmann adb9f6b071 Authorize project custom field access in inplace edit dialog 2026-06-10 14:09:25 +02:00
Kabiru Mwenja 2dcc7dd5d1 Remove dead paginate entry point and clarify resolved-anchor recording
The Paginator.paginate class method bypassed the instance, discarding the
resolved_anchor state the controller reads after .call; it had no callers, so
drop it and keep the single new(...).call entry point. Extract the activity
anchor side effect into record_resolved_anchor so the intent is explicit at the
call site, and pin the server contract with a request spec asserting an
unresolvable activity anchor omits the resolved-comment value.
2026-06-05 14:38:02 +03:00
Kabiru Mwenja 5fdf57df69 Defer activity-tab sequence_version to anchor resolution
The work package activity tab computed a per-journal sequence_version on
every render — a ROW_NUMBER() window function over a LATERAL join — only to
stamp the legacy data-anchor-activity-id that #activity-N deep links rely on.
Nothing mints those links anymore; copy and share links use
#comment-<journal id>, which needs no extra query.

The activity number is now resolved on demand. Only a request carrying
?anchor=activity-N runs the window function, mapping the number to a journal
id the paginator exposes as resolved_anchor. The view hands that to the
client, which rewrites #activity-N to the canonical #comment-<id> and scrolls
using the comment anchor already present in the DOM. Default renders no longer
touch the window function.

References WP #68063.
2026-06-05 14:26:04 +03:00
Oliver Günther b5350cccf7 Add rack-attack throttler for all logins
We have a built-in bruteforce protection for built-in users. When users
are being created from LDAP on-the-fly, these limits cannot apply, as we
do not have a user object yet.

Instead, we can provide a more generous throttler to block attempts
2026-05-29 12:33:28 +02:00
Oliver Günther 4565b53957 Extract and use charset to properly serve inline text attachments (#23432)
* Extract and use charset to properly encode attachments

* Add the content type for external URLs

* Be more cautious when parsing charset from `file`
2026-05-29 10:51:37 +02:00
Oliver Günther 6f63faeed1 Extract and use charset to properly encode attachments 2026-05-29 10:26:43 +02:00
Ivan Kuchin 1d5b81284c fix wrong spec description 2026-05-28 13:58:03 +02:00
Ivan Kuchin f6e073f0a1 [#74769] Remove portfolio_models feature flag
https://community.openproject.org/wp/74769
2026-05-28 13:53:08 +02:00
OpenProject Actions CI e38557f12f Merge branch 'release/17.5' into dev 2026-05-26 04:53:23 +00:00
Tomas Hykel 948fa43321 chore: Remove feature flag for project-based work package identifiers 2026-05-25 17:45:06 +02:00
Jan Sandbrink c6b88a2893 Merge pull request #23279 from opf/dependabot/bundler/dev/mcp-0.15.0
Bump mcp from 0.14.0 to 0.15.0
2026-05-21 14:27:17 +02:00
Jan Sandbrink 86831fc4f2 Revert "Switch tests back to initial expectations"
This reverts commit 5fabc7d687.

Blindly testing whether this fixes the test failures after the last
MCP update.
2026-05-21 13:14:38 +02:00
Kabiru Mwenja e597aa4216 Fix NameError: uninitialized constant Projects::Identifier::CLASSIC_IDENTIFIER_FORMAT (#23293) 2026-05-20 22:02:41 +03:00
Tomas Hykel 506198d55d chore: Consolidate classic project ID generation 2026-05-18 14:15:20 +02:00
Eric Schubert 8f698a7d7c [chore] added specific sec-fetch-site to rate limit spec 2026-05-12 08:13:14 +02:00
Eric Schubert adb709d220 [chore] fixed test expectations for users not logged in 2026-05-12 08:13:14 +02:00
Eric Schubert 5723f8a12f [chore] add anonymous fallback for bcf api scope
- our APIv3 relies on having a non-null user
- if all auth strategies fail, the anonymous user is set to User.current
- bcf api is mounted in the root api - path is /api/bcf/v2_1 - that is
  the reason for the need of being able to fallback to anonymous user in
the bcf api scope
2026-05-12 08:13:14 +02:00
Eric Schubert f3f8625434 [chore] removed docs and code insertions for custom header
- X-Requested-With header no longer needed to prevent CSRF for session
  based auth
- removed occurences and mentions from code and docs
2026-05-12 08:13:14 +02:00
Jan Sandbrink 0383ae171c Consider Sec-Fetch-Site header for session auth
This warden strategy is primarily used to allow APIv3 requests
from the browser, which only authenticates using its session cookie.

Since this is susceptible to cross-site-request-forgery, prevention of
CSRF must take place. This was so far only ensured through the usage of
the X-Requested-With header. When a client sent along this header, the
server could know that a CORS-preflight request must have been made and
thus the browser most certainly has validated that the request is valid
according to CORS rules.

However, the header itself is a non-standard header and while some JavaScript
frameworks add it to requests, not all of them do. For us this was practically
visible on the API docs hosted under `/api/docs`.

The solution is to expect the browser to send the Sec-Fetch-Site header with a value
of same-origin. This header can't be set through JavaScript, but only by the browser
and the value "same-origin" ensures that scheme, host and port are the same for requester
and requested endpoint, thus eliminating CSRF concerns. This feature is widely supported by
all major browsers, the last of which was Safari which added support 3 years ago.

We might want to consider dropping the check for X-Requested-With entirely, since it should be
superfluous. For now it was left in place for greater compatibility.
2026-05-12 08:13:14 +02:00
Alexander Brandon Coles 9d4881216b Merge remote-tracking branch 'opf/dev' into HEAD
# Conflicts:
#	frontend/src/assets/sass/backlogs/_master_backlog.sass
#	modules/backlogs/config/locales/crowdin/ru.yml
#	modules/wikis/config/locales/crowdin/ru.yml
#	modules/wikis/config/locales/crowdin/uk.yml
#	modules/wikis/config/locales/crowdin/zh-CN.yml
2026-05-08 10:35:12 +02:00
Oliver Günther 7ae5604869 Merge pull request #23070 from opf/fix/relation-visible-scope
The performance decreased because of a combination of calls that were supposed to increase performance. 

We have a mechanism in place which automatically eager loads models needed in the element representers when a collection of them is rendered. This is to avoid N+1 queries of course. But, if eager loading is  combined with e.g., a LIMIT, which we do because we paginate, rails automatically falls back to issuing two instead of just one SQL statement. Which makes sense as otherwise LEFT JOINS might mess with the result set. 

But Rails does so in a somewhat simple fashion. It uses the first query to get the DISTINCT ids. The second is used to load the values (without a limit). But instead of removing all WHERE statements in the second SQL statement and then apply just the one for the ids, it keeps the original WHERE statement and applies the one for the ids on top. The problem with that is that the database trips on that (I didn't check the why) and uses a less than optimal query plan. 

That was the problem here as well. The first query remained reasonable quick (300ms) but the second one took 25s. 

The fix is to split the two statements by hand in the representer whenever eager loading is defined. The first query has all the filters but no eager loading and fetches the ids. The second takes the ids, and with eager loading included loads the data. Et voila, second query takes 10ms.   

That at least works for relations, work_packages and projects. But there are other representers that also seem to have custom behaviour. I'm looking into whether they can be easily adapted.
2026-05-07 15:44:13 +02:00
OpenProject Actions CI 0778811719 Merge branch 'release/17.4' into dev 2026-05-06 12:47:03 +00:00
Oliver Günther c660802146 Merge remote-tracking branch 'origin/release/17.3' into release/17.4 2026-05-06 09:19:25 +02:00
Yauheni Suhakou 37620b1a9f [74354] Rename storage_id to integration_id (#23049)
* Rename `storage_id` to `integration_id`
2026-05-05 16:58:08 +02:00
Oliver Günther e9e1e5db96 Allow overriding the default wide img-src content security policy
https://community.openproject.org/projects/openproject/work_packages/74648/activity
2026-05-05 11:12:18 +02:00
Alexander Brandon Coles 83573af155 Merge dev into release merge branch
Resolve Backlogs sprint conflicts by porting the release assignability
changes onto the renamed Sprint model.
2026-05-05 08:51:13 +01:00
Klaus Zanders 0115ea5bea Merge pull request #23041 from opf/role-given-error
Role for "Role given to a non-admin user who creates a project" must have certain permissions
2026-05-04 13:24:18 +02:00
Oliver Günther 5b4a3d0de2 Fix duplicate self reference in CSP 2026-05-04 12:26:14 +02:00
Klaus Zanders a66bc91c63 Include all permission dependencies, add a factory for the role with the correct permissions 2026-05-04 11:15:43 +02:00
David F 79a182f62f Update password rules when none is checked. wp/74398 2026-04-30 10:10:36 +02:00
Kabiru Mwenja 4dfdd6ec5d Drop numeric pins on auxilary links 2026-04-30 11:08:48 +03:00
Jan Sandbrink bb5c8b7f53 Merge pull request #22939 from opf/dependabot/bundler/dev/mcp-0.12.0
Bump mcp from 0.10.0 to 0.12.0
2026-04-28 11:33:03 +02:00
Jan Sandbrink 5fabc7d687 Switch tests back to initial expectations
Another update to the mcp gem switched some error
behaviour back to how we originally expected it to be.

This should finally be in line with the MCP specification
again.
2026-04-28 08:53:13 +02:00
Oliver Günther ab301f7de4 Merge pull request #22875 from opf/fix/validate-conditions-on-custom-action-execute
Validate conditions on execution of custom action
2026-04-27 08:41:04 +02:00
Oliver Günther 8eca1925ec Respect activation limit in user unlocking
https://community.openproject.org/work_packages/74373
2026-04-24 09:19:06 +02:00
Oliver Günther 6877e29351 Validate current user password confirmation when changing passwords through API
https://community.openproject.org/work_packages/74335
2026-04-23 14:19:50 +02:00
Mir Bhatia ddaff61e26 Merge pull request #22762 from opf/fix/68573-blank-page-and-error-404-when-calendar-board-team-planner-role-is-deleted
Draft: [68582] Blank page and error 404 when calendar, board, team planner, role is deleted
2026-04-23 09:29:38 +02:00
Mir Bhatia c8148ab799 Fix more redirection HTTP statuses 2026-04-22 16:44:50 +02:00
Oliver Günther 8ca79798db Validate conditions on execution of custom action
https://community.openproject.org/projects/openproject/work_packages/74294/activity
2026-04-22 14:12:42 +02:00
Kabiru Mwenja 79d4e67a0d Merge pull request #22718 from opf/feature/73756-adapt-routes-for-project-based-semantic-work-package-identifiers
Make find/exists? resolve semantic work package identifiers
2026-04-21 13:13:54 +03:00
Klaus Zanders 8d15647333 Merge pull request #22372 from opf/departments-admin-menu
Manage organizations in Admin Menu
2026-04-20 12:39:43 +02:00
Oliver Günther f41c5e6f80 Validate user limit when trying to activate user 2026-04-17 09:04:59 +02:00
OpenProject Actions CI 0c68614c6e Merge branch 'release/17.3' into dev 2026-04-17 04:32:30 +00:00
Klaus Zanders 710eac52ba Do not allow changing the organizational_unit flag and allow setting parent in the API 2026-04-16 18:11:13 +02:00
Klaus Zanders 50104b4900 Ensure department check also runs when adding users to a Group via AddUsersService 2026-04-16 17:24:28 +02:00
Oliver Günther 90383cc7ff Prevent moving news between projects
This is not expected to be possible
2026-04-16 15:36:47 +02:00
Oliver Günther e757ef55b6 Properly check move_work_packages in source project
https://community.openproject.org/work_packages/73924
2026-04-16 14:33:46 +02:00
Kabiru Mwenja 81fbb035cc Add integration tests for semantic identifier resolution
Verify that semantic work package identifiers (e.g. "TESTPROJ-1")
are resolved end-to-end through the controller and API layers,
using with_settings/with_flag helpers instead of allow mocks.
2026-04-15 15:54:50 +03:00