{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/npm/json-schema/npm-oidc-configs-schema.json",
  "title": "OidcConfigs",
  "description": "Array of OIDC trusted publisher configurations",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/npm-registry-reference-openapi.yml#/components/schemas/OidcConfigs",
  "type": "array",
  "items": {
    "oneOf": [
      {
        "$ref": "#/$defs/GitHubActionsConfig"
      },
      {
        "$ref": "#/$defs/GitLabPipelinesConfig"
      },
      {
        "$ref": "#/$defs/CircleCIConfig"
      }
    ]
  },
  "$defs": {
    "CircleCIConfig": {
      "type": "object",
      "required": [
        "id",
        "type",
        "claims",
        "permissions"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier for the configuration"
        },
        "type": {
          "type": "string",
          "enum": [
            "circleci"
          ],
          "description": "Type of the trusted publisher"
        },
        "claims": {
          "type": "object",
          "required": [
            "oidc.circleci.com/org-id",
            "oidc.circleci.com/project-id",
            "oidc.circleci.com/pipeline-definition-id",
            "oidc.circleci.com/vcs-origin"
          ],
          "properties": {
            "oidc.circleci.com/org-id": {
              "type": "string",
              "format": "uuid",
              "description": "The UUID of the CircleCI organization"
            },
            "oidc.circleci.com/project-id": {
              "type": "string",
              "format": "uuid",
              "description": "The UUID of the CircleCI project"
            },
            "oidc.circleci.com/pipeline-definition-id": {
              "type": "string",
              "format": "uuid",
              "description": "The UUID of the pipeline definition Id"
            },
            "oidc.circleci.com/context-ids": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              },
              "description": "Optional array of CircleCI context UUIDs."
            },
            "oidc.circleci.com/vcs-origin": {
              "type": "string",
              "description": "The origin repository where the CI job runs, in the format `<vcs-provider>/<org>/<repo>`.\n"
            }
          }
        },
        "permissions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "createPackage",
              "createStagedPackage",
              "manageDistTags"
            ]
          },
          "description": "List of permissions granted to the trusted publisher configuration"
        }
      }
    },
    "GitHubActionsConfig": {
      "type": "object",
      "required": [
        "id",
        "type",
        "claims",
        "permissions"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier for the configuration"
        },
        "type": {
          "type": "string",
          "enum": [
            "github"
          ],
          "description": "Type of the trusted publisher"
        },
        "claims": {
          "type": "object",
          "required": [
            "repository"
          ],
          "properties": {
            "repository": {
              "type": "string",
              "description": "GitHub repository in format 'owner/repo'"
            },
            "workflow_ref": {
              "oneOf": [
                {
                  "type": "string",
                  "description": "Exact workflow reference"
                },
                {
                  "type": "object",
                  "description": "Partial workflow reference match",
                  "properties": {
                    "file": {
                      "type": "string",
                      "description": "Workflow file name (e.g., 'publish.yml')"
                    }
                  }
                }
              ],
              "description": "Reference to the GitHub Actions workflow"
            },
            "environment": {
              "type": "string",
              "description": "GitHub environment name"
            }
          }
        },
        "permissions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "createPackage",
              "createStagedPackage",
              "manageDistTags"
            ]
          },
          "description": "List of permissions granted to the trusted publisher configuration"
        }
      }
    },
    "GitLabPipelinesConfig": {
      "type": "object",
      "required": [
        "id",
        "type",
        "claims",
        "permissions"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier for the configuration"
        },
        "type": {
          "type": "string",
          "enum": [
            "gitlab"
          ],
          "description": "Type of the trusted publisher"
        },
        "claims": {
          "type": "object",
          "required": [
            "project_path"
          ],
          "properties": {
            "project_path": {
              "type": "string",
              "description": "GitLab project path in format 'group/project'"
            },
            "ci_config_ref_uri": {
              "oneOf": [
                {
                  "type": "string",
                  "description": "Exact CI config reference"
                },
                {
                  "type": "object",
                  "description": "Partial CI config reference match",
                  "properties": {
                    "file": {
                      "type": "string",
                      "description": "CI configuration file name (e.g., '.gitlab-ci.yml')"
                    }
                  }
                }
              ],
              "description": "Reference to the GitLab CI configuration"
            },
            "environment": {
              "type": "string",
              "description": "GitLab environment name"
            }
          }
        },
        "permissions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "createPackage",
              "createStagedPackage",
              "manageDistTags"
            ]
          },
          "description": "List of permissions granted to the trusted publisher configuration"
        }
      }
    }
  }
}