114 Commits

Author SHA1 Message Date
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Pavel Balashou f611ba3bcb [#55643] Extend API authentication to accept JWT issued by OpenID provider to other client.
https://community.openproject.org/work_packages/55643

- Add new warden authentication stategy to handle jwt issued by configured OIDC.
- Modify exisiting doorkeeper_oauth stategy to ignore jwts.
- Fill in WWW-Autheticate header with auth failure information.
- Make keycloak docker dev setup use postgres as a database.
2024-07-23 10:42:04 +02:00
Christophe Bliard bf687d9d22 Correctly parse api request with application/hal+json content type
Parse it like json content.

Fixes https://community.openproject.org/wp/56040
2024-07-03 11:03:53 +02:00
ulferts 50b1ac7a3d adapt content type on errors definition 2024-06-25 20:37:54 +02:00
ulferts dd92b1abd2 bump grape 2024-06-25 20:37:49 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Oliver Günther 78cc8b30d4 Add Appsignal configuration 2022-06-09 15:51:22 +02:00
Christophe Bliard a33524ef6d remove ruby magic comment for utf-8
ruby interprets source encoding as utf-8 since 2.0.0, making magic comment redundant and useless
2022-03-10 19:36:58 +01:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
ulferts 6140f4c7e9 update copyright to 2021 (#8925)
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.

Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
2021-01-13 17:47:45 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
ulferts 0a9a7f02d1 fix content type in error handling 2019-11-13 09:18:58 +01:00
ulferts 17bd411b53 adapt the api authorization to the bcf api 2019-11-11 17:03:29 +01:00
ulferts 3a89fceb0d error handling in bcf v2.1 2019-11-11 10:57:18 +01:00
ulferts c6b17e8a7a extract root api into separate superclass 2019-11-11 10:47:48 +01:00
Oliver Günther 8a8193fa15 Add info on thread and connection pool for timeouts errors
- Added to Rails controller request handling
- Added to API root to catch all api requests as well

Tested on sentry with both as https://sentry.openproject.com/sentry/localhost/issues/909/?query=is:unresolved
2019-08-28 14:52:16 +02:00
Oliver Günther 7ac2805779 Save integer relative positions by computing spaces between 2019-07-15 09:26:50 +02:00
Oliver Günther 1b5fc32366 Avoid before blocks and raw params access for IDs
Grape's validation runs after a `before` block so we should avoid using
raw params there and instead using `declared(params)` which returns only
the validated whitelisted params, much like a permitted params hash.
2019-05-22 09:34:17 +02:00
Oliver Günther f487fcacca [30092] Use delegated logger (sentry) for logged API errors 2019-04-29 08:27:51 +02:00
Jens Ulferts 02cdabed65 prevent access to user api for locked admins 2019-01-14 11:26:21 +01:00
Oliver Günther c5e14322ae Fix #new on internal api error
https://sentry.openproject.com/sentry/saas-openproject-prod/issues/21/?query=is:unresolved
2018-12-12 16:34:13 +01:00
Oliver Günther 8408f86fef Improve usage of I18n in model specs
This will avoid loading I18n translations in single-use cases where
it would not be loaded anyway
2018-11-19 14:19:52 +01:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Jens Ulferts 77370d58ad document custom actions 2018-02-06 16:42:46 +01:00
ulferts c88b0b85c4 return proper WWW Authenticate header on missing credentials (#6150)
An anonymous_fallback is introduced and registered to be the last
strategy for warden. That strategy will always apply and it will always
return the anonymous user.

The better way would be to only apply the strategy if login is not
required. That way we would still be able to return a 403 when
credentials are missing but would no longer need to have 401 handlers
outside of warden. That duplicity caused the missing header in the first
place.

It would however require us to handle the realm in the strategy and by
that increase the coupling between the strategy and the application.

[ci skip]
2018-01-30 11:42:14 +01:00
Oliver Günther ac389b869d Fix other request specs by adding json header 2017-10-18 10:14:01 +02:00
Oliver Günther 4d0bad7efc Allow endpoints to override content types (attachments!) 2017-10-18 09:39:26 +02:00
Oliver Günther 8282c465cb [26318] Enforce APIv3 content-type
https://community.openproject.com/wp/26318
2017-10-18 07:24:59 +02:00
Oliver Günther 92060508a9 Remove unused test helper 2017-09-12 09:17:39 +02:00
ulferts 9c8f7f3ca1 read operations for time_entries via api v3 (#5776)
* read operations for time_entries via api v3

Introduces the endpoints:
* GET /api/v3/time_entries
* GET /api/v3/time_entries/:id
* GET /api/v3/time_entries/activities/:id

The index action for time entries can be queried by the following
filters:
* project_id
* user_id
* work_package_id

The implementation is exposing the database structure mostly one to one
with the exception of some renaming and the hiding of the activities'
complexity, where only the activity used systemwide is referenced
regardless of whether a project specific override exists or not.

* allow custom values for time entries

[ci skip]
2017-08-09 10:24:16 +02:00
ulferts 36ab671d27 log stacktrace on api error (#5450)
[ci skip]
2017-05-05 11:40:17 +02:00
Jens Ulferts 80c242dd53 embed query results in query representer
This is only done when the representer is not embedded itself, e.g. when
it is part of a collection.
2017-02-01 16:59:40 +01:00
Oliver Günther 7cf11bb689 Update copyright notice 2017-01-10 15:11:43 +01:00
Jens Ulferts a52c8ee07d allow for filtering the queries in the API v3
Only implements the `project` filter for now which can be used to differntiate between queries from specific projects and can also be used to specify that the client is only interested in global queries
2016-12-22 08:53:31 +01:00
Jens Ulferts b3848c879b grant access to API v3 GET queries also for manage_public_queries 2016-12-21 10:42:55 +01:00
Oliver Günther 29d69a3fc5 Introduce header and Rails caching for schemas
This commit introduces cached project-scoped work packages schema.
Their caches are expired on a key based on

- the Project ID
- the Type ID
- the allowed custom fields for the given project

This commit only caches schema, not form endpoints.
2016-04-26 07:57:08 +02:00
Jan Sandbrink f9cb083481 in production handle internal API errors gracefully
- still allow for useful errors during development
- let all own exceptions inherit from StandardError, the thing you should use for own errors...
2015-08-27 16:05:46 +02:00
Jan Sandbrink 4c0a6f4ba1 pass block parameter through :authorize 2015-08-20 09:19:25 +02:00
Jan Sandbrink bc36704611 allow to get queries via APIv3
- one of those missing endpoints
- adapted resource spec to be closer to other resource specs
- specified error behaviour (missing permissions)
-> change: not being allowed to see a query results in 404
2015-08-20 09:19:25 +02:00
Alex Coles cfe4ac45d8 Merge branch 'dev' into feature/merge-dev-into-rails4
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-08-17 12:34:00 +02:00
Jens Ulferts 6e01b27f18 rename service's method to be in accordance with proc 2015-08-13 13:22:06 +02:00
Jens Ulferts c471080e08 set locale before API v3 request
The mechanism was extracted from the rails stack where the locale is
taken based on (in that order):
* The user's preferences
* The accept_language header
* The system settings

Only languages, that are enabled by the instance are valid. If one is
selected (e.g user preference), that is not enabled by the instance, a
fallback is taken.
2015-08-13 12:51:34 +02:00
Alex Coles 29d9814347 Prefer Project.allowed_to to .allowed_to_condition
Use `ActiveRecord::Relation#merge` to merge scopes.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-07-11 12:24:22 +02:00
Alex Coles 7f99c51b76 Merge branch 'feature/rails4' into feature/20325-rails4-deprecated-dynamic-finders
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-07-07 10:39:56 +02:00
Markus Kahl 3865ce4f1f polish 2015-07-01 15:34:35 +01:00