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

Allow formatting of SSH keys from 1password #3720

Open
bdsoha opened this issue Jul 25, 2024 · 1 comment
Open

Allow formatting of SSH keys from 1password #3720

bdsoha opened this issue Jul 25, 2024 · 1 comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@bdsoha
Copy link

bdsoha commented Jul 25, 2024

Summary

The current implementation does not allow retrieving SSH private keys in open-ssh format.
When using the CLI and the read subcommand, I can provide ?ssh-format=openssh to the end of the path to return the key in open-ssh format.

Proposed solution

Allowing query parameters to be appended to lookup keys, when using property

func (provider *ProviderOnePassword) getField(item *onepassword.Item, property string) ([]byte, error) {}
func (provider *ProviderOnePassword) getFields(item *onepassword.Item, property string) (map[string][]byte, error) {}

Example

Assuming the following config:

apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: airflow-connections
spec:
  # ...
  data:
    - secretKey: ssh_key
      remoteRef:
        key: ssh
        property: private key

The outputted key is as follows:

-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----

However, the expected value should be in openssh format:

-----BEGIN OPENSSH PRIVATE KEY-----
...
-----END OPENSSH PRIVATE KEY-----
@bdsoha bdsoha added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 25, 2024
@bdsoha bdsoha changed the title Allow formatting of SSH keys Allow formatting of SSH keys from 1password Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant