Skip to content
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

✨ Cache server capabilities and add #capable?(name) #156

Merged
merged 4 commits into from
Jul 22, 2023

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Jul 16, 2023

Updated methods:

  • #initialize - save capabilities in OK or PREAUTH greeting
  • #capability - always update saved capabilities
  • #starttls - always clear capabilities after tagged OK response
  • #authenticate - clear capabilities or update from tagged OK response
  • #login - clear capabilities or update from tagged OK response

New methods:

  • #capable?(name) - the primary API for discovering capabilities
  • #auth_capable?(name) - returns whether a SASL mechanism is supported
  • #auth_mechanisms - returns the server's supported SASL mechanisms
  • #capabilities - calls capability when needed
  • #capabilities_cached? - whether capabilities are cached
  • #clear_cached_capabilities - clears the cache

Fixes #31
Related issues:

@nevans nevans changed the title ✨ Cache server capabilities and add `#capable?(name) ✨ Cache server capabilities and add #capable?(name) Jul 16, 2023
@nevans nevans force-pushed the cached-capabilities branch 2 times, most recently from 4d26793 to 75043c8 Compare July 17, 2023 02:20
@nevans nevans force-pushed the cached-capabilities branch 2 times, most recently from 474fdbe to 1497b24 Compare July 17, 2023 13:07
@nevans nevans requested review from shugo and hsbt July 17, 2023 13:13
@nevans nevans force-pushed the cached-capabilities branch 7 times, most recently from 27554f6 to d611853 Compare July 21, 2023 13:50
@nevans nevans force-pushed the cached-capabilities branch from b7c61c6 to 452f10f Compare July 22, 2023 13:31
This simplifies using Net::IMAP::FakeServer in multiple test suites.
@nevans nevans force-pushed the cached-capabilities branch 2 times, most recently from ecc6bd1 to 7ed848d Compare July 22, 2023 14:27
This update started as a cleanup of the capabilities documentation, but
along the way it became something bigger.

Because yard doesn't honor the `#--` and `#++` delimiters, most of the
TODO comments have been either removed or converted into readable
documentation of the missing features.
@nevans nevans force-pushed the cached-capabilities branch from 7ed848d to d4ea5d8 Compare July 22, 2023 17:32
Updated methods:
* `#initialize` - save capabilities in `OK` or `PREAUTH` greeting
* `#capability` - always update saved capabilities
* `#starttls` - always clear capabilities after tagged OK response
* `#authenticate` - clear capabilities or update from tagged OK response
* `#login` - clear capabilities or update from tagged OK response

New methods:
* `#capable?(name)` - the primary API for discovering capabilities
* `#auth_capable?(name)` - returns whether a SASL mechanism is supported
* `#auth_mechanisms` - returns the server's supported SASL mechanisms
* `#capabilities` - cached version of `capability`
* `#capabilities_cached?` - whether capabilities are cached
* `#clear_cached_capabilities` - clears the cache

Also, the docs related to capabilities were reorganized and rewritten.

Fixes ruby#31.
@nevans nevans force-pushed the cached-capabilities branch from d4ea5d8 to b0f8b9e Compare July 22, 2023 17:35
@nevans nevans merged commit 35fd1bc into ruby:master Jul 22, 2023
@nevans nevans deleted the cached-capabilities branch July 22, 2023 18:35
@nevans nevans added the IMAP4rev1 Requirement for IMAP4rev1, RFC3501 label Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IMAP4rev1 Requirement for IMAP4rev1, RFC3501
Development

Successfully merging this pull request may close these issues.

cache capabilities and add capability?(name)
1 participant