Skip to content

fix(digitalocean): use OAuth token directly for inference instead of creating MAK#28897

Open
Spherrrical wants to merge 6 commits into
anomalyco:devfrom
Spherrrical:fix/digitalocean-oauth-use-token-directly
Open

fix(digitalocean): use OAuth token directly for inference instead of creating MAK#28897
Spherrrical wants to merge 6 commits into
anomalyco:devfrom
Spherrrical:fix/digitalocean-oauth-use-token-directly

Conversation

@Spherrrical
Copy link
Copy Markdown
Contributor

@Spherrrical Spherrrical commented May 22, 2026

Issue for this PR

Closes #28899

Type of change

  • Bug fix

What does this PR do?

DigitalOcean retired the /v2/gen-ai/models/api_keys endpoint (returns 410). The OAuth flow was calling it to create a Model Access Key after sign-in, so authentication always failed for new users.

The fix: store the OAuth access token directly as the API key instead. DigitalOcean now uses unified API tokens — the OAuth token works for inference calls without needing a separate MAK. OAuth scopes updated to genai:read inference:query (minimum required for router listing and inference).

How did you verify your code works?

Ran /connect → DigitalOcean OAuth end-to-end. Token is stored correctly, Inference Routers are discovered, and inference calls succeed.

Screenshots / recordings

No UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…creating MAK

The /v2/gen-ai/models/api_keys endpoint is retired and returns 410.
OAuth token is now stored as the API key directly for inference calls.
Scopes updated to genai:read and inference:query (minimum required).
@github-actions github-actions Bot added contributor needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels May 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels May 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@rekram1-node
Copy link
Copy Markdown
Collaborator

/review


await new Promise<void>((resolve, reject) => {
oauthServer!.listen(OAUTH_PORT, () => {
oauthServer!.listen(OAUTH_PORT, "127.0.0.1", () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion (human choice): binding only to 127.0.0.1 can make the OAuth callback fail on systems where localhost resolves to IPv6 (::1) first, because the authorize URL still uses http://localhost:1456/.... Either make the redirect URI use 127.0.0.1 too, or keep the listener hostless so it accepts the localhost resolution.

Suggested change
oauthServer!.listen(OAUTH_PORT, "127.0.0.1", () => {
oauthServer!.listen(OAUTH_PORT, () => {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(digitalocean): OAuth flow fails because MAK creation endpoint is retired

2 participants