Skip to content

Support for Sprig htpasswd function #693

@AlexanderK46

Description

@AlexanderK46

Sprig has an htpasswd template function that would be really useful in secret transformation for configuring basic auth.

apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultStaticSecret
metadata:
  name: basic-auth
  namespace: test
spec:
  vaultAuthRef: test
  path: test
  type: kv-v2
  mount: test
  hmacSecretData: true
  refreshAfter: 1m
  destination:
    name: basic-auth
    create: true
    overwrite: true
    type: Opaque
    transformation:
      excludes:
        - .*
      templates:
        auth:
          text: '{{- htpasswd (get .Secrets "user") (get .Secrets "password") -}}'

Using VSO 0.5.2 there is an error: Failed to build K8s secret data: parse error: template: test/basic-auth/auth:1: function "htpasswd" not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions