Sha256: 052e5eb5a18fd5ccfc87157edebbf94efcf4e783694f1c29dbb9c5bafedb438b
Contents?: true
Size: 1.68 KB
Versions: 1
Compression:
Stored size: 1.68 KB
Contents
# frozen_string_literal: true module Osso module Models # Base class for SAML Providers class IdentityProvider < ActiveRecord::Base NAME_FORMAT = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' belongs_to :enterprise_account belongs_to :oauth_client has_many :users before_save :set_status def name service.titlecase end def saml_options { domain: domain, idp_sso_target_url: sso_url, idp_cert: sso_cert, issuer: domain, } end def assertion_consumer_service_url [ root_url, 'auth', 'saml', id, 'callback', ].join('/') end alias acs_url assertion_consumer_service_url def set_status return if status != 'PENDING' self.status = 'CONFIGURED' if sso_url && sso_cert end def root_url ENV['HEROKU_APP_NAME'] || ENV.fetch('BASE_URL') end end end end # == Schema Information # # Table name: identity_providers # # id :uuid not null, primary key # service :string # domain :string not null # sso_url :string # sso_cert :text # enterprise_account_id :uuid # oauth_client_id :uuid # status :enum default("PENDING") # created_at :datetime # updated_at :datetime # # Indexes # # index_identity_providers_on_domain (domain) # index_identity_providers_on_enterprise_account_id (enterprise_account_id) # index_identity_providers_on_oauth_client_id (oauth_client_id) #
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
osso-0.0.3.21 | lib/osso/models/identity_provider.rb |