v1
Double column
API
CLI
JS Client

Secrets /

Get secret

View a secret including its contents

Path parameters

    • projectId

      string required
      ID of the project
    • secretId

      string required
      ID of the secret

Query parameters

    • show

      string
      Which secrets to display - if set to `this` only the group's secrets are displayed, if set to `inherited` only secrets from linked addons are displayed, if set to `all` or not provided, both are displayed.
      one of
      this, inherited, all

Response body

  • {object}
    Response object.
    • data

      {object} required
      Result data.
      • id

        string required
        Identifier for the secret group
      • name

        string required
        Secret group name
      • tags

        [array] required
        An array of previously defined tags to help identify and group the resource.
        • string
          min length
          1
          max length
          100
          pattern
          ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$
      • description

        string
        A short description of the secret group
      • type

        string required
        The permission type of the secret group.
        one of
        secret, config
      • secretType

        string required
        The type of the created secret group
        one of
        environment-arguments, environment, arguments
      • projectId

        string required
        ID of the project that the secret group belongs to
      • priority

        integer required
        The priority with which different secret groups will be merged
        min
        0
        max
        100
      • restrictions

        {object} required
        Restriction settings of the secret
        • restricted

          boolean
          Whether the secret is restricted to specific resources. If this is `true`, only resources listed in `nfObjects` or with a tag listed in `tags` will have access to these secrets. Otherwise, all resources in the project will be able to access it.
        • nfObjects

          [array]
          List of Northflank services & jobs the secret is restricted to
          • {object}
            • id

              string required
              ID of the entity the secret is restricted to.
              pattern
              ^[A-Za-z0-9-]+$
            • type

              string required
              Type of the entity the secret is restricted to.
              one of
              service, job
        • tags

          [array] required
          List of tags the secret is restricted to.
          • string
            min length
            1
            max length
            100
            pattern
            ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$
        • tagMatchCondition

          string
          If all or any of the tags must be present on the target for it to match the condition.
          one of
          and, or
      • createdAt

        string required
        The timestamp when the secret group was created at
      • updatedAt

        string required
        The timestamp the secret group was last updated at
      • secrets

        {object} required
        Decrypted secret data. If the `show` parameter is set to `this`, this will only contain secrets saved to this group. If the `show` parameter is set to `inherited`, this will only contain secrets inherited from linked addons. Otherwise, this will contain both.
    API
    CLI
    JS Client

    GET /v1/projects/{projectId}/secrets/{secretId}

    Example response

    200 OK

    The full secret including its contents.

    JSON

    {
      "data": {
        "id": "example-secret-group",
        "name": "Example secret group",
        "tags": [
          "my-tag"
        ],
        "description": "This is the secret group description",
        "type": "secret",
        "secretType": "environment",
        "projectId": "default-project",
        "priority": 10,
        "restrictions": {
          "restricted": true,
          "nfObjects": [
            {
              "id": "example-service",
              "type": "service"
            }
          ],
          "tags": [
            "my-tag"
          ],
          "tagMatchCondition": "or"
        },
        "createdAt": "2021-01-01 12:00:00.000Z",
        "updatedAt": "2021-01-01 12:00:00.000Z",
        "secrets": {
          "variables": {
            "a_key": "a_secret",
            "b_key": "b_secret"
          },
          "files": {
            "/dir/fileName": {
              "data": "VGhpcyBpcyBhbiBleGFtcGxlIHdpdGggYSB0ZW1wbGF0ZWQgJHtOT0RFX0VOVn0gdmFyaWFibGU=",
              "encoding": "utf-8"
            }
          }
        }
      }
    }

    © 2024 Northflank Ltd. All rights reserved.