Skip to content

Commit a608ec2

Browse files
committed
add doc
1 parent a39b8cf commit a608ec2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

internal/oauthex/auth_meta.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ import (
1515
)
1616

1717
// AuthServerMeta represents the metadata for an OAuth 2.0 authorization server,
18-
// as defined in RFC 8414 (https://tools.ietf.org/html/rfc8414).
18+
// as defined in [RFC 8414].
1919
//
2020
// Not supported:
2121
// - signed metadata
22+
//
23+
// [RFC 8414]: https://tools.ietf.org/html/rfc8414)
2224
type AuthServerMeta struct {
2325
// GENERATED BY GEMINI 2.5.
2426

@@ -112,6 +114,15 @@ var wellKnownPaths = []string{
112114
"/.well-known/openid-configuration",
113115
}
114116

117+
// GetAuthServerMeta issues a GET request to retrieve authorization server metadata
118+
// from an OAuth authorization server with the given issuerURL.
119+
//
120+
// It follows [RFC 8414]:
121+
// - The well-known paths specified there are inserted into the URL's path, one at time.
122+
// The first to succeed is used.
123+
// - The Issuer field is checked against issuerURL.
124+
//
125+
// [RFC 8414]: https://tools.ietf.org/html/rfc8414
115126
func GetAuthServerMeta(ctx context.Context, issuerURL string, c *http.Client) (*AuthServerMeta, error) {
116127
var errs []error
117128
for _, p := range wellKnownPaths {

0 commit comments

Comments
 (0)