Skip to content

Commit

Permalink
remove imap auth serde flatten
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed Sep 3, 2024
1 parent f9b02b6 commit fc5a999
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 29 deletions.
27 changes: 23 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## [Unreleased]

## 1.0.0-beta - 2024-04-15
### Changed

- Refactored IMAP auth config API

The IMAP auth config option is now explicit, in order to improve error messages:

```toml
# before
right.backend.password.cmd = "pass show example"

# after
right.backend.auth.type = "password"
right.backend.auth.cmd = "pass show example"
```

## [1.0.0-beta] - 2024-04-15

### Added

Expand All @@ -24,8 +39,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Renamed `envelope.filter` to `envelope.filters` in order to match lib types.
- Renamed `check` command to `doctor`.

## 0.1.0 - 2024-04-10
## [0.1.0] - 2024-04-10

### Added

- Initiated the project from [Himalaya CLI](/~https://github.com/soywod/himalaya).
- Initiated the project from [Himalaya CLI](/~https://github.com/pimalaya/himalaya).

[Unreleased]: /~https://github.com/pimalaya/neverest/compare/v1.0.0-beta...HEAD
[1.0.0-beta]: /~https://github.com/pimalaya/neverest/compare/v0.1.0...v1.0.0-beta
[0.1.0]: /~https://github.com/pimalaya/neverest/compare/root...v0.1.0
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 28 additions & 23 deletions config.sample.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,92 +115,97 @@ right.backend.login = "example@localhost"

# IMAP server password authentication configuration
#
#right.backend.auth.type = "password"
#
# Password can be inlined (not recommended).
#
#right.backend.passwd.raw = "p@assw0rd"
#right.backend.auth.raw = "p@assw0rd"
#
# Password can be stored inside your system global keyring (requires
# the keyring cargo feature). You must run at least once `himalaya
# account configure` to set up the password.
#
#right.backend.passwd.keyring = "example-imap"
#right.backend.auth.keyring = "example-imap"
#
# Password can be retrieved from a shell command.
#
right.backend.passwd.cmd = "pass show example-imap"
right.backend.auth.cmd = "pass show example-imap"

# IMAP server OAuth 2.0 authorization configuration
# IMAP server OAuth 2.0 authorization configuration (requires the
# oauth2 cargo feature)
#
#right.backend.auth.type = "oauth2"
#
# Client identifier issued to the client during the registration
# process described in RFC6749.
# See <https://datatracker.ietf.org/doc/html/rfc6749#section-2.2>.
#
#right.backend.oauth2.client-id = "client-id"
#right.backend.auth.client-id = "client-id"
#
# Client password issued to the client during the registration process
# described in RFC6749.
#
# Defaults to keyring "<account-name>-imap-client-secret".
# See <https://datatracker.ietf.org/doc/html/rfc6749#section-2.2>.
#
#right.backend.oauth2.client-secret.raw = "<raw-client-secret>"
#right.backend.oauth2.client-secret.keyring = "example-imap-client-secret"
#right.backend.oauth2.client-secret.cmd = "pass show example-imap-client-secret"
#right.backend.auth.client-secret.raw = "<raw-client-secret>"
#right.backend.auth.client-secret.keyring = "example-imap-client-secret"
#right.backend.auth.client-secret.cmd = "pass show example-imap-client-secret"
#
# Method for presenting an OAuth 2.0 bearer token to a service for
# authentication
#
#right.backend.oauth2.method = "oauthbearer"
#right.backend.oauth2.method = "xoauth2"
#right.backend.auth.method = "oauthbearer"
#right.backend.auth.method = "xoauth2"
#
# URL of the authorization server's authorization endpoint
#
#right.backend.oauth2.auth-url = "https://accounts.google.com/o/oauth2/v2/auth"
#right.backend.auth.auth-url = "https://accounts.google.com/o/oauth2/v2/auth"
#
# URL of the authorization server's token endpoint
#
#right.backend.oauth2.token-url = "https://www.googleapis.com/oauth2/v3/token"
#right.backend.auth.token-url = "https://www.googleapis.com/oauth2/v3/token"
#
# Access token returned by the token endpoint and used to access
# protected resources. It is recommended to use the keyring variant,
# as it will refresh automatically.
#
# Defaults to keyring "<account-name>-imap-access-token".
#
#right.backend.oauth2.access-token.raw = "<raw-access-token>"
#right.backend.oauth2.access-token.keyring = "example-imap-access-token"
#right.backend.oauth2.access-token.cmd = "pass show example-imap-access-token"
#right.backend.auth.access-token.raw = "<raw-access-token>"
#right.backend.auth.access-token.keyring = "example-imap-access-token"
#right.backend.auth.access-token.cmd = "pass show example-imap-access-token"
#
# Refresh token used to obtain a new access token (if supported by the
# authorization server). It is recommended to use the keyring variant,
# as it will refresh automatically.
#
# Defaults to keyring "<account-name>-imap-refresh-token".
#
#right.backend.oauth2.refresh-token.raw = "<raw-refresh-token>"
#right.backend.oauth2.refresh-token.keyring = "example-imap-refresh-token"
#right.backend.oauth2.refresh-token.cmd = "pass show example-imap-refresh-token"
#right.backend.auth.refresh-token.raw = "<raw-refresh-token>"
#right.backend.auth.refresh-token.keyring = "example-imap-refresh-token"
#right.backend.auth.refresh-token.cmd = "pass show example-imap-refresh-token"
#
# Enable the protection, as defined in RFC7636.
#
# See <https://datatracker.ietf.org/doc/html/rfc7636>.
#
#right.backend.oauth2.pkce = true
#right.backend.auth.pkce = true
#
# Access token scope(s), as defined by the authorization server.
#
#right.backend.oauth2.scope = "unique scope"
#right.backend.oauth2.scopes = ["multiple", "scopes"]
#right.backend.auth.scope = "unique scope"
#right.backend.auth.scopes = ["multiple", "scopes"]
#
# Host name of the redirect server.
# Defaults to localhost.
#
#right.backend.oauth2.redirect-host = "localhost"
#right.backend.auth.redirect-host = "localhost"
#
# Port of the redirect server.
# Defaults to the first available one.
#
#right.backend.oauth2.redirect-port = 9999
#right.backend.auth.redirect-port = 9999

# Right backend folder aliases
#
Expand Down

0 comments on commit fc5a999

Please sign in to comment.