Skip to content

Commit 7dddeaa

Browse files
authored
Merge pull request #99 from omniauth/feat/docs
2 parents a27e33b + 59760d1 commit 7dddeaa

File tree

11 files changed

+149
-13
lines changed

11 files changed

+149
-13
lines changed

.junie/guidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This document captures project-specific knowledge to streamline setup, testing,
1212
- See .env.local.example for an example of what to put in .env.local.
1313
- See CONTRIBUTING.md for details on how to set up your local environment.
1414
- Ruby and Bundler
15-
- Runtime supports Ruby >= 0
15+
- Runtime supports Ruby >= 2.0
1616
- Development tooling targets Ruby >= 2.3 (minimum supported by setup-ruby GHA).
1717
- Use a recent Ruby (>= 3.4 recommended) for fastest setup and to exercise modern coverage behavior.
1818
- Install dependencies via Bundler in project root:

.opencollective.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
| 📍 NOTE |
22
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
33
| RubyGems (the [GitHub org][rubygems-org], not the website) [suffered][draper-security] a [hostile takeover][ellen-takeover] in September 2025. |
4+
| Ultimately [4 maintainers][simi-removed] were [hard removed][martin-removed] and a reason has been given for only 1 of those, while 2 others resigned in protest. |
45
| It is a [complicated story][draper-takeover] which is difficult to [parse quickly][draper-lies]. |
56
| I'm adding notes like this to gems because I [don't condone theft][draper-theft] of repositories or gems from their rightful owners. |
67
| If a similar theft happened with my repos/gems, I'd hope some would stand up for me. |
@@ -37,6 +38,7 @@
3738

3839
# 📁 OmniAuth LDAP
3940

41+
[![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license-ref] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![Open Source Helpers][👽oss-helpi]][👽oss-help] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Supported][🚎6-s-wfi]][🚎6-s-wf] [![CI Legacy][🚎4-lg-wfi]][🚎4-lg-wf] [![CI Unsupported][🚎7-us-wfi]][🚎7-us-wf] [![CI Ancient][🚎1-an-wfi]][🚎1-an-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Apache SkyWalking Eyes License Compatibility Check][🚎15-🪪-wfi]][🚎15-🪪-wf]
4042

