-
Notifications
You must be signed in to change notification settings - Fork 119
feat: add ACR-specific registry endpoints #5299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Grant Linville <[email protected]>
Signed-off-by: Grant Linville <[email protected]>
500933e to
cfce217
Compare
| 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"))) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
| 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{} { |
There was a problem hiding this comment.
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?
|
I'm (perhaps temporarily) abandoning this PR since we are now unsure about whether we still want this feature |
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.