Skip to content

Conversation

felddy
Copy link
Contributor

@felddy felddy commented Feb 27, 2020

🗣 Description

Add the ability to save a GitHub personal access token (PAT), in the system keyring.

terraform-to-secrets save <github-personal-access-token>

See: https://github.com/jaraco/keyring for information about how keyring works.

Then you can simply call terraform-to-secrets to have it do its thang.

The --token option was added to make the tool work without a keychain.

See https://github.com/jaraco/keyring for information about how keyring works.

💭 Motivation and Context

Copying and pasting tokens can lead to inadvertent leaks. This allows the user to store the token in their password manager of choice and not have to deal with it again. Security!

🧪 Testing

Tested using my own PATs, terraform state, and --dry-run

📷 Screenshots (if appropriate)

🚥 Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (causes existing functionality to change)

✅ Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@felddy felddy requested review from a team, dav3r, jsf9k and mcdonnnj as code owners February 27, 2020 19:10
@felddy felddy self-assigned this Feb 27, 2020
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fancy! I like! 🔐

Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I verified that the code doesn't blow up on Linux. (I was afraid the keyring package might be OSX-specific.)

It looks like the keyring code would even work on Linux if I had a supported backend installed.

@felddy
Copy link
Contributor Author

felddy commented Feb 27, 2020

Looks good to me. I verified that the code doesn't blow up on Linux. (I was afraid the keyring package might be OSX-specific.)

It looks like the keyring code would even work on Linux if I had a supported backend installed.

Thanks for testing it. I saw it had a bunch of backend support for Linux. Even our Windoze users cool get in on it.

@felddy felddy merged commit af391d6 into develop Feb 27, 2020
@felddy felddy deleted the improvement/store_pat_in_keyring branch February 27, 2020 19:28
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.

3 participants