Separate Forward auth into it's own models + controller
This commit is contained in:
@@ -8,7 +8,7 @@ class Application < ApplicationRecord
|
||||
validates :slug, presence: true, uniqueness: { case_sensitive: false },
|
||||
format: { with: /\A[a-z0-9\-]+\z/, message: "only lowercase letters, numbers, and hyphens" }
|
||||
validates :app_type, presence: true,
|
||||
inclusion: { in: %w[oidc trusted_header saml] }
|
||||
inclusion: { in: %w[oidc saml] }
|
||||
validates :client_id, uniqueness: { allow_nil: true }
|
||||
|
||||
normalizes :slug, with: ->(slug) { slug.strip.downcase }
|
||||
@@ -18,7 +18,6 @@ class Application < ApplicationRecord
|
||||
# Scopes
|
||||
scope :active, -> { where(active: true) }
|
||||
scope :oidc, -> { where(app_type: "oidc") }
|
||||
scope :trusted_header, -> { where(app_type: "trusted_header") }
|
||||
scope :saml, -> { where(app_type: "saml") }
|
||||
|
||||
# Type checks
|
||||
@@ -26,10 +25,6 @@ class Application < ApplicationRecord
|
||||
app_type == "oidc"
|
||||
end
|
||||
|
||||
def trusted_header?
|
||||
app_type == "trusted_header"
|
||||
end
|
||||
|
||||
def saml?
|
||||
app_type == "saml"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user