Class: PhobosCheckpointUI::SamlHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/phobos_checkpoint_ui/saml_handler.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ SamlHandler

Returns a new instance of SamlHandler.



3
4
5
# File 'lib/phobos_checkpoint_ui/saml_handler.rb', line 3

def initialize(data)
  @data = data
end

Class Method Details

.authorized?(user_json) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/phobos_checkpoint_ui/saml_handler.rb', line 7

def self.authorized?(user_json)
  true
end

.username(user_json) ⇒ Object



11
12
13
14
15
# File 'lib/phobos_checkpoint_ui/saml_handler.rb', line 11

def self.username(user_json)
  return 'unknown_user' unless user_json

  JSON(user_json).dig('username')
end

Instance Method Details

#userObject



17
18
19
# File 'lib/phobos_checkpoint_ui/saml_handler.rb', line 17

def user
  { username: 'checkpoint_ui_user' }
end