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

feat!: add support for secrets in manifests #307

Merged
merged 1 commit into from
Jul 19, 2024

Commits on Jul 19, 2024

  1. feat!: add support for secrets in manifests

    This adds support for secrets in wasmCloud application manifests. The
    secrets themselves are actually _secret references_ as outlined in
    wasmCloud/wasmCloud#2190. Just like config, secrets can be specified at
    the component or provider level or on a link.
    
    Secret references themselves are actually implemented as an additional
    kind of config stored in the same config data bucket. However, I opted
    to implement a dedicated scaler for secrets that is largely a clone of
    the existing ConfigScaler since the underlying data type is very
    different than the arbitrary set of key/value pairs we use for config.
    
    An example of what this looks like in a component is shown below:
    
    ```yaml
    spec:
      components:
        - name: http-component
          type: component
          properties:
            image: ghcr.io/wasmcloud/test-fetch-with-token:0.1.0-fake
            secrets:
              - name: some-api-token
                source:
                  backend: nats-kv
                  key: test-value
                  version: 1
              - name: my-other-secret
                source:
                  backend: aws-secrets-manager
                  value: secret-name
                  version: "be01a5fb-7ebb-4ae9-8ea0-0902e8940bc0"
    ```
    
    This contains a breaking change to the way that we specify config on
    links:
    
    ```yaml
    - type: link
      properties:
        namespace: wasmcloud
        package: postgres
        interfaces: [managed-query]
        target:
          name: sql-postgres
          secrets:
            - name: db-password
              source:
                backend: nats-kv
                key: myapp_db-password
                version: 1
    ```
    
    Instead of using `target_config` and `source_config`, this renames them
    to `target` and `source` respectively and adds keys for `config` and
    `secrets`. The name of the target is now now a key at the top level of
    the `target` block, as seen above.
    
    Signed-off-by: Dan Norris <protochron@users.noreply.github.com>
    protochron committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    ca0028a View commit details
    Browse the repository at this point in the history