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

Added key cache via OS keyring #973

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

applejag
Copy link

@applejag applejag commented Aug 24, 2023

Changed the repository.Repository implementation to use https://github.com/zalando/go-keyring

This means that password tokens are stored in OS keyring instead of in plain text on your disk.

Screenshot from "KDE Wallet Management Tool", the app used to inspect OS keyring on KDE:

Screenshot_20230825_121730

Usage:

- name: oidc
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
        - oidc-login
        - get-token
        - --oidc-issuer-url=https://...............
        - --oidc-client-id=google
        - --oidc-client-secret=...............
        - --force-keyring # <--- new flag
      command: kubectl
      env: null
      interactiveMode: IfAvailable
      provideClusterInfo: false

The code prefers the OS keyring, if supported. Falls back to file based cache. Can be overridden with the new flags:

  • --force-keyring
  • --no-keyring

Closes #952

@applejag applejag force-pushed the feature/952/keyring branch 3 times, most recently from 13476e5 to 7ee1122 Compare August 25, 2023 10:25
@SISheogorath
Copy link

@int128 is there anything can be done to move this forward?

I wanted to contribute this myself, but obviously @applejag was quicker and did a better job than I could. ^^

But maybe there is something I can help with to bring this into upstream.

@applejag
Copy link
Author

applejag commented Nov 3, 2024

It would be nice to get this merged. I've been waiting patiently in hopes that @int128 will merge this eventually, but that doesn't seem to be the case.

I'd also be curious what's missing to get this merged.

I also see now that there's conflicts. I'll fix that.

@applejag
Copy link
Author

applejag commented Nov 3, 2024

Damnit I accidentally clicked "Sync fork" on the wrong branch.

Edit: There we go, fixed. Also I've now fixed the merge conflicts

@applejag applejag reopened this Nov 3, 2024
@nogweii
Copy link

nogweii commented Nov 3, 2024

Would it be possible to expand this to include fetching the client secret from the OS keyring as well? Or is that too much scope creep?

@applejag
Copy link
Author

applejag commented Nov 3, 2024

Would it be possible to expand this to include fetching the client secret from the OS keyring as well? Or is that too much scope creep?

I would like if that is done in a future PR. I don't have a strong will for trying to implement that

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.

Encrypt the token cache
3 participants