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:
parent
547b5c1426
commit
9348d33b75
1 changed files with 272 additions and 239 deletions
30
oauthex/auth_meta_test.go
Normal file
30
oauthex/auth_meta_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue