Class: Session::SignIn::FormObject

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/session/sign_in/form_object.rb

Overview

Class used as to easily integrate a session form with some basic validation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



7
8
9
# File 'app/models/session/sign_in/form_object.rb', line 7

def password
  @password
end

#usernameObject

Returns the value of attribute username.



7
8
9
# File 'app/models/session/sign_in/form_object.rb', line 7

def username
  @username
end

Class Method Details

.model_nameActiveModel::Name

Defining this method allows us to use some ActiveModel patterns. For example, forms will be identified as sign_in instead of session_sign_in_form_object.

Returns:

  • (ActiveModel::Name)


23
24
25
# File 'app/models/session/sign_in/form_object.rb', line 23

def self.model_name
  ActiveModel::Name.new(self, nil, 'SignIn')
end

Instance Method Details

#sign_inIsaca::Model::AuthenticateUser

This method will attempt to generate a session with the ISACA SSO service

Returns:

  • (Isaca::Model::AuthenticateUser)

Raises:

  • (ISACA::ConnectionError)

    Occurs when a connection could not be established. This could be due to IP whitelisting or an invalid endpoint URL



15
16
17
# File 'app/models/session/sign_in/form_object.rb', line 15

def 
  Isaca::Request::AuthenticateUser.get(username, password) if valid?
end