Skip to content

class Athena::Security::User::InMemory
inherits Reference #

The user loaded by an ASEC::User::Provider::InMemory.

It is not meant to be used for anything else.

Included modules

Athena::PasswordHasher::PasswordAuthenticatedUserInterface Athena::Security::User::EquatableInterface Athena::Security::User::Interface

Constructors#

.new(username : String, password : String | Nil, roles : Array(String) = [] of String, enabled : Bool = true)#

View source

Methods#

#enabled? : Bool#

Returns true if this user is enabled, otherwise false.

Disabled users are prevented from logging in by an ASEC::User::Checker::InMemory.

View source

#equal_to?(user : ASEC::User::Interface) : Bool#

Returns true if this user and the provided user are equal in the security context, otherwise false.

The comparison should not be based on the identity of the users, e.g. their IDs, but on the attributes that would require them to authenticate again when changed, such as their password.

View source

#password : String | ::Nil#

Returns the hashed password of this user, if any.

View source

#roles : Array(String)#

Returns the roles granted to this user, e.g. ["ROLE_USER"].

View source

#to_s(io : IO) : Nil#

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
View source

#user_identifier : String#

Returns the identifier of this user, e.g. its username or email address.

The identifier must not be empty.

View source