Skip to content

[BUG] error-tracking endpoint + oauth #45

@markacianfrani

Description

@markacianfrani

Describe the bug

I can't access the error-tracking command when logged in via oauth. Claude's telling me it's a DCR thing, which sounds plausible to me given how much of a cluster DCR is but I have no idea.

To Reproduce

Steps to reproduce the behavior:

  1. Login via oauth. Verify account has error_tracking_read oauth scope
  2. pup error-tracking issue search
  3. See 401 unauthorized

Expected behavior

It works

Environment

  • OS: mac...something. not the newest one, the one before it
  • Pup version: pup version just says dev, also probably another bug
  • Go version: 1.25.0
  • Authentication method: oauth

Claude Slop

1. Add error_tracking_read to DefaultScopes() in pkg/auth/types/types.go

                // Usage
                "usage_read",
+               // Error Tracking
+               "error_tracking_read",
        }

2. Build pup

go build -o $(go env GOPATH)/bin/pup .

3. Clear existing credentials and re-register

pup auth logout
pup auth login

4. Observe the error

The OAuth authorize URL is constructed with the scope parameter including error_tracking_read:

https://app.datadoghq.com/oauth2/v1/authorize?...&scope=dashboards_read+...+usage_read+error_tracking_read&...

Datadog's authorize endpoint immediately redirects back with:

Error: OAuth error: invalid_scope -

No browser consent page is shown.

5. Confirm the endpoint expects this scope (from the OpenAPI spec)

In .generator/schemas/v2/openapi.yaml, the SearchIssues endpoint declares:

/api/v2/error-tracking/issues/search:
  post:
    security:
    - apiKeyAuth: []
      appKeyAuth: []
    - AuthZ:
      - error_tracking_read

Both auth methods are listed — API key+App key OR OAuth2 with error_tracking_read.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions