Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

8.5 KB
Raw Blame
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

---

paths:

  /metalakes/{metalake}/secrets/providers:
    parameters:
      - $ref: "./openapi.yaml#/components/parameters/metalake"
    get:
      tags:
        - secrets
      summary: List secrets providers
      operationId: listSecretProviders
      description: >
        Returns the process-global secrets-provider registry as discovery metadata.
        The response contains each provider's configured name and type.
        The registry itself is server-wide; the metalake path scopes authorization.
        Callers must be the metalake owner or hold VIEW_SECRET_PROVIDERS on the metalake.
      responses:
        "200":
          description: Returns the configured secrets providers
          content:
            application/vnd.gravitino.v1+json:
              schema:
                $ref: "#/components/schemas/SecretProviderListResponse"
              examples:
                SecretProviderListResponse:
                  $ref: "#/components/examples/SecretProviderListResponse"
        "401":
          description: Unauthorized - Authentication credentials are missing or invalid
          content:
            application/vnd.gravitino.v1+json:
              schema:
                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
        "403":
          description: Forbidden - The caller is not the metalake owner and lacks VIEW_SECRET_PROVIDERS
          content:
            application/vnd.gravitino.v1+json:
              schema:
                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
        "404":
          description: Not Found - The specified metalake does not exist or is not in use
          content:
            application/vnd.gravitino.v1+json:
              schema:
                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
              examples:
                NoSuchMetalakeException:
                  $ref: "./metalakes.yaml#/components/examples/NoSuchMetalakeException"
        "5xx":
          $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"

  /metalakes/{metalake}/objects/{metadataObjectType}/{metadataObjectFullName}/secrets:
    parameters:
      - $ref: "./openapi.yaml#/components/parameters/metalake"
      - $ref: "./openapi.yaml#/components/parameters/metadataObjectType"
      - $ref: "./openapi.yaml#/components/parameters/metadataObjectFullName"
    get:
      tags:
        - secrets
      summary: Get secrets
      operationId: getSecrets
      description: |
        Returns plaintext secret properties for the metadata object. This includes:

        1. Every secret-URN value, resolved via the secret manager (including keys that
           may also appear in the credentials API, for example jdbc-password).
        2. Stored plaintext for keys whose names look sensitive (contain secret, password,
           token, credential, access, or account, case-insensitive) — including undeclared
           or mistyped credential properties that list/get mask as ******.

        Properties that are only declared hidden in property metadata, and whose names
        do not match that sensitive-name pattern, are masked as ****** on list/get and
        are not returned by this API. Clients must not treat a remaining ****** value
        as a usable credential for those keys.

        When authorization is enabled, metadata access is required to reach this endpoint.
        Without USE_SECRETS (and without metalake ownership) the response is HTTP 200 with
        an empty map (not 403). With USE_SECRETS, canonical static credential keys on the
        object (declared in properties metadata, implied by a static credential-providers
        entry, or present under a known static key name such as s3-access-key-id) are
        omitted unless the caller also holds INCLUDE_CREDENTIAL_SECRETS (or is metalake
        owner). Non-canonical aliases and typos are not treated as static credential keys
        for this filter. Catalog filtering uses the effective provider list;
        schema/fileset/other types use that object's own properties only.

        Supported types: metalake, catalog, schema, fileset, table, topic, view, model.
      responses:
        "200":
          description: >
            Returns the secrets map (possibly empty). Lack of USE_SECRETS or
            INCLUDE_CREDENTIAL_SECRETS soft-filters the map rather than returning 403.
          content:
            application/vnd.gravitino.v1+json:
              schema:
                $ref: "#/components/responses/SecretsResponse"
              examples:
                SecretsResponse:
                  $ref: "#/components/examples/SecretsResponse"
        "400":
          $ref: "./openapi.yaml#/components/responses/BadRequestErrorResponse"
        "404":
          description: Not Found - The specified metalake or object does not exist
          content:
            application/vnd.gravitino.v1+json:
              schema:
                $ref: "./openapi.yaml#/components/schemas/ErrorModel"
              examples:
                NoSuchMetalakeException:
                  $ref: "./metalakes.yaml#/components/examples/NoSuchMetalakeException"
        "5xx":
          $ref: "./openapi.yaml#/components/responses/ServerErrorResponse"


components:
  schemas:
    SecretBinding:
      type: object
      description: >
        Write-through secret binding. Provider is a registered secrets-provider
        instance name; plaintext is the secret to store. The persisted property
        value becomes a URN.
      required:
        - provider
        - plaintext
      properties:
        provider:
          type: string
          description: Registered secrets-provider instance name
        plaintext:
          type: string
          description: Plaintext secret to write through
          format: password

    SecretReference:
      type: object
      description: >
        External secret locator. Provider is a registered secrets-provider
        instance name; attributes are provider-specific. The server builds and
        persists the URN. Clients must not send a raw gravitino secret URN.
      required:
        - provider
        - attributes
      properties:
        provider:
          type: string
          description: Registered secrets-provider instance name
        attributes:
          type: object
          description: Provider-specific locator keys (must be non-empty)
          additionalProperties:
            type: string
          minProperties: 1

    SecretProvider:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          description: The configured secrets-provider instance name
        type:
          type: string
          description: The secrets-provider type identifier

    SecretProviderListResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          description: Status code of the response
          enum:
            - 0
        providers:
          type: array
          items:
            $ref: "#/components/schemas/SecretProvider"

  responses:
    SecretsResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          description: Status code of the response
          enum:
            - 0
        secrets:
          type: object
          description: Map of secret property key to plaintext value
          additionalProperties:
            type: string

  examples:
    SecretProviderListResponse:
      value: {
        "code": 0,
        "providers": [
          {
            "name": "memory",
            "type": "memory"
          }
        ]
      }
    SecretsResponse:
      value: {
        "code": 0,
        "secrets": {
          "authentication.kerberos.keytab": "plaintext-keytab-content"
        }
      }