-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
more eval for config items #307
Comments
I understand this patch may work for you. However, we don't want each option to be evaluable. I don't know your use case but offlineimap is not designed to support all sort of complex configurations. Changing of parser sounds rather improbable. Perhaps you'd like a new evaluable configuration option for OAUTH2? |
I understand, I was even surprised it worked out. The patch was here as an illustration. |
Look at how current computed options are evaluated. AFAIR, they are all dedicated options. Hence my advice to introduce new dedicated options regardless they serve the same purpose of already existing options. It's good to provide a use case while at it. I already declined features because of the lack of clear use case. The reason is that each code change is an agreement that the benefits overtake the inherent complexity introduced by the change. |
It's about OAuth2 for GMail with client ID, client secret and refresh token saved in a keyring. |
I don't get why storing data in a keyring helps for values exposed to changes. However, it makes sense from a privacy/security POV. Feel free to go for it. ,-) |
To be honest, if I'd to write it myself, I'd go for an over simplification and just check for the start of the value to match a pattern, e.g (in vim style with an extra space):
Maybe too simple? |
Well, if this could work that's not correct. There's no reason to introduce edge-cases in the code that will break one day or a another. Especially for something that trivial with all the required code already there and factorized. |
This would make sense for security reasons for:
|
Introduce: - oauth2_client_id_eval - oauth2_client_secret_eval - oauth2_access_token_eval - oauth2_refresh_token_eval Github-ref: OfflineIMAP#307 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Please, test above version (on top of v7.0.0). |
Introduce: - oauth2_client_id_eval - oauth2_client_secret_eval - oauth2_access_token_eval - oauth2_refresh_token_eval Github-ref: OfflineIMAP#307 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Introduce: - oauth2_client_id_eval - oauth2_client_secret_eval - oauth2_access_token_eval - oauth2_refresh_token_eval Github-ref: OfflineIMAP#307 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
Introduce: - oauth2_client_id_eval - oauth2_client_secret_eval - oauth2_access_token_eval - oauth2_refresh_token_eval Github-ref: #307 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
When trying to set up a quite circumvoluted configuration involving OAUTH2, I ran into the problem of not being able to call functions from the
pythonfile
everywhere I needed to.When I realized it was by design, I slightly modified
CustomConfigParser.getdefault
to test if the option might be evaluated. It's dirty, but it worked.What I can think of for a proper implementation would be a dedicated subsection for evaluable options but it's lacking from ConfigParser, would need to use another parser.
Another way would be an
[eval]
section where option would be of the form<section>.<option>
, evaled and inserted in their sections.The text was updated successfully, but these errors were encountered: