Should we create a shared net-sasl gem?
@shugo 已经在做这个了。
开始于 2021年4月28日。
评估
这个 Issue 还没有评估数据。
描述
Currently, the following gems duplicate partial support for a small subset of SASL mechanisms:
- net-imap
- net-smtp
- net-pop (it's actually missing, but it should be in there)
- net-ldap
- blather (XMPP)
- memcached
- dalli (another memcached client)
- ...and probably many others.
This duplication and incomplete support basically defeats the purpose of SASL. It seems to me that SASL is used in a wide enough number of internet protocols that some level of SASL support should be in stdlib. See e.g. it's in java standard edition
We could start with a very simple API, which only handles client-side authentication and doesn't do much more than Net::IMAP already does. Simply providing a standard for pluggable support is useful. E.g here's a starter proposal:
class Net::SASL::Registryto allow non-global config, so e.g. a mechanism could be added toNet::IMAPwithout affecting other libraries.#add_authenticator(name, mechanism_class)#authenticator(name, *args)- both of these methods would also be available from a global registry on
Net::SASL
Net::SASL::Authenticatorinterface (can provide a super-class withNotImplementedErroronperform):#initialize(*credentials, uri: nil)- some mechanisms require the host and port, and supporting that in the generic interface simplifies making clients work properly regardless of which mechanism is selected.
#supports_initial_response?#process(challenge)- just as withNet::IMAP. IR sends anilchallenge#done?- for mechanisms implementing a state machine, users of the library can know it is done without needing to call#performand catch an exception.respond_to?(...)could be used for backwards compatibility with Net::IMAP authenticators which haven't yet been updated to addsupports_initial_response?or#done?.
- utility methods:
Net::SASL.saslprep(string)- implements RFC4013, which is required by some mechanisms and recommended for others
And, of course, we could start by adding the existing Net::IMAP mechanisms. But it would be simple and very useful to add OAUTHBEARER and some others as well.
I've marked #22 as a draft, pending some discussion about this. Is this the correct place to discuss this? Should I create a ticket in the ruby issue tracker?
- #22
- #183
- #187
- #194
- #195
- 主要语言
- Ruby
- 星标
- 121
- 派生
- 47
- 平均合并
- 19 小时 25 分钟
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby/net-imap 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
-
bug
难度 5/5 一周以上 新手友好度 30/100
-
难度 3/5 1-2 天 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 15/100
-
难度 5/5 一周以上 新手友好度 20/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
Websockify heartbeat for vnc_container可能已有人在做 @robinkar 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
needs verification
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 7 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
akitaonrails/ai-book-2026#13 ·
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 63/100
维护者通常 1 天内回复