Skip to content

feat: add 1Password SDK based provider#4628

Merged
Skarlso merged 20 commits intoexternal-secrets:mainfrom
Skarlso:one-password-sdk
May 14, 2025
Merged

feat: add 1Password SDK based provider#4628
Skarlso merged 20 commits intoexternal-secrets:mainfrom
Skarlso:one-password-sdk

Conversation

@Skarlso
Copy link
Copy Markdown
Contributor

@Skarlso Skarlso commented Apr 8, 2025

Problem Statement

1Password using the SDK

TODOs

  • Unit testing
  • Documentation
  • Update support table

Related Issue

Fixes #3655

Proposed Changes

How do you like to solve the issue and why?

Checklist

  • I have read the contribution guidelines
  • All commits are signed with git commit --signoff
  • My changes have reasonable test coverage
  • All tests pass with make test
  • I ensured my PR is ready for review with make reviewable

@Skarlso Skarlso force-pushed the one-password-sdk branch 6 times, most recently from 61bd145 to baa7571 Compare April 13, 2025 08:57
@Skarlso Skarlso marked this pull request as ready for review April 13, 2025 08:57
@Skarlso Skarlso requested a review from a team as a code owner April 13, 2025 08:57
@Skarlso Skarlso requested a review from gusfcarvalho April 13, 2025 08:57
@Skarlso
Copy link
Copy Markdown
Contributor Author

Skarlso commented Apr 13, 2025

@gusfcarvalho should this wait for v1 promotion? 🤔

@gusfcarvalho
Copy link
Copy Markdown
Member

I mean, I think so! v1 promotion is literally ready to go (aside from reviews of course)

@Skarlso
Copy link
Copy Markdown
Contributor Author

Skarlso commented Apr 13, 2025

Okay, I'll review that one today.

@Skarlso Skarlso requested a review from gusfcarvalho April 18, 2025 13:29
@Skarlso Skarlso force-pushed the one-password-sdk branch 2 times, most recently from ef11747 to 92faca3 Compare April 19, 2025 16:44
@Skarlso
Copy link
Copy Markdown
Contributor Author

Skarlso commented Apr 27, 2025

Since this is in v1, it will have all available features when done. I already added pushsecret. Now, only DeleteSecret and GetAllSecrets is left. All those is supported by the SDK. In terms of HOW, it will mirror whatever people had to do with the connector one, with a slight modification that Getting a secret uses the Secret Reference method instead which is a lot simpler.

@Skarlso
Copy link
Copy Markdown
Contributor Author

Skarlso commented Apr 28, 2025

Following worked for fetching:

apiVersion: external-secrets.io/v1
kind: SecretStore
metadata:
  name: onepassword
spec:
  provider:
    onepasswordSDK:
      vault: TestVault
      auth:
        serviceAccountSecretRef:
          name: onepassword-token
          key: token
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: fetch-from-onepassword
spec:
  secretStoreRef:
    kind: SecretStore
    name: onepassword
  target:
    creationPolicy: Owner
  data:
  - secretKey: test-login-1
    remoteRef:
      key: test-login-1/username

Looking good so far. :)

PushSecret is also working now:

Normal   Synced   9s                  pushsecret  PushSecret synced successfully
apiVersion: external-secrets.io/v1alpha1
kind: PushSecret
metadata:
  name: pushsecret-example # Customisable
spec:
  deletionPolicy: Delete
  refreshInterval: 1h
  secretStoreRefs:
    - name: onepassword
      kind: SecretStore
  selector:
    secret:
      name: source-secret # Source Kubernetes secret
  data:
    - match:
        secretKey: source-key # Source Kubernetes secret key to be pushed
        remoteRef:
          remoteKey: 1pw-secret-name # 1Password item/secret name
          property: password         # (Optional) 1Password field type, default password
      metadata:
        apiVersion: kubernetes.external-secrets.io/v1alpha1
        kind: PushSecretMetadata
        spec:
          tags: ["tag1", "tag2"]    # Optional metadata to be pushed with the secret
Screenshot 2025-04-28 at 23 01 29

After push secret was deleted and the only remaining field was the password field the entire secret got deleted correctly:

Screenshot 2025-04-28 at 23 13 05

Update is also working and find secret. With that, this is feature complete. All that's left are tests.

Skarlso added 6 commits April 29, 2025 09:12
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
…unit tests

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
@buroa
Copy link
Copy Markdown

buroa commented May 8, 2025

@gusfcarvalho Looking forward to this being reviewed :)

@Skarlso
Copy link
Copy Markdown
Contributor Author

Skarlso commented May 10, 2025

This will likely come with the 0.17.0 release that we are planning. :)

@gusfcarvalho
Copy link
Copy Markdown
Member

Did a first batch of comments 😄 looking good thus far 💪

@Skarlso
Copy link
Copy Markdown
Contributor Author

Skarlso commented May 11, 2025

Thanks Gustavo!!

Skarlso and others added 5 commits May 11, 2025 08:29
Co-authored-by: Gustavo Fernandes de Carvalho <17139678+gusfcarvalho@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
@Skarlso Skarlso requested a review from gusfcarvalho May 13, 2025 06:36
@Skarlso Skarlso force-pushed the one-password-sdk branch from 188c296 to 2ba024e Compare May 14, 2025 05:20
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
@Skarlso Skarlso force-pushed the one-password-sdk branch from 2ba024e to 56a63bd Compare May 14, 2025 05:32
Skarlso and others added 2 commits May 14, 2025 07:50
Signed-off-by: Gustavo Fernandes de Carvalho <17139678+gusfcarvalho@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@Skarlso Skarlso merged commit fa1d9bd into external-secrets:main May 14, 2025
22 checks passed
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.

Integrate 1Password SDKs to support authentication via service account

3 participants