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

[bitwarden] ability to fetch all fields from an item #994

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

honzasterba
Copy link
Contributor

@honzasterba honzasterba commented Sep 28, 2024

Sometimes a projects has a lot of secrets (more than 10). And its cumbersome to write $(kama secrets fetch ...) with a lot of field names.

I want to be able to just fetch all the fields from a given item and then just use these with $(kamal extract NAME)

The result is that you can:

  • create on item in bitwaren of type Secre note
  • add custom fields to that item
  • fetch all the custom fields into your .kamal/secrets like so:
SECRETS=$(kamal secrets fetch --adapter bitwarden SECRETS_ITEM)
SECRET_VAR=$(kamal secrets extract FIELD_NAME $SECRETS)

@honzasterba honzasterba force-pushed the bw_fetch_all_fields branch 2 times, most recently from 81cea7b to 1d4a804 Compare October 5, 2024 14:05
@honzasterba honzasterba requested a review from djmb October 5, 2024 14:06
@honzasterba
Copy link
Contributor Author

Please let me know if there is anything I can do to move this along, or if should just give up and close it.

Copy link
Collaborator

@djmb djmb left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, @honzasterba, I've been away.

I think the current approach looks good! Just one suggestion about how fetch_secrets_from_fields if called and I think we are good to go.

lib/kamal/secrets/adapters/bitwarden.rb Outdated Show resolved Hide resolved
Sometimes a projects has a lot of secrets (more than 10). And its
cumbersome to write $(kama secrets fetch ...) with a lot of field
names.

I want to be able to just fetch all the fields from a given item
 and then just use these with $(kamal extract NAME)
@honzasterba honzasterba requested a review from djmb October 23, 2024 12:29
@djmb djmb merged commit 347eb69 into basecamp:main Oct 23, 2024
8 checks passed
@honzasterba honzasterba deleted the bw_fetch_all_fields branch October 23, 2024 16:08
@honzasterba
Copy link
Contributor Author

Thank you! 🎆

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.

2 participants