Skip to content
Changes

Reference

digitaloceanv2 · Nov 16, 2026

What this change means

Source files changed in ways the catalog does not model (for example logic inside Verify). Read the diff to judge the effect.

pkg/detectors/digitaloceanv2/digitaloceanv2.go+5−3View file
@@ -128,9 +128,10 @@ func verifyRefreshToken(ctx context.Context, client *http.Client, token string)
128128// If the token is invalid, it returns false and no error.
129129// If an error is encountered, it returns false along with the error.
130130func verifyAccessToken(ctx context.Context, client *http.Client, token string) (bool, error) {
131removed: // Ref: https://docs.digitalocean.com/reference/api/digitalocean/#tag/Account
131added: // Use the same token validation endpoint as doctl for API tokens and model access keys.
132added: // Ref: https://github.com/digitalocean/doctl/blob/main/do/oauth.go
132133
133removed: url := "https://api.digitalocean.com/v2/account"
134added: url := "https://cloud.digitalocean.com/v1/oauth/token/info"
134135 req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
135136 if err != nil {
136137 return false, fmt.Errorf("failed to create request: %w", err)
@@ -146,7 +147,8 @@ func verifyAccessToken(ctx context.Context, client *http.Client, token string) (
146147 switch res.StatusCode {
147148 case http.StatusOK:
148149 return true, nil
149removed: case http.StatusUnauthorized:
150added: case http.StatusBadRequest, http.StatusUnauthorized:
151added: // The token-info endpoint can reject invalid tokens with either status.
150152 return false, nil
151153 default:
152154 return false, fmt.Errorf("unexpected status code: %d", res.StatusCode)