omniauth-ldap 1.0.5 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/omniauth-ldap.rb CHANGED
@@ -1,4 +1,9 @@
1
+ require "version_gem"
2
+
1
3
  require "omniauth-ldap/version"
2
4
  require "omniauth-ldap/adaptor"
3
- require 'omniauth/strategies/ldap'
5
+ require "omniauth/strategies/ldap"
4
6
 
7
+ OmniAuth::LDAP::Version.class_eval do
8
+ extend VersionGem::Basic
9
+ end
@@ -0,0 +1,54 @@
1
+ module OmniAuth
2
+ module LDAP
3
+ class Adaptor
4
+ class LdapError < ::StandardError
5
+ end
6
+
7
+ class ConfigurationError < ::StandardError
8
+ end
9
+
10
+ class AuthenticationError < ::StandardError
11
+ end
12
+
13
+ class ConnectionError < ::StandardError
14
+ end
15
+
16
+ VALID_ADAPTER_CONFIGURATION_KEYS: Array[Symbol]
17
+ MUST_HAVE_KEYS: Array[untyped]
18
+ METHOD: Hash[Symbol, Symbol?]
19
+
20
+ attr_accessor bind_dn: String?
21
+ attr_accessor password: String?
22
+
23
+ # Net::LDAP is provided by the net-ldap gem; we reference it here for clarity.
24
+ attr_reader connection: Net::LDAP
25
+ attr_reader uid: String?
26
+ attr_reader base: String?
27
+ # auth is the hash passed to Net::LDAP#auth or similar
28
+ attr_reader auth: Hash[Symbol, untyped]
29
+ # filter is an LDAP filter string when configured
30
+ attr_reader filter: String?
31
+
32
+ # Validate that required keys exist in the configuration
33
+ def self.validate: (?Hash[Symbol, untyped]) -> void
34
+ def initialize: (?Hash[Symbol, untyped]) -> void
35
+
36
+ # Perform a search and optionally bind; returns the matched entry or false
37
+ def bind_as: (?Hash[Symbol, untyped]) -> (Net::LDAP::Entry? | false)
38
+
39
+ private
40
+
41
+ # Returns a Net::LDAP encryption symbol (e.g. :simple_tls, :start_tls) or nil
42
+ def ensure_method: (untyped) -> Symbol?
43
+
44
+ # Returns an array of SASL auth hashes
45
+ def sasl_auths: (?Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
46
+
47
+ # Returns initial credential (string) and a proc that accepts a challenge and returns the response
48
+ # Use Array[untyped] here to avoid tuple syntax issues in some linters; the runtime value
49
+ # is commonly a two-element array [initial_credential, proc].
50
+ def sasl_bind_setup_digest_md5: (?Hash[Symbol, untyped]) -> Array[untyped]
51
+ def sasl_bind_setup_gss_spnego: (?Hash[Symbol, untyped]) -> Array[untyped]
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,11 @@
1
+ module OmniAuth
2
+ module LDAP
3
+ module Version
4
+ VERSION: String
5
+ end
6
+
7
+ # Traditional constant alias
8
+ VERSION: String
9
+ end
10
+ end
11
+
@@ -0,0 +1,32 @@
1
+ module OmniAuth
2
+ module Strategies
3
+ class LDAP
4
+ OMNIAUTH_GTE_V2: bool
5
+
6
+ # CONFIG is a read-only mapping of string keys to mapping definitions
7
+ CONFIG: Hash[String, untyped]
8
+
9
+ # The request_phase either returns a Rack-compatible response or the form response.
10
+ def request_phase: () -> (Rack::Response | Array[untyped] | String)
11
+
12
+ # The callback_phase may call super (untyped) or return a failure symbol
13
+ def callback_phase: () -> untyped
14
+
15
+ # Accepts an adaptor and returns a Net::LDAP::Filter or similar
16
+ # Optional second argument allows overriding the username (used for header-based SSO)
17
+ def filter: (OmniAuth::LDAP::Adaptor) -> Net::LDAP::Filter
18
+ | (OmniAuth::LDAP::Adaptor, String?) -> Net::LDAP::Filter
19
+
20
+ # Map a user object (Net::LDAP::Entry-like) into a Hash for the auth info
21
+ def self.map_user: (Hash[String, untyped], untyped) -> Hash[String, untyped]
22
+
23
+ def missing_credentials?: () -> bool
24
+
25
+ # Extract username from a trusted header when enabled
26
+ def header_username: () -> (String | nil)
27
+
28
+ # Perform a directory lookup for a given username; returns an Entry or nil
29
+ def directory_lookup: (OmniAuth::LDAP::Adaptor, String) -> untyped
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,5 @@
1
+ # Top-level signature file for the gem. Detailed signatures live in the files below:
2
+ # - sig/omniauth/ldap/version.rbs
3
+ # - sig/omniauth/ldap/adaptor.rbs
4
+ # - sig/omniauth/strategies/ldap.rbs
5
+ # This file is intentionally minimal to avoid duplicating declarations.
@@ -0,0 +1,19 @@
1
+ # Minimal stubs for net-ldap types used by the gem
2
+ module Net
3
+ class LDAP
4
+ def initialize: (Hash[Symbol, untyped]) -> void
5
+ def open: () { (self) -> untyped } -> untyped
6
+ def search: (?Hash[Symbol, untyped]) -> Array[Net::LDAP::Entry]
7
+ def bind: (?Hash[Symbol, untyped]) -> bool
8
+ end
9
+
10
+ class LDAP::Entry
11
+ def dn: () -> String
12
+ end
13
+
14
+ class LDAP::Filter
15
+ def self.construct: (String) -> Net::LDAP::Filter
16
+ def self.eq: (String, String) -> Net::LDAP::Filter
17
+ end
18
+ end
19
+
@@ -0,0 +1,16 @@
1
+ # Minimal stubs for net-ntlm types used by the gem
2
+ module Net
3
+ module NTLM
4
+ class Message
5
+ def self.parse: (untyped) -> Net::NTLM::Message
6
+ def response: (?Hash[Symbol, untyped], ?Hash[Symbol, untyped]) -> Net::NTLM::Message
7
+ end
8
+
9
+ class Message::Type1
10
+ def serialize: () -> String
11
+ end
12
+
13
+ def self.encode_utf16le: (String) -> String
14
+ end
15
+ end
16
+
data/sig/rbs/sasl.rbs ADDED
@@ -0,0 +1,12 @@
1
+ # Minimal stubs for SASL bindings used in tests
2
+ module SASL
3
+ class Preferences
4
+ def initialize: (?Hash[Symbol, untyped]) -> void
5
+ end
6
+
7
+ class SASL
8
+ def initialize: (String, SASL::Preferences) -> void
9
+ def receive: (String, untyped) -> [untyped, untyped]
10
+ end
11
+ end
12
+
data.tar.gz.sig ADDED
Binary file