mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
55ff4d6903
* 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
42 lines
1.7 KiB
Ruby
42 lines
1.7 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
#-- copyright
|
|
# OpenProject is an open source project management software.
|
|
# Copyright (C) the OpenProject GmbH
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License version 3.
|
|
#
|
|
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
|
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
|
# Copyright (C) 2010-2013 the ChiliProject Team
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License
|
|
# as published by the Free Software Foundation; either version 2
|
|
# of the License, or (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
#
|
|
# See COPYRIGHT and LICENSE files for more details.
|
|
#++
|
|
|
|
class RemoteIdentity < ApplicationRecord
|
|
belongs_to :user
|
|
belongs_to :auth_source, polymorphic: true
|
|
belongs_to :integration, polymorphic: true
|
|
|
|
validates :user, uniqueness: { scope: %i[auth_source integration] }
|
|
validates :origin_user_id, :user, :auth_source, :integration, presence: true
|
|
|
|
# FIXME: This needs a better name - 2025.03.18 @mereghost
|
|
scope :of_user_and_client, ->(user, client, integration) { find_by(user:, auth_source: client, integration:) }
|
|
end
|