oauthex: move internal/oauthex to oauthex (#559)

This PR relocates oauthex and moves DCR logic into dcr.go.

Fixes #558
This commit is contained in:
Sam Thanawalla 2025-10-07 08:39:49 -04:00 • committed by GitHub
commit 9348d33b75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

30
oauthex/auth_meta_test.go Normal file
View file

@ -0,0 +1,30 @@
// Copyright 2025 The Go MCP SDK Authors. All rights reserved.
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
//go:build mcp_go_client_oauth
package oauthex
import (
"encoding/json"
"os"
"path/filepath"
"testing"
)
func TestAuthMetaParse(t *testing.T) {
// Verify that we parse Google's auth server metadata.
data, err := os.ReadFile(filepath.FromSlash("testdata/google-auth-meta.json"))
if err != nil {
t.Fatal(err)
}
var a AuthServerMeta
if err := json.Unmarshal(data, &a); err != nil {
t.Fatal(err)
}
// Spot check.
if g, w := a.Issuer, "https://accounts.google.com"; g != w {
t.Errorf("got %q, want %q", g, w)
}
}