Adds support for auth'ing to the registry via [GitHub Actions OIDC](https://docs.github.com/en/actions/concepts/security/openid-connect). Fixes #271 ## Motivation and Context People will probably want to publish to the registry from CI environments. DNS auth can work here fine (https://github.com/modelcontextprotocol/registry/issues/270). But for people who haven't set up DNS, the standard GitHub device flow won't really work here. We could make this nice by supporting GitHub Actions OIDC. ## How Has This Been Tested? Tested locally with a real GitHub OIDC token from a personal repo. ## Breaking Changes None ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [x] New and existing tests pass locally - [x] I have added appropriate error handling - [x] I have added or updated documentation as needed
22 lines
635 B
Go
22 lines
635 B
Go
package auth
|
|
|
|
import (
|
|
"github.com/danielgtaylor/huma/v2"
|
|
"github.com/modelcontextprotocol/registry/internal/config"
|
|
)
|
|
|
|
// RegisterAuthEndpoints registers all authentication endpoints
|
|
func RegisterAuthEndpoints(api huma.API, cfg *config.Config) {
|
|
// Register GitHub access token authentication endpoint
|
|
RegisterGitHubATEndpoint(api, cfg)
|
|
|
|
// Register GitHub OIDC authentication endpoint
|
|
RegisterGitHubOIDCEndpoint(api, cfg)
|
|
|
|
// Register anonymous authentication endpoint
|
|
RegisterNoneEndpoint(api, cfg)
|
|
|
|
// Future auth providers can be registered here:
|
|
// RegisterGitLabEndpoint(api, cfg)
|
|
// RegisterOIDCEndpoint(api, cfg)
|
|
}
|