Cloud Authentication

Create a GitHub cloud auth persona mapping

Create a GitHub cloud authentication persona mapping. This endpoint associates a GitHub Actions OIDC principal with a Datadog user. The mapped principal can request an impersonation token.

post/api/v2/wif/github/persona_mapping

Request

Request body

Example request

{
  "data": {
    "attributes": {
      "account_identifier": "test@example.com",
      "claim_matchers": {
        "actor": "octocat",
        "actor_id": "1234567",
        "enterprise": "test_enterprise",
        "enterprise_id": "42",
        "environment": "production",
        "event_name": "push",
        "job_workflow_ref": "test_owner/test_repo/.github/workflows/jobs.yml@refs/heads/main",
        "ref": "refs/heads/main",
        "ref_type": "branch",
        "repository": "test_owner/test_repo",
        "repository_id": "123456789",
        "repository_owner": "test_owner",
        "repository_owner_id": "987654321",
        "repository_visibility": "public",
        "runner_environment": "github-hosted",
        "sub": "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)",
        "workflow": "CI",
        "workflow_ref": "test_owner/test_repo/.github/workflows/ci.yml@refs/heads/main"
      }
    },
    "type": "github_oidc_auth_config"
  }
}

Response

Created

Example response

{
  "data": {
    "attributes": {
      "account_identifier": "test@example.com",
      "account_uuid": "12bbdc5c-5966-47e0-8733-285f9e44bcf4",
      "claim_matchers": {
        "actor": "octocat",
        "actor_id": "1234567",
        "enterprise": "test_enterprise",
        "enterprise_id": "42",
        "environment": "production",
        "event_name": "push",
        "job_workflow_ref": "test_owner/test_repo/.github/workflows/jobs.yml@refs/heads/main",
        "ref": "refs/heads/main",
        "ref_type": "branch",
        "repository": "test_owner/test_repo",
        "repository_id": "123456789",
        "repository_owner": "test_owner",
        "repository_owner_id": "987654321",
        "repository_visibility": "public",
        "runner_environment": "github-hosted",
        "sub": "repo:test_owner/test_repo:(ref:refs/heads/main|pull_request)",
        "workflow": "CI",
        "workflow_ref": "test_owner/test_repo/.github/workflows/ci.yml@refs/heads/main"
      }
    },
    "id": "c5c758c6-18c2-4484-ae3f-46b84128404a",
    "type": "github_oidc_auth_config"
  }
}

Changes

Changes to this operation have not been checked yet.