feat(auth): Implement GitHub OAuth authentication flow for package publishing
- 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.
This commit is contained in:
parent
582d93a103
commit
2089c5aaa1
1 changed files with 924 additions and 35 deletions
65
internal/docs/publish_swagger.yaml
Normal file
65
internal/docs/publish_swagger.yaml
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/v0/publish:
|
||||
post:
|
||||
tags:
|
||||
- servers
|
||||
summary: Publish a server to the registry
|
||||
description: Adds a new server to the MCP registry with authentication
|
||||
operationId: publishServer
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
server_detail:
|
||||
$ref: '#/components/schemas/ServerDetail'
|
||||
authentication:
|
||||
$ref: '#/components/schemas/Authentication'
|
||||
auth_status_token:
|
||||
type: string
|
||||
description: Optional status token from a device authorization flow
|
||||
responses:
|
||||
'201':
|
||||
description: Server published successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
example: Server publication successful
|
||||
id:
|
||||
type: string
|
||||
example: 1234567890abcdef12345678
|
||||
'400':
|
||||
description: Invalid request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: Name is required
|
||||
'401':
|
||||
description: Authentication failed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: Authentication is required for publishing
|
||||
'500':
|
||||
description: Server error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: Failed to publish server details
|
||||
Loading…
Reference in a new issue