Skip to content

Fix OAuth client registration metadata - #36

Merged
tiankaima merged 1 commit into
mainfrom
agent/fix-oauth-native-registration
Aug 11, 2026
Merged

Fix OAuth client registration metadata#36
tiankaima merged 1 commit into
mainfrom
agent/fix-oauth-native-registration

Conversation

@tiankaima

Copy link
Copy Markdown
Member

What changed

  • identify the CLI as a native OAuth client during dynamic registration
  • omit redirect and response metadata for device-code-only registration
  • add regression coverage for browser and device registration payloads

Why

The registration provider defaults clients without application_type to web clients. It then rejects the CLI's HTTP loopback callback, even though loopback HTTP redirects are valid for native clients. The device flow also sent a placeholder callback despite not using redirects.

Impact

life-ustc account login can register its ephemeral loopback callback, and life-ustc account login --device registers as a redirect-free device client.

Validation

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • golangci-lint run ./...
  • go build -buildvcs=false -ldflags "-X github.com/Life-USTC/CLI/internal/cmd/root.version=dev" -o life-ustc ./cmd/life-ustc

The normal make build reached the Go build step but Go 1.25 VCS stamping failed in the linked worktree while probing /home/tiankaima; the equivalent build with VCS stamping disabled passed.

@tiankaima
tiankaima marked this pull request as ready for review August 11, 2026 14:56
@tiankaima
tiankaima merged commit d195666 into main Aug 11, 2026
6 checks passed
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