- Added authentication service and GitHub OAuth integration. - Introduced new authentication methods and structures in the model. - Updated the API to handle authentication during the publishing process. - Created handlers for starting and checking the status of the OAuth flow. - Enhanced the publish handler to validate authentication credentials. - Updated configuration to include GitHub OAuth settings. - Added tests for the OAuth flow and publishing with authentication. - Updated documentation to reflect changes in the API and authentication process.
20 lines
567 B
Go
20 lines
567 B
Go
// Package router contains API routing logic
|
|
package router
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/modelcontextprotocol/registry/internal/auth"
|
|
"github.com/modelcontextprotocol/registry/internal/config"
|
|
"github.com/modelcontextprotocol/registry/internal/service"
|
|
)
|
|
|
|
// New creates a new router with all API versions registered
|
|
func New(cfg *config.Config, registry service.RegistryService, authService auth.Service) *http.ServeMux {
|
|
mux := http.NewServeMux()
|
|
|
|
// Register routes for all API versions
|
|
RegisterV0Routes(mux, cfg, registry, authService)
|
|
|
|
return mux
|
|
}
|