OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Move auth provider to base table
Oliver Günther344ce2730cec
diff --git a/modules/auth_saml/app/contracts/saml/providers/create_contract.rb b/modules/auth_saml/app/contracts/saml/providers/create_contract.rbindex 555aeac3604..2115bc482b3 100644--- a/modules/auth_saml/app/contracts/saml/providers/create_contract.rb+++ b/modules/auth_saml/app/contracts/saml/providers/create_contract.rb@@ -28,6 +28,7 @@module Samlmodule Providersclass CreateContract < BaseContract+ attribute :typeendendenddiff --git a/modules/auth_saml/app/models/saml/provider.rb b/modules/auth_saml/app/models/saml/provider.rbindex 1a59208a1a5..ec2604d1b38 100644--- a/modules/auth_saml/app/models/saml/provider.rb+++ b/modules/auth_saml/app/models/saml/provider.rb@@ -1,11 +1,7 @@module Saml- class Provider < ApplicationRecord+ class Provider < AuthProviderinclude HashBuilder- self.table_name = "saml_providers"-- belongs_to :creator, class_name: "User"-store_attribute :options, :sp_entity_id, :stringstore_attribute :options, :name_identifier_format, :stringstore_attribute :options, :metadata_url, :string@@ -47,17 +43,10 @@ module Samlattr_accessor :readonly- validates_presence_of :display_name- validates_uniqueness_of :display_name-def slugoptions.fetch(:name) { "saml-#{id}" }end- def limit_self_registration?- limit_self_registration- end-def has_metadata?metadata_xml.present? || metadata_url.present?end@@ -109,8 +98,7 @@ module Samlenddef assertion_consumer_service_url- root_url = OpenProject::StaticRouting::StaticUrlHelpers.new.root_url- URI.join(root_url, "/auth/#{slug}/callback").to_s+ callback_urlendendenddiff --git a/modules/auth_saml/db/migrate/20240801105918_add_saml_provider.rb b/modules/auth_saml/db/migrate/20240801105918_add_saml_provider.rbdeleted file mode 100644index 2eac33eae9f..00000000000--- a/modules/auth_saml/db/migrate/20240801105918_add_saml_provider.rb+++ /dev/null@@ -1,13 +0,0 @@-class AddSamlProvider < ActiveRecord::Migration[7.1]- def change- create_table :saml_providers do |t|- t.string :display_name, null: false, index: { unique: true }- t.boolean :available, null: false, default: true- t.boolean :limit_self_registration, null: false, default: false- t.jsonb :options, default: {}, null: false- t.references :creator, null: false, index: true, foreign_key: { to_table: :users }-- t.timestamps- end- end-end