-
-
Notifications
You must be signed in to change notification settings - Fork 158
🏷️ RBS Types #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
🏷️ RBS Types #99
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Top-level signature file for the gem. Detailed signatures live in the files below: | ||
| # - sig/omniauth/ldap/version.rbs | ||
| # - sig/omniauth/ldap/adaptor.rbs | ||
| # - sig/omniauth/strategies/ldap.rbs | ||
| # This file is intentionally minimal to avoid duplicating declarations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| module OmniAuth | ||
| module LDAP | ||
| class Adaptor | ||
| class LdapError < ::StandardError | ||
| end | ||
|
|
||
| class ConfigurationError < ::StandardError | ||
| end | ||
|
|
||
| class AuthenticationError < ::StandardError | ||
| end | ||
|
|
||
| class ConnectionError < ::StandardError | ||
| end | ||
|
|
||
| VALID_ADAPTER_CONFIGURATION_KEYS: Array[Symbol] | ||
| MUST_HAVE_KEYS: Array[untyped] | ||
| METHOD: Hash[Symbol, Symbol?] | ||
|
|
||
| attr_accessor bind_dn: String? | ||
| attr_accessor password: String? | ||
|
|
||
| # Net::LDAP is provided by the net-ldap gem; we reference it here for clarity. | ||
| attr_reader connection: Net::LDAP | ||
| attr_reader uid: String? | ||
| attr_reader base: String? | ||
| # auth is the hash passed to Net::LDAP#auth or similar | ||
| attr_reader auth: Hash[Symbol, untyped] | ||
| # filter is an LDAP filter string when configured | ||
| attr_reader filter: String? | ||
|
|
||
| # Validate that required keys exist in the configuration | ||
| def self.validate: (?Hash[Symbol, untyped]) -> void | ||
| def initialize: (?Hash[Symbol, untyped]) -> void | ||
|
|
||
| # Perform a search and optionally bind; returns the matched entry or false | ||
| def bind_as: (?Hash[Symbol, untyped]) -> (Net::LDAP::Entry? | false) | ||
|
|
||
| private | ||
|
|
||
| # Returns a Net::LDAP encryption symbol (e.g. :simple_tls, :start_tls) or nil | ||
| def ensure_method: (untyped) -> Symbol? | ||
|
|
||
| # Returns an array of SASL auth hashes | ||
| def sasl_auths: (?Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]] | ||
|
|
||
| # Returns initial credential (string) and a proc that accepts a challenge and returns the response | ||
| # Use Array[untyped] here to avoid tuple syntax issues in some linters; the runtime value | ||
| # is commonly a two-element array [initial_credential, proc]. | ||
| def sasl_bind_setup_digest_md5: (?Hash[Symbol, untyped]) -> Array[untyped] | ||
| def sasl_bind_setup_gss_spnego: (?Hash[Symbol, untyped]) -> Array[untyped] | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| module OmniAuth | ||
| module LDAP | ||
| module Version | ||
| VERSION: String | ||
| end | ||
|
|
||
| # Traditional constant alias | ||
| VERSION: String | ||
| end | ||
| end | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| module OmniAuth | ||
| module Strategies | ||
| class LDAP | ||
| OMNIAUTH_GTE_V2: bool | ||
|
|
||
| # CONFIG is a read-only mapping of string keys to mapping definitions | ||
| CONFIG: Hash[String, untyped] | ||
|
|
||
| # The request_phase either returns a Rack-compatible response or the form response. | ||
| def request_phase: () -> (Rack::Response | Array[untyped] | String) | ||
|
|
||
| # The callback_phase may call super (untyped) or return a failure symbol | ||
| def callback_phase: () -> untyped | ||
|
|
||
| # Accepts an adaptor and returns a Net::LDAP::Filter or similar | ||
| def filter: (OmniAuth::LDAP::Adaptor) -> Net::LDAP::Filter | ||
|
|
||
| # Map a user object (Net::LDAP::Entry-like) into a Hash for the auth info | ||
| def self.map_user: (Hash[String, untyped], untyped) -> Hash[String, untyped] | ||
|
|
||
| def missing_credentials?: () -> bool | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Minimal stubs for net-ldap types used by the gem | ||
| module Net | ||
| class LDAP | ||
| def initialize: (Hash[Symbol, untyped]) -> void | ||
| def open: () { (self) -> untyped } -> untyped | ||
| def search: (?Hash[Symbol, untyped]) -> Array[Net::LDAP::Entry] | ||
| def bind: (?Hash[Symbol, untyped]) -> bool | ||
| end | ||
|
|
||
| class LDAP::Entry | ||
| def dn: () -> String | ||
| end | ||
|
|
||
| class LDAP::Filter | ||
| def self.construct: (String) -> Net::LDAP::Filter | ||
| def self.eq: (String, String) -> Net::LDAP::Filter | ||
| end | ||
| end | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Minimal stubs for net-ntlm types used by the gem | ||
| module Net | ||
| module NTLM | ||
| class Message | ||
| def self.parse: (untyped) -> Net::NTLM::Message | ||
| def response: (?Hash[Symbol, untyped], ?Hash[Symbol, untyped]) -> Net::NTLM::Message | ||
| end | ||
|
|
||
| class Message::Type1 | ||
| def serialize: () -> String | ||
| end | ||
|
|
||
| def self.encode_utf16le: (String) -> String | ||
| end | ||
| end | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Minimal stubs for SASL bindings used in tests | ||
| module SASL | ||
| class Preferences | ||
| def initialize: (?Hash[Symbol, untyped]) -> void | ||
| end | ||
|
|
||
| class SASL | ||
| def initialize: (String, SASL::Preferences) -> void | ||
| def receive: (String, untyped) -> [untyped, untyped] | ||
| end | ||
| end | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.