This class got broken during what seems to be a
drive-by style-improvement in fbe1215365. That change:
* made it incompatible with frozen strings as error messages
* broke the intended hiding of messages if they came from the
wrong class
All of this went by unnoticed, because there were no specs
for the InternalError class.
Specs have now been added and the previous version of the code
mostly restored. Since there were some callers that always created the
exception with known safe error messages, I added a new class just for these
cases, because they were intended to "just show the message". So we can
keep using the original implementation for rescue_from handling.
* Re-creates the Registry and Errors under the Adapters namespace.
* Bring Authentication and Strategies to Adapters
* Make Strategies work with Result and clean up a bit of the code
* Setup SetPermissions Command and tests
* Moves create folder, need to add the input value
* Adds the create folder input
* RenameFile migrated
* Files Query and some Result Objects
* Gets the sync service working with the new commands/query
* UploadLinkQuery ported
* FileInfoQuery ported
* FilePathToIdMap moved
* Cleanup unused files and warnings
* Moves DeleteFolder. Updates tests of OneDriveSyncService
* Add some tests for the the inputs
* Start moving the bare minimum for the NextcloudSync
* Moves nextcloud FilePathToIdMap
* Create and Delete Folder nextcloud commands
* Port Nextcloud FileInfo and RenameFile
* Implements the changes necessary for create folder on the file picker
* Moves the CreateFolderService to the Adapters
* Move Nextcloud SetPermissions
* AuthCheck moved. Missing teests. Slowly moving the API to Adapters
* Adds note to figure out the open queries
* Move the user and group manipulation to adapters
* Moves Nextcloud FilesQuery
* Makes NextcloudSync to run on top of the new Adapter namespace
* Disable Peripherals::Registry
* Update CopyTemplateFolderService
* Makes services green again. Moves the new Nextcloud contract to Adapters
* Moves the new nextcloud contracts and fixes some the now broken tests
* Reintroduces the Internal namespace in OneDrive. Updates the contracts for Strategy to optionally take a storage (OIDC issues)
* Moves User and DownloadLink Queries and supporting code.
* Start to move the API over the new commands/queries
* Migrates the StorgeFilesAPI to the adapters
* FileLinksAPI cleared
* Updates the Storages API specs and implementations
* OpenStorage API done
* Update capabilities query
* Move connection validators and fix some broken tests
* Delete old code, update hidden dependencies.
* Adds missing handling for sso tokens
- implement hashed subtree retrieval in persistence layer
- implement flattening of hashed subtree in applicaiton layer
- added api spec for GET /custom_field_items/:id route
- added self link, parent and children to http response
- added api for single hierarchy item route
- write unit tests for hashed_subtree in HierarchicalItemService
- add parameter validation to api endpoint
* [#51305] Add Enterprise Banner and checks for SharePoint/OneDrive file storage integration
* chore[#51305] Add feature test for Enterprise Banner and checks for SharePoint/OneDrive
* fix[#51305] Fix file link create contract NilClass
* fix[#51305] Add ee to one_drive_create_contract_spec
* chore[#51305] Add uni test create contract
* chore[#51305] Add api tests
* chore[#51305] Add file_links create_contract tests
* [#51305] added description for api spec errors
---------
Co-authored-by: Eric Schubert <e.schubert@openproject.com>
- https://community.openproject.org/work_packages/49622
- added API error `OutboundRequest:Forbidden`
- fixed use case of single file request and file is forbidden
- added requests spec
- added alerts for different project folder states
In case we don't have an exception, but want to show 404 anyway due
to permissions, there is no exception object to use.
Allowing to pass in the model in scope helps with the message output
* Capabilities API
* introduce auxilliary capability model
* capability model and query
* render in sql
* fix pagination
* introduce sql representer
* extract abstract sql representer class
* remove yet unused methods
* abstract sql collection representer
* contract_actions as part of permissions
* filter for capability id - used in GET
* id filter validation
* remove unused representer
* remove unused wp representer
* reuse renaming class
* add spec for access control
* add principal filter to capability
* add context filter
* extract capability sql into scope
* admin gets all capabilities
* require to have one filter set to keep performance bearable
* consider active project modules for capabilities
* limit capability based on principal visiblity and user state
* rework capability to be tableless
* spec not being allowed to see on request level
* add actions to capability representer
* add action api
* extract sql index endpoint
* remove unused class
* prepare sending signaling error - not yet frontend exposed
* extract show endpoint for sql rendered responses
* use UNION for better performance
* include navigation links on collections
* remove string replacements
* extract collection representer into hal sql module
* no capabilities when blocked
* remove commented out code
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
Replaces reform by a simple layer of Disposable +
ActiveModel::Validations for contracts.
Additionally removes the custom error handling where OpenProject added
symbols to keep the ability to identify faulty attributes while having
non standard format (deviates from `%{attribute} %{message}`).
Changes to active record now allow us to define the format of a message
on i18n level, e.g. `%{message}`. Therefore the patching can be removed.
Reform plans to remove support for ActiveModel::Validations in version
4.0 at the latest but even today, support for it is hapazard. As we do
not need the full stack of Reform anyway, we can solely rely on
Disposable.
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.