37 Commits

Author SHA1 Message Date
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
Yauheni Suhakou 2cd9a7b08f [73319] Create and use two-way OAuth 2 (#22816)
Update the OAuth section for the XWiki provider. Since XWiki provides only public clients, there are no client secrets passed in between OP and XWiki. Thus, the UI is, for now, just a mock with a client ID.
2026-04-28 14:07:37 +02:00
Yauheni Suhakou a1742b38a2 Refactor OAuthClientController#redirect_user_or_admin (#19887)
Refactor `OAuthClientController#redirect_user_or_admin` not to rely on class names or specific classes, but on the method defined in the classes.
2025-08-14 14:35:36 +02:00
Yauheni Suhakou 450fb32d3c [#64183] Add SharePoint storage validators and tests (#19792)
* Add SharePoint storage validators and tests

Introduces authentication and storage configuration validators for SharePoint storage integration, including their registration in the connection validator. Adds corresponding RSpec tests and updates English locale messages for SharePoint validation errors. Also updates the environment example and storage factory for the SharePoint test configuration.
2025-08-12 15:18:38 +02:00
Marcello Rocha d8c3d3450d [64180] Creating the Sharepoint Storage Model (#19541)
* Drafting a draft implementation draft
* Adds missing token exchange scope
* Remove all mention to list constants
* Changes to SharePoint rather than Sharepoint
* Addresses feedback by @kharonus
* Remove PROVIDER_TYPES
2025-07-17 16:07:41 +02:00
Marcello Rocha 55ff4d6903 Rework of Storages Registry based approach (#17881)
* 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
2025-07-10 09:01:55 +02:00
Kabiru Mwenja 4dbd60a367 chore[Op#56496]: Introduce flash modal contention via controller concern
`OpTurbo::Flashable`
  - `#flash_op_modal` - accepts a component and parameters. The component should be a ViewComponent and respond to `:name`, otherwise an error is raised
  - `#store_callback_op_modal_flash` - "Long term storage" - store directly in the session, useful when callback is needed on longer term basis E.g. in open redirect with callback
  - `#retrieve_callback_op_modal_flash` - safely read the values from `#store_callback_op_modal_flash`
2024-09-30 17:11:04 +03:00
Oliver Günther 12ee9e6b83 Merge remote-tracking branch 'origin/idea/56781-remove-years-from-copyrights' into dev 2024-08-06 10:17:59 +02:00
Eric Schubert 570804596f [#56892] Storage link not showing
- https://community.openproject.org/work_packages/56892
- changed link to static API link
- added localisation key
2024-08-05 14:47:18 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Oliver Günther 42d532c71a Set allow_other_host=true for external redirects 2024-07-10 13:15:37 +02:00
ulferts fdbd6b6d5a forcing to specify allowed actions when forfeiting authorization check 2024-06-11 10:29:22 +02:00
ulferts ed5a162230 allow actions to be called on those not using default authorization before_actions 2024-06-07 16:55:40 +02:00
Eric Schubert fe2c495518 [#53369] fixed small comment typo 2024-03-21 16:02:27 +01:00
Eric Schubert 821c91ce02 [#53369] fixed unit test setup 2024-03-21 13:07:41 +01:00
Eric Schubert 66f51b6a88 [#53369] replace authorization state with auth check query
- fixed unit test setup
- removed old usages of connection manager
2024-03-21 12:01:57 +01:00
Kabiru Mwenja 81b2139463 Bug/52676 Do not render oauth access grant modal when the project storage no longer exists (#14747)
[#52676] Do not render oauth access grant modal when the project storage is no longer exists

https://community.openproject.org/work_packages/52676
2024-02-09 13:03:42 +03:00
Kabiru Mwenja 3d1c5263bc chore[Op#49396]: Put back the conn manager local var 2024-02-07 14:25:00 +03:00
Kabiru Mwenja 02331ac6df chore[Op#49396]: user new predicates 2024-02-07 14:01:07 +03:00
Kabiru Mwenja 75a0047c82 feat[Op#49396]: Use session instead to flash modal 2024-02-02 12:19:02 +03:00
Kabiru Mwenja 604bdb4e35 feat[Op#49396]: Flash (optional) success modal on oauth callback 2024-01-31 18:33:52 +03:00
Eric Schubert ce278c79ad [chore] attempt to fix exception in error handling
- oauth controller needs to specifically react to StorageError
2024-01-15 14:36:59 +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
Pavel Balashou 3db9e584b1 Rename ensure_access to ensure_connection. 2023-11-21 10:10:54 +01:00
Pavel Balashou e6ded51db2 Refactor OAuthClientsController#ensure_access. 2023-11-10 14:37:08 +01:00
Pavel Balashou dcded13d78 [#50907] Implement /oauth_clients/:oauth_client_id/ensure_access
https://community.openproject.org/work_packages/50907
2023-11-09 15:48:35 +01:00
Eric Schubert 0b4f22d195 [#50871] handle empty cookie error cases 2023-11-07 09:55:03 +01:00
Eric Schubert d17a8a7f57 [#50871] added storage id to oauth state cookie
- this is needed to identify oauth clients of storages that have the
  same credentials (one drive storages)
- this is considered a hack and should be removed in #50872
2023-11-03 15:56:07 +01:00
Andreas Pfohl ebb13e7bf5 Enabled logging into Azure for OneDrive from FilesTab 2023-09-19 11:17:00 +02:00
Marcello Rocha 3519239d48 Making more tests pass 2023-09-07 13:54:38 +02:00
Marcello Rocha 6a9ed3939e Remove references to the Storage Show Page 2023-08-18 10:44:54 +02:00
Pavel Balashov 5caabe1a9d [#47629] Prepare the database to store the application password and managed folder flag.
https://community.openproject.org/work_packages/47629

- Turn `storages.provider_type` into a column for STI.
- Introduce `storages.provider_fileds` column which is responsible for
  storing different attributes depending on a specific storage provider.
  For nextcloud there are `username`, `password`, `managed_folders`.
- Introduce new storage model: `Storages::NextcloudStorage`.
- Migrate old code to respect new model.
- Remove a dead link from the codebase: https://www.openproject.org/docs/development/concepts/contracted-services/
2023-04-21 11:26:08 +02:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Andreas Pfohl 7db29b0de9 [#43193] Remove OAuth cookie after successful authorization against Nextcloud
https://community.openproject.org/work_packages/43193
2022-07-21 09:17:20 +02:00
Wieland Lindenthal 8a4c353381 Protect Authorization Code flow from CSRF 2022-06-10 16:41:29 +02:00
Wieland Lindenthal 22defd8019 Address issues that were detected during review 2022-06-10 10:26:16 +02:00
Wieland Lindenthal fcf3f34899 Adding ::OAuthClients::ConnectionManager and callback endpoint 2022-06-07 16:02:25 +02:00