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

Improve credentials manager selection #983

Merged
merged 6 commits into from
Mar 30, 2022

Conversation

dmach
Copy link
Contributor

@dmach dmach commented Dec 9, 2021

Implemented new keyctl credentials manager.
Order credential managers by priority and name.
Credential manager with the highest prio is a default now.
Remove unwanted python-keyrings backends.
Made clear which credentials managers are (in)secure.
Briefly tested the code on python2.

@marcus-h
Copy link
Member

marcus-h commented Dec 9, 2021 via email

@dmach
Copy link
Contributor Author

dmach commented Dec 10, 2021

@marcus-h I'll definitely take a look.

BTW, haven't you considered splitting your lib in the following way?

  • Submit the generic code to python-keyring.
  • Move the osc specific code to osc.

Is python2 supported in your library?
Plain super() indicates that it may not be supported.
I was told that py2 support in osc is probably not going away for a while.

@marcus-h
Copy link
Member

marcus-h commented Dec 10, 2021 via email

@pep8speaks
Copy link

pep8speaks commented Mar 22, 2022

Hello @dmach! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-03-28 07:50:18 UTC

@dmach dmach force-pushed the credentials-keyctl branch 2 times, most recently from a66826d to 70ce279 Compare March 23, 2022 09:28
@dmach dmach marked this pull request as ready for review March 23, 2022 09:33
@dmach dmach changed the title credentials: Add keyctl backend credentials: Add keyctl credentials manager Mar 23, 2022
@dmach
Copy link
Contributor Author

dmach commented Mar 24, 2022

Force-pushed brand new code based on python-keyring-keyutils.

The credentials manager selection looks like this now:

the apiurl 'https://example.com' does not exist in the config file. Please enter
your credentials for this apiurl.

Username: USER
Password: 

NUM NAME              DESCRIPTION
1   Kernel keyring    Store password in user session keyring in kernel keyring [secure, in-memory, per-session]
2   KWallet           Store password in KWallet [secure, persistent]
3   Transient         Do not store the password and always ask for it [secure, in-memory]
4   Obfuscated config Store the password in obfuscated form in the osc config file [insecure, persistent]
5   Config            Store the password in plain text in the osc config file [insecure, persistent]
Select credentials manager [default=1]: 

@dmach dmach changed the title credentials: Add keyctl credentials manager Improve credentials manager selection Mar 24, 2022
@marcus-h
Copy link
Member

marcus-h commented Mar 24, 2022 via email

@dmach
Copy link
Contributor Author

dmach commented Mar 28, 2022

Hmm IMHO we should also offer the other backends (except "useless" ones like fail, null etc.). We could give them a lower priority, though. What do you think?

Could you be more specific about which backends do you want enabled?

I've reviewed classes python-keyring provides and added keyring.backends.SecretService.Keyring to the list.

These are skipped on my system and I believe they should remain that way:

keyring.backends.fail.Keyring
keyutils.backend.KeyutilsKeyringBackend
keyring.backends.chainer.ChainerBackend

Do we really want to support keyring.backends.kwallet.DBusKeyringKWallet4?

Did I miss anything?

@marcus-h
Copy link
Member

Hmm github ignored my mail again... here's the forwarded message:

----- Forwarded message from Marcus Hüwe <suse-tux@gmx.de> -----

Date: Mon, 28 Mar 2022 10:33:16 +0200
From: Marcus Hüwe <suse-tux@gmx.de>
To: reply+AAIEUTH5A4XPNL3BSFET3QWAJ2NG5EVBNHHEAHPWNE@reply.github.com
Subject: Re: [openSUSE/osc] Improve credentials manager selection (PR #983)

On 2022-03-28 00:46:54 -0700, Daniel Mach wrote:
> > Hmm IMHO we should also offer the other backends (except "useless" ones like fail, null etc.). We could give them a lower priority, though. What do you think?
> 
> Could you be more specific about which backends do you want enabled?
> 
IMHO, all except the ones that we explicitly want to disable (like the
ones you listed below). For instance, there could be third party
keyrings that are not part of the official python-keyring package.

> I've reviewed classes python-keyring provides and added `keyring.backends.SecretService.Keyring` to the list.
> 
> These are skipped on my system and I believe they should remain that way:
> ```
> keyring.backends.fail.Keyring
> keyutils.backend.KeyutilsKeyringBackend
> keyring.backends.chainer.ChainerBackend
> ```
> 
I'm fine with skipping those.

> Do we really want to support `keyring.backends.kwallet.DBusKeyringKWallet4`?
> 
Hmm I would rather say s/support/offer/ - eventually, it is up to the
user what they wants to use.

----- End forwarded message -----

@lethliel
Copy link
Member

Ok.. This works and is already discussed.. I will merge this now..
Also that this is done in several commits is fine.

@lethliel lethliel merged commit 58a2794 into openSUSE:master Mar 30, 2022
@marcus-h
Copy link
Member

marcus-h commented Apr 7, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants