see: https://github.com/omniauth/omniauth-ldap
class PlaceOS::Model::LdapAuthentication
- PlaceOS::Model::LdapAuthentication
- PlaceOS::Model::ModelBase
- PgORM::Base
- ActiveModel::Model
- Reference
- Object
Overview
see: https://github.com/omniauth/omniauth-ldap
Included Modules
Defined in:
placeos-models/ldap_authentication.crConstant Summary
-
CALLBACKS =
{before_save: [] of Nil, after_save: [] of Nil, before_create: [do self.created_at = self.updated_at = Time.utc end] of Nil, after_create: [] of Nil, before_update: [do self.updated_at = Time.utc end] of Nil, after_update: [] of Nil, before_destroy: [] of Nil, after_destroy: [] of Nil}
-
see: https://github.com/omniauth/omniauth-ldap
-
Log =
::Log.for(self)
-
see: https://github.com/omniauth/omniauth-ldap
Constructors
-
.from_json(string_or_io : String | IO, trusted : Bool = false) : self
see: https://github.com/omniauth/omniauth-ldap
-
.from_json(string_or_io : String | IO, root : String, trusted : Bool = false) : self
Deserializes the given JSON in string_or_io into an instance of
self
, assuming the JSON consists of an JSON object with key root, and whose value is the value to deserialize. -
.from_trusted_json(string_or_io : String | IO, root : String) : self
see: https://github.com/omniauth/omniauth-ldap
-
.from_trusted_json(string_or_io : String | IO) : self
Serialize from a trusted JSON source
-
.from_trusted_yaml(string_or_io : String | IO) : self
Serialize from a trusted YAML source
-
.from_yaml(string_or_io : String | IO, trusted : Bool = false) : self
see: https://github.com/omniauth/omniauth-ldap
-
.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
see: https://github.com/omniauth/omniauth-ldap
-
.new(pull : JSON::PullParser)
see: https://github.com/omniauth/omniauth-ldap
-
.new(rs : DB::ResultSet)
see: https://github.com/omniauth/omniauth-ldap
-
.new(created_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, updated_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, name : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, port : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, auth_method : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, uid : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, host : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, base : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, bind_dn : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, password : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, filter : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, authority_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new)
see: https://github.com/omniauth/omniauth-ldap
-
.new(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Initialize PlaceOS::Model::LdapAuthentication from
HTTP::Params
.
Class Method Summary
-
.attributes : Array(Symbol)
Returns all attribute keys.
-
.auto_generate_id : Bool
see: https://github.com/omniauth/omniauth-ldap
-
.by_authority_id(id)
Look up instances of this model dependent on the foreign key
-
.changes(id : PrimaryKeyType = nil) : ChangeFeed
Changefeed at row (if
#id
passed) or whole table level. -
.elastic
see: https://github.com/omniauth/omniauth-ldap
-
.from_rs(__temp_604 : DB::ResultSet)
see: https://github.com/omniauth/omniauth-ldap
-
.on_error(err : Exception | IO::Error)
see: https://github.com/omniauth/omniauth-ldap
-
.primary_key : Symbol
see: https://github.com/omniauth/omniauth-ldap
-
.table_name
see: https://github.com/omniauth/omniauth-ldap
Instance Method Summary
- #__authority : Authority | Nil
- #__authority=(__authority : Authority | Nil)
-
#after_create
see: https://github.com/omniauth/omniauth-ldap
-
#after_destroy
see: https://github.com/omniauth/omniauth-ldap
-
#after_initialize(trusted : Bool)
see: https://github.com/omniauth/omniauth-ldap
-
#after_save
see: https://github.com/omniauth/omniauth-ldap
-
#after_update
see: https://github.com/omniauth/omniauth-ldap
-
#apply_defaults
Generate code to apply default values
-
#assign_attributes(created_at : Time | Missing = Missing, updated_at : Time | Missing = Missing, name : String | Missing = Missing, port : Int32 | Missing = Missing, auth_method : String | Missing = Missing, uid : String | Missing = Missing, host : String | Missing = Missing, base : String | Missing = Missing, bind_dn : String | Nil | Missing = Missing, password : String | Nil | Missing = Missing, filter : String | Nil | Missing = Missing, authority_id : String | Nil | Missing = Missing, id : String | Nil | Missing = Missing)
Assign to multiple attributes.
-
#assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Assign to mulitple attributes via
HTTP::Params
. -
#assign_attributes(model : PlaceOS::Model::LdapAuthentication)
Assign to multiple attributes from a model object
-
#assign_attributes_from_json(json, root : String)
see: https://github.com/omniauth/omniauth-ldap
-
#assign_attributes_from_json(json)
see: https://github.com/omniauth/omniauth-ldap
-
#assign_attributes_from_trusted_json(json, root : String)
see: https://github.com/omniauth/omniauth-ldap
-
#assign_attributes_from_trusted_json(json)
Assign each field from JSON if field exists in JSON and has changed in model
-
#assign_attributes_from_trusted_yaml(yaml)
see: https://github.com/omniauth/omniauth-ldap
-
#assign_attributes_from_yaml(yaml)
Uses the YAML parser as JSON is valid YAML
-
#attributes
Returns a
Hash
of all attribute values -
#attributes_tuple
Returns a
NamedTuple
of all attribute values. -
#auth_method : String
#auth_method
getter -
#auth_method=(value : String)
#auth_method
setter -
#auth_method? : String | Nil
One of
"plain"
,"ssl
","tls"
-
#auth_method_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#auth_method_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#auth_method_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#auth_method_default : String
#auth_method
's default value -
#auth_method_present? : Bool
One of
"plain"
,"ssl
","tls"
-
#auth_method_was : String | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#auth_method_will_change! : Nil
Include
#auth_method
in the set of changed attributes, whether it has changed or not. -
#authority : Authority | Nil
Retrieves the parent relationship
- #authority! : Authority
-
#authority=(parent : Authority)
Sets the parent relationship
-
#authority_id : String | Nil
#authority_id
getter -
#authority_id=(value : String | Nil)
#authority_id
setter -
#authority_id_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#authority_id_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#authority_id_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#authority_id_default : String | Nil
#authority_id
's default value - #authority_id_present? : Bool
-
#authority_id_was : String | Nil | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#authority_id_will_change! : Nil
Include
#authority_id
in the set of changed attributes, whether it has changed or not. -
#base : String
#base
getter -
#base=(value : String)
#base
setter -
#base? : String | Nil
BaseDN such as dc=intridea, dc=com
-
#base_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#base_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#base_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#base_default : String
#base
's default value -
#base_present? : Bool
BaseDN such as dc=intridea, dc=com
-
#base_was : String | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#base_will_change! : Nil
Include
#base
in the set of changed attributes, whether it has changed or not. -
#before_create
see: https://github.com/omniauth/omniauth-ldap
-
#before_destroy
see: https://github.com/omniauth/omniauth-ldap
-
#before_save
see: https://github.com/omniauth/omniauth-ldap
-
#before_update
see: https://github.com/omniauth/omniauth-ldap
-
#bind_dn : String | Nil
#bind_dn
getter -
#bind_dn=(value : String | Nil)
#bind_dn
setter -
#bind_dn_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#bind_dn_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#bind_dn_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#bind_dn_default : String | Nil
#bind_dn
's default value - #bind_dn_present? : Bool
-
#bind_dn_was : String | Nil | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#bind_dn_will_change! : Nil
Include
#bind_dn
in the set of changed attributes, whether it has changed or not. -
#changed?
Check if any attributes have changed.
-
#changed_attributes
Returns a
Hash
with all changed attributes. -
#changed_json(io : IO) : Nil
Serialize the set of changed attributes to JSON.
-
#changed_json : String
Serialize the set of changed attributes to JSON.
-
#changed_persist_attributes
see: https://github.com/omniauth/omniauth-ldap
-
#changed_yaml(io : IO) : Nil
Serialize the set of changed attributes to YAML.
-
#changed_yaml : String
Serialize the set of changed attributes to YAML.
-
#clear_changes_information
Reset changes for all attributes.
-
#created_at : Time
#created_at
getter -
#created_at=(value : Time)
Setters
#created_at
setter - #created_at? : Time | Nil
-
#created_at_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#created_at_change : Tuple(Time | Nil, Time | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#created_at_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#created_at_default : Time
#created_at
's default value - #created_at_present? : Bool
-
#created_at_was : Time | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#created_at_will_change! : Nil
Include
#created_at
in the set of changed attributes, whether it has changed or not. -
#filter : String | Nil
#filter
getter -
#filter=(value : String | Nil)
#filter
setter -
#filter_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#filter_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#filter_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#filter_default : String | Nil
#filter
's default value -
#filter_present? : Bool
LDAP filter like: (&(uid=%{username})(memberOf=cn=myapp-users,ou=groups,dc=example,dc=com)) Can be used instead of
#uid
-
#filter_was : String | Nil | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#filter_will_change! : Nil
Include
#filter
in the set of changed attributes, whether it has changed or not. -
#host : String
#host
getter -
#host=(value : String)
#host
setter - #host? : String | Nil
-
#host_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#host_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#host_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#host_default : String
#host
's default value - #host_present? : Bool
-
#host_was : String | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#host_will_change! : Nil
Include
#host
in the set of changed attributes, whether it has changed or not. -
#id : String | Nil
#id
getter -
#id=(value : String | Nil)
#id
setter -
#id? : String | Nil | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#id_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#id_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#id_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#id_default : String | Nil
#id
's default value -
#id_present? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#id_was : String | Nil | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#id_will_change! : Nil
Include
#id
in the set of changed attributes, whether it has changed or not. -
#invoke_props
see: https://github.com/omniauth/omniauth-ldap
-
#name : String
#name
getter -
#name=(value : String)
#name
setter - #name? : String | Nil
-
#name_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#name_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#name_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#name_default : String
#name
's default value - #name_present? : Bool
-
#name_was : String | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#name_will_change! : Nil
Include
#name
in the set of changed attributes, whether it has changed or not. -
#password : String | Nil
#password
getter -
#password=(value : String | Nil)
#password
setter -
#password_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#password_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#password_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#password_default : String | Nil
#password
's default value -
#password_present? : Bool
#bind_dn
's default value -
#password_was : String | Nil | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#password_will_change! : Nil
Include
#password
in the set of changed attributes, whether it has changed or not. -
#persistent_attributes
see: https://github.com/omniauth/omniauth-ldap
-
#port : Int32
#port
getter -
#port=(value : Int32)
#port
setter - #port? : Int32 | Nil
-
#port_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#port_change : Tuple(Int32 | Nil, Int32 | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#port_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#port_default : Int32
#port
's default value - #port_present? : Bool
-
#port_was : Int32 | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#port_will_change! : Nil
Include
#port
in the set of changed attributes, whether it has changed or not. - #reset_associations
-
#restore_attributes
Reset each attribute to their previous values and clears all changes.
-
#run_create_callbacks(&)
Wrap a block with callbacks for the appropriate crud operation
-
#run_destroy_callbacks(&)
see: https://github.com/omniauth/omniauth-ldap
-
#run_save_callbacks(&)
see: https://github.com/omniauth/omniauth-ldap
-
#run_update_callbacks(&)
see: https://github.com/omniauth/omniauth-ldap
-
#table_name
see: https://github.com/omniauth/omniauth-ldap
-
#uid : String
#uid
getter -
#uid=(value : String)
#uid
setter - #uid? : String | Nil
-
#uid_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#uid_change : Tuple(String | Nil, String | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#uid_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#uid_default : String
#uid
's default value - #uid_present? : Bool
-
#uid_was : String | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#uid_will_change! : Nil
Include
#uid
in the set of changed attributes, whether it has changed or not. -
#updated_at : Time
#updated_at
getter -
#updated_at=(value : Time)
#updated_at
setter - #updated_at? : Time | Nil
-
#updated_at_assigned? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#updated_at_change : Tuple(Time | Nil, Time | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#updated_at_changed? : Bool
see: https://github.com/omniauth/omniauth-ldap
-
#updated_at_default : Time
#updated_at
's default value - #updated_at_present? : Bool
-
#updated_at_was : Time | Nil
see: https://github.com/omniauth/omniauth-ldap
-
#updated_at_will_change! : Nil
Include
#updated_at
in the set of changed attributes, whether it has changed or not. -
#validate_nilability
Validate that all non-nillable fields have values.
Instance methods inherited from class PlaceOS::Model::ModelBase
after_create
after_create,
after_destroy
after_destroy,
after_save
after_save,
after_update
after_update,
apply_defaults
apply_defaults,
assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))assign_attributes(model : PlaceOS::Model::ModelBase)
assign_attributes assign_attributes, attributes attributes, attributes_tuple attributes_tuple, before_create before_create, before_destroy before_destroy, before_save before_save, before_update before_update, invoke_props invoke_props, persistent_attributes persistent_attributes, run_create_callbacks(&) run_create_callbacks, run_destroy_callbacks(&) run_destroy_callbacks, run_save_callbacks(&) run_save_callbacks, run_update_callbacks(&) run_update_callbacks
Constructor methods inherited from class PlaceOS::Model::ModelBase
new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)new(pull : JSON::PullParser)
new(rs : DB::ResultSet) new
Class methods inherited from class PlaceOS::Model::ModelBase
attributes : Array(Symbol)
attributes,
auto_generate_id : Bool
auto_generate_id,
from_rs(rs : DB::ResultSet)
from_rs,
primary_key : Symbol
primary_key
Instance methods inherited from module PlaceOS::Model::Associations
format_list_for_postgres(list : Enumerable(String)) : String
format_list_for_postgres,
reset_associations
reset_associations
Class methods inherited from module PlaceOS::Model::Associations
format_list_for_postgres(list : Enumerable(String)) : String
format_list_for_postgres
Macros inherited from module PlaceOS::Model::Associations
belongs_to(parent_class, dependent = :none, association_name = nil, foreign_key = nil, presence = false, pk_type = nil, serialize = true)
belongs_to,
has_many(child_class, collection_name = nil, dependent = :none, foreign_key = nil, serialize = false)
has_many,
has_one(child_class, dependent = :none, association_name = nil, presence = false)
has_one
Constructor Detail
see: https://github.com/omniauth/omniauth-ldap
Deserializes the given JSON in string_or_io into
an instance of self
, assuming the JSON consists
of an JSON object with key root, and whose value is
the value to deserialize. Will not deserialise from
fields with mass_assign: false
class User < ActiveModel::Model
attribute name : String
attribute google_id : UUID, mass_assign: false
end
User.from_json(%({"main": {"name": "Jason", "google_id": "f6f70bfb-c882-446d-8758-7ce47db39620"}}), root: "main") # => #<User:0x103131b20 @name="Jason">
see: https://github.com/omniauth/omniauth-ldap
Serialize from a trusted JSON source
Serialize from a trusted YAML source
see: https://github.com/omniauth/omniauth-ldap
see: https://github.com/omniauth/omniauth-ldap
see: https://github.com/omniauth/omniauth-ldap
Initialize PlaceOS::Model::LdapAuthentication from HTTP::Params
.
Class Method Detail
Changefeed at row (if #id
passed) or whole table level.
Returns a ChangeFeed
instance which can be used to invoke async callbacks via on
or
use blocking Iterator
via each
method.
Instance Method Detail
Assign to multiple attributes.
Assign to mulitple attributes via HTTP::Params
.
Assign to multiple attributes from a model object
see: https://github.com/omniauth/omniauth-ldap
see: https://github.com/omniauth/omniauth-ldap
Assign each field from JSON if field exists in JSON and has changed in model
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #auth_method
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #authority_id
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #base
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #bind_dn
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #created_at
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
LDAP filter like: (&(uid=%{username})(memberOf=cn=myapp-users,ou=groups,dc=example,dc=com))
Can be used instead of #uid
Include #filter
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #host
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #id
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #name
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #password
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #port
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #uid
in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #updated_at
in the set of changed attributes, whether it has changed or not.