Skip to content

fix(accounts): normalize API key upstream endpoints - #183

Merged
HTExplicit merged 1 commit into
mainfrom
fix/apikey-account-creation
Sep 18, 2026
Merged

HTExplicit merged 1 commit into
mainfrom
fix/apikey-account-creation

Conversation

@HTExplicit

Copy link
Copy Markdown
Owner

Problem

The admin API-key account form passed a host-only endpoint such as api2.aigcbest.top to the upstream model-sync preview. The preview rejected it as an invalid URL before account creation, while other paths handled endpoint input differently.

Fix

  • Normalize host/path shorthand to https://... in the account form and in the backend credential/preview path.
  • Normalize nested adaptive protocol endpoints as well.
  • Keep explicit schemes unchanged so the existing URL allowlist and private-host checks remain authoritative.
  • Add regression coverage for normalization and API-key model-sync preview with a host-only endpoint.

Validation

  • go build ./...
  • Go service and admin handler targeted tests
  • Frontend account modal, credential-builder, and model-capacity tests (117 account/credential tests plus 31 capacity tests)
  • ESLint, vue-tsc, gofmt, and git diff --check

@HTExplicit
HTExplicit force-pushed the fix/apikey-account-creation branch 2 times, most recently from caa2227 to 88d24f6 Compare September 18, 2026 12:08
@HTExplicit
HTExplicit merged commit a2f13d3 into main Sep 18, 2026
16 checks passed
@HTExplicit
HTExplicit deleted the fix/apikey-account-creation branch September 18, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant