Skip to content

Commit

Permalink
Feature: support notes field and downgrade appVersion to 0.7.0 till…
Browse files Browse the repository at this point in the history
… bw cli is fixed upstream (#113)

* Update _helpers.tpl

* add fields secretstore and bump chart

* helm-docs: automated action

* Update charts/bitwarden-eso-provider/Chart.yaml - downgrade appversion

* helm-docs: automated action

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: JesseBot <jessebot@linux.com>
  • Loading branch information
3 people authored Jul 7, 2024
1 parent ac30066 commit 5234ade
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ helm install my-release bitwarden-eso-provider/bitwarden-eso-provider --set bitw
```

# Example ExternalSecret
By default we will create two `ClusterSecretStores` for you that can then be accessed when you create a secret like [this](./examples/example-secret.yaml), but also printed below here:
By default we will create three `ClusterSecretStores` for you (logins, fields & notes) that can then be accessed when you create a secret like [this](./examples/example-secret.yaml), but also printed below here:

```yaml
---
Expand Down Expand Up @@ -116,7 +116,7 @@ spec:
property: password
```
## Testing
## Testing
Searching for items has to be done using JSONpath, you will need to install a utility for that, we use [bashtools/JSONPath.sh](https://github.com/bashtools/JSONPath.sh).
Expand Down
4 changes: 2 additions & 2 deletions charts/bitwarden-eso-provider/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.9.0
version: 0.9.1

# renovate: image=jessebot/bweso
appVersion: "0.8.0"
appVersion: "0.7.0"

maintainers:
- name: "cloudymax"
Expand Down
2 changes: 1 addition & 1 deletion charts/bitwarden-eso-provider/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bitwarden-eso-provider

![Version: 0.9.0](https://img.shields.io/badge/Version-0.9.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.0](https://img.shields.io/badge/AppVersion-0.8.0-informational?style=flat-square)
![Version: 0.9.1](https://img.shields.io/badge/Version-0.9.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.7.0](https://img.shields.io/badge/AppVersion-0.7.0-informational?style=flat-square)

Helm chart to use Bitwarden as a Provider for External Secrets Operator

Expand Down
16 changes: 16 additions & 0 deletions charts/bitwarden-eso-provider/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,19 @@ Create the url string that will be used to query bitwarden
{{- define "bitwarden-eso-provider.clusterSecretStore.fieldsJsonPath" -}}
{{- printf "$.data.data[0].fields[?(@.name==\"{{ .remoteRef.property }}\")].value" | quote }}
{{- end }}

{{/*
Create the url string that will be used to query Bitwarden:
- cluster-secret-store notes url
*/}}
{{- define "bitwarden-eso-provider.clusterSecretStore.notesUrl" -}}
{{- printf "http://%s.%s.svc.cluster.local:%s/list/object/items?search={{ .remoteRef.key }}" .Release.Name .Release.Namespace (.Values.service.port | toString) | quote }}
{{- end }}

{{/*
Create the url string that will be used to query bitwarden
- cluster-secret-store notes jsonpath
*/}}
{{- define "bitwarden-eso-provider.clusterSecretStore.notesJsonPath" -}}
{{- printf "$.data.data[0].notes" | quote }}
{{- end }}
11 changes: 11 additions & 0 deletions charts/bitwarden-eso-provider/templates/cluster-secret-stores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,15 @@ spec:
url: {{ include "bitwarden-eso-provider.clusterSecretStore.fieldsUrl" . }}
result:
jsonPath: {{ include "bitwarden-eso-provider.clusterSecretStore.fieldsJsonPath" . }}
---
apiVersion: external-secrets.io/v1beta1
kind: ClusterSecretStore
metadata:
name: bitwarden-notes
spec:
provider:
webhook:
url: {{ include "bitwarden-eso-provider.clusterSecretStore.notesUrl" . }}
result:
jsonPath: {{ include "bitwarden-eso-provider.clusterSecretStore.notesJsonPath" . }}
{{- end }}

0 comments on commit 5234ade

Please sign in to comment.