4143
`if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know][🖼️galtzo-discord], as I may have missed the [discord notification][🖼️galtzo-discord].
4244

@@ -75,10 +77,9 @@ All of the listed options are required, with the exception of `:title`, `:name_p
7577
| Works with Truffle Ruby | ![Truffle Ruby 22.3 Compat][💎truby-22.3i] ![Truffle Ruby 23.0 Compat][💎truby-23.0i] <br/> [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎9-t-wf] [![Truffle Ruby 24.1 Compat][💎truby-c-i]][🚎11-c-wf] |
7678
| Works with MRI Ruby 3 | [![Ruby 3.0 Compat][💎ruby-3.0i]][🚎4-lg-wf] [![Ruby 3.1 Compat][💎ruby-3.1i]][🚎6-s-wf] [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎6-s-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎6-s-wf] [![Ruby 3.4 Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf] |
7779
| Works with MRI Ruby 2 | ![Ruby 2.0 Compat][💎ruby-2.0i] ![Ruby 2.1 Compat][💎ruby-2.1i] ![Ruby 2.2 Compat][💎ruby-2.2i] <br/> [![Ruby 2.3 Compat][💎ruby-2.3i]][🚎1-an-wf] [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎1-an-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎1-an-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎7-us-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎7-us-wf] |
78-
| Works with MRI Ruby 1 | ![Ruby 1.8 Compat][💎ruby-1.8i] ![Ruby 1.9 Compat][💎ruby-1.9i] |
7980
| Support & Community | [![Join Me on Daily.dev's RubyFriends][✉️ruby-friends-img]][✉️ruby-friends] [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] [![Get help from me on Upwork][👨🏼‍🏫expsup-upwork-img]][👨🏼‍🏫expsup-upwork] [![Get help from me on Codementor][👨🏼‍🏫expsup-codementor-img]][👨🏼‍🏫expsup-codementor] |
80-
| Source | [![Source on Github.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
81-
| Documentation | [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![YARD on Galtzo.com][📜docs-head-rd-img]][🚎yard-head] [![Maintainer Blog][🚂maint-blog-img]][🚂maint-blog] [![GitHub Wiki][📜gh-wiki-img]][📜gh-wiki] |
81+
| Source | [![Source on Github.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
82+
| Documentation | [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![YARD on Galtzo.com][📜docs-head-rd-img]][🚎yard-head] [![Maintainer Blog][🚂maint-blog-img]][🚂maint-blog] [![GitHub Wiki][📜gh-wiki-img]][📜gh-wiki] |
8283
| Compliance | [![License: MIT][📄license-img]][📄license-ref] [![Compatible with Apache Software Projects: Verified by SkyWalking Eyes][📄license-compat-img]][📄license-compat] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] |
8384
| Style | [![Enforced Code Style Linter][💎rlts-img]][💎rlts] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] [![Gitmoji Commits][📌gitmoji-img]][📌gitmoji] [![Compatibility appraised by: appraisal2][💎appraisal2-img]][💎appraisal2] |
8485
| Maintainer 🎖️ | [![Follow Me on LinkedIn][💖🖇linkedin-img]][💖🖇linkedin] [![Follow Me on Ruby.Social][💖🐘ruby-mast-img]][💖🐘ruby-mast] [![Follow Me on Bluesky][💖🦋bluesky-img]][💖🦋bluesky] [![Contact Maintainer][🚂maint-contact-img]][🚂maint-contact] [![My technical writing][💖💁🏼‍♂️devto-img]][💖💁🏼‍♂️devto] |
@@ -92,7 +93,7 @@ Compatible with MRI Ruby 2.0+, and concordant releases of JRuby, and TruffleRuby
9293
|------------------------------------------------|--------------------------------------------------------|
9394
| 👟 Check it out! |[github.com/appraisal-rb/appraisal2][💎appraisal2]|
9495

95-
### Ruby 3.4
96+
#### Ruby 3.4
9697

9798
nkf/kconv has been part of Ruby since long ago.
9899
Eventually it became a standard gem, but was changed to a bundled gem in Ruby 3.4.
@@ -547,7 +548,6 @@ Thanks for RTFM. ☺️
547548
[🏙️entsup-tidelift-sonar]: https://blog.tidelift.com/tidelift-joins-sonar
548549
[💁🏼‍♂️peterboling]: http://www.peterboling.com
549550
[🚂railsbling]: http://www.railsbling.com
550-
[📜src-cb]: https://codeberg.org/omniauth/omniauth-ldap
551551
[📜src-gh-img]: https://img.shields.io/badge/GitHub-238636?style=for-the-badge&logo=Github&logoColor=green
552552
[📜src-gh]: https://github.com/omniauth/omniauth-ldap
553553
[📜docs-cr-rd-img]: https://img.shields.io/badge/RubyDoc-Current_Release-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
@@ -600,8 +600,6 @@ Thanks for RTFM. ☺️
600600
[🚎14-🔓️-wfi]: https://github.com/omniauth/omniauth-ldap/actions/workflows/unlocked_deps.yml/badge.svg
601601
[🚎15-🪪-wf]: https://github.com/omniauth/omniauth-ldap/actions/workflows/license-eye.yml
602602
[🚎15-🪪-wfi]: https://github.com/omniauth/omniauth-ldap/actions/workflows/license-eye.yml/badge.svg
603-
[💎ruby-1.8i]: https://img.shields.io/badge/Ruby-1.8_(%F0%9F%9A%ABCI)-AABBCC?style=for-the-badge&logo=ruby&logoColor=white
604-
[💎ruby-1.9i]: https://img.shields.io/badge/Ruby-1.9_(%F0%9F%9A%ABCI)-AABBCC?style=for-the-badge&logo=ruby&logoColor=white
605603
[💎ruby-2.0i]: https://img.shields.io/badge/Ruby-2.0_(%F0%9F%9A%ABCI)-AABBCC?style=for-the-badge&logo=ruby&logoColor=white
606604
[💎ruby-2.1i]: https://img.shields.io/badge/Ruby-2.1_(%F0%9F%9A%ABCI)-AABBCC?style=for-the-badge&logo=ruby&logoColor=white
607605
[💎ruby-2.2i]: https://img.shields.io/badge/Ruby-2.2_(%F0%9F%9A%ABCI)-AABBCC?style=for-the-badge&logo=ruby&logoColor=white
@@ -645,7 +643,7 @@ Thanks for RTFM. ☺️
645643
[📗keep-changelog]: https://keepachangelog.com/en/1.0.0/
646644
[📗keep-changelog-img]: https://img.shields.io/badge/keep--a--changelog-1.0.0-34495e.svg?style=flat
647645
[📌gitmoji]:https://gitmoji.dev
648-
[📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
646+
[📌gitmoji-img]:https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
649647
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
650648
[🧮kloc-img]: https://img.shields.io/badge/KLOC-4.076-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
651649
[🔐security]: SECURITY.md

omniauth-ldap.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Gem::Specification.new do |spec|
115115
# visibility and discoverability.
116116
# However, development dependencies in gemspec will install on
117117
# all versions of Ruby that will run in CI.
118-
# This gem, and its gemspec runtime dependencies, will install on Ruby down to 0.
118+
# This gem, and its gemspec runtime dependencies, will install on Ruby down to 2.0.
119119
# This gem, and its gemspec development dependencies, will install on Ruby down to 2.3.
120120
# Thus, dev dependencies in gemspec must have
121121
#

sig/omniauth-ldap.rbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

sig/omniauth/ldap/adaptor.rbs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

sig/omniauth/ldap/version.rbs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+

sig/omniauth/strategies/ldap.rbs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
def filter: (OmniAuth::LDAP::Adaptor) -> Net::LDAP::Filter
17+
18+
# Map a user object (Net::LDAP::Entry-like) into a Hash for the auth info
19+
def self.map_user: (Hash[String, untyped], untyped) -> Hash[String, untyped]
20+
21+
def missing_credentials?: () -> bool
22+
end
23+
end
24+
end

sig/rbs/net-ldap.rbs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+

sig/rbs/net-ntlm.rbs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+

0 commit comments

Comments
 (0)