Skip to content

Conversation

@g-linville
Copy link
Member

@g-linville g-linville commented Dec 12, 2025

This adds a new MCP Registry API setup for each individual AccessControlRule.

I don't believe there is a GH issue that corresponds to this.

@g-linville g-linville marked this pull request as ready for review December 16, 2025 16:39
rw.Header().Set("WWW-Authenticate", fmt.Sprintf(`Bearer realm="MCP Registry", resource_metadata="%s/.well-known/oauth-protected-resource/v0.1/servers"`, strings.TrimSuffix(s.baseURL, "/api")))
if !s.registryNoAuth {
if strings.HasPrefix(req.URL.Path, "/v0.1") {
rw.Header().Set("WWW-Authenticate", fmt.Sprintf(`Bearer realm="MCP Registry", resource_metadata="%s/.well-known/oauth-protected-resource/v0.1/servers"`, strings.TrimSuffix(s.baseURL, "/api")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I don't think the s.baseURL has /api appended to it, so we don't need to TrimSuffix here (and below).

}
server, err := h.fetchCatalogEntry(req, resource.ID, catalogID, workspaceID, reverseDNS)
if err != nil {
// Skip entries that can't be fetched
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see us log any errors we are ignoring during this process.


revealed, err := req.GPTClient.RevealCredential(req.Context(), []string{ctx}, server.Name)
if err != nil {
return make(map[string]string), nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
return make(map[string]string), nil
return nil, nil

}

// authGroupSet extracts auth groups from user info (reuse from helper.go)
func authGroupSet(user interface{ GetExtra() map[string][]string }) map[string]struct{} {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason the type of user can't be the user.Info?

@g-linville
Copy link
Member Author

I'm (perhaps temporarily) abandoning this PR since we are now unsure about whether we still want this feature

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.

2 participants