Class: BetterAuth::Auth
- Inherits:
-
Object
- Object
- BetterAuth::Auth
- Defined in:
- lib/better_auth/auth.rb
Constant Summary collapse
- TELEMETRY_ADAPTER_IDS =
{ "BetterAuth::Adapters::Memory" => "memory", "BetterAuth::Adapters::Postgres" => "postgres", "BetterAuth::Adapters::MySQL" => "mysql", "BetterAuth::Adapters::SQLite" => "sqlite", "BetterAuth::Adapters::MSSQL" => "mssql" }.freeze
- TELEMETRY_DATABASE_IDS =
{ memory: "memory", postgres: "postgres", mysql: "mysql", sqlite: "sqlite", mssql: "mssql" }.freeze
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#error_codes ⇒ Object
readonly
Returns the value of attribute error_codes.
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#telemetry ⇒ Object
readonly
Returns the value of attribute telemetry.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(options = {}) ⇒ Auth
constructor
A new instance of Auth.
Constructor Details
#initialize(options = {}) ⇒ Auth
Returns a new instance of Auth.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/better_auth/auth.rb', line 23 def initialize( = {}) @options = Configuration.new() @context = Context.new(@options) @context.set_adapter(build_adapter) @context.set_internal_adapter(Adapters::InternalAdapter.new(@context.adapter, @options)) @plugin_registry = PluginRegistry.new(@context) @plugin_registry.run_init! @error_codes = build_error_codes @endpoints = build_endpoints Router.check_endpoint_conflicts(@options, @options.logger) @api = API.new(@context, @endpoints) @handler = Router.new(@context, @endpoints) @telemetry = build_telemetry_publisher end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
21 22 23 |
# File 'lib/better_auth/auth.rb', line 21 def api @api end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
21 22 23 |
# File 'lib/better_auth/auth.rb', line 21 def context @context end |
#error_codes ⇒ Object (readonly)
Returns the value of attribute error_codes.
21 22 23 |
# File 'lib/better_auth/auth.rb', line 21 def error_codes @error_codes end |
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
21 22 23 |
# File 'lib/better_auth/auth.rb', line 21 def handler @handler end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
21 22 23 |
# File 'lib/better_auth/auth.rb', line 21 def @options end |
#telemetry ⇒ Object (readonly)
Returns the value of attribute telemetry.
21 22 23 |
# File 'lib/better_auth/auth.rb', line 21 def telemetry @telemetry end |
Instance Method Details
#call(env) ⇒ Object
38 39 40 |
# File 'lib/better_auth/auth.rb', line 38 def call(env) handler.call(env) end |