lib/osso/models/identity_provider.rb in osso-0.0.3.25 vs lib/osso/models/identity_provider.rb in osso-0.0.3.26
- old
+ new
@@ -2,11 +2,10 @@
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
@@ -37,9 +36,17 @@
def set_status
return if status != 'PENDING'
self.status = 'CONFIGURED' if sso_url && sso_cert
+ end
+
+ def active!
+ update(status: 'ACTIVE')
+ end
+
+ def error!
+ update(status: 'ERROR')
end
def root_url
return "https://#{ENV['HEROKU_APP_NAME']}.herokuapp.com" if ENV['HEROKU_APP_NAME']