#12 Feature: User Public Keys support

Fermé
Créé il y a 9 mois par claude · 3 commentaires

Description

Add support for Gogs User Public Keys functionality to the MCP server.

Why This Feature?

Public keys (SSH keys) are essential for secure authentication with Git repositories. Managing them through the API enables automated key provisioning and user onboarding workflows.

Requirements

  • Implement list_user_keys tool - List public keys for a specific user
  • Implement list_my_keys tool - List authenticated user's public keys
  • Implement get_public_key tool - Get details of a specific public key
  • Implement create_public_key tool - Add a new public key
  • Implement delete_public_key tool - Remove a public key
  • Add proper TypeScript types for PublicKey objects
  • Support key metadata (title, key content, fingerprint, creation date)
  • Update documentation with usage examples

API Endpoints to Implement

  • GET /users/:username/keys - List public keys for a user
  • GET /user/keys - List your public keys
  • GET /user/keys/:id - Get a single public key
  • POST /user/keys - Create a public key
  • DELETE /user/keys/:id - Delete a public key

Related

Requested by @fszontagh in #4

API Reference

See Gogs API documentation for user public keys endpoints.

## Description Add support for Gogs User Public Keys functionality to the MCP server. ## Why This Feature? Public keys (SSH keys) are essential for secure authentication with Git repositories. Managing them through the API enables automated key provisioning and user onboarding workflows. ## Requirements - Implement `list_user_keys` tool - List public keys for a specific user - Implement `list_my_keys` tool - List authenticated user's public keys - Implement `get_public_key` tool - Get details of a specific public key - Implement `create_public_key` tool - Add a new public key - Implement `delete_public_key` tool - Remove a public key - Add proper TypeScript types for PublicKey objects - Support key metadata (title, key content, fingerprint, creation date) - Update documentation with usage examples ## API Endpoints to Implement - `GET /users/:username/keys` - List public keys for a user - `GET /user/keys` - List your public keys - `GET /user/keys/:id` - Get a single public key - `POST /user/keys` - Create a public key - `DELETE /user/keys/:id` - Delete a public key ## Related Requested by @fszontagh in #4 ## API Reference See Gogs API documentation for user public keys endpoints.
Claude Coding Agent a commenté il y a 9 mois
Propriétaire

@fszontagh I'm starting work on this issue now! I'll implement the User Public Keys support by:

  1. Adding TypeScript types for PublicKey objects
  2. Implementing the 5 required API methods in gogs-client.ts
  3. Adding the 5 MCP tools in index.ts with proper Zod schemas
  4. Testing the implementation
  5. Updating README.md and CLAUDE.md documentation

I'll keep you updated on the progress!

@fszontagh I'm starting work on this issue now! I'll implement the User Public Keys support by: 1. Adding TypeScript types for PublicKey objects 2. Implementing the 5 required API methods in gogs-client.ts 3. Adding the 5 MCP tools in index.ts with proper Zod schemas 4. Testing the implementation 5. Updating README.md and CLAUDE.md documentation I'll keep you updated on the progress!
Claude Coding Agent a commenté il y a 9 mois
Propriétaire

✅ Implementation completed! I've successfully added User Public Keys support.

Changes Made:

1. TypeScript Types (src/types.ts)

  • Added GogsPublicKey interface with all required fields:
    • id, title, key, url, created_at, read_only, fingerprint

2. API Client Methods (src/gogs-client.ts)

  • listUserKeys(username) - List public keys for a specific user
  • listMyKeys() - List authenticated user's public keys
  • getPublicKey(keyId) - Get details of a specific public key
  • createPublicKey({ title, key }) - Add a new public key
  • deletePublicKey(keyId) - Remove a public key

3. MCP Tools (src/server.ts)

  • list_user_keys - List public SSH keys for a specific user
  • list_my_keys - List public SSH keys for the authenticated user
  • get_public_key - Get details of a specific public SSH key by ID
  • create_public_key - Create a new public SSH key
  • delete_public_key - Delete a public SSH key by ID

All tools include proper Zod schemas for validation and comprehensive descriptions.

4. Build Status

✅ TypeScript compilation successful - no errors!

Next steps: Testing the implementation and updating documentation.

✅ Implementation completed! I've successfully added User Public Keys support. ## Changes Made: ### 1. TypeScript Types (src/types.ts) - Added `GogsPublicKey` interface with all required fields: - id, title, key, url, created_at, read_only, fingerprint ### 2. API Client Methods (src/gogs-client.ts) - `listUserKeys(username)` - List public keys for a specific user - `listMyKeys()` - List authenticated user's public keys - `getPublicKey(keyId)` - Get details of a specific public key - `createPublicKey({ title, key })` - Add a new public key - `deletePublicKey(keyId)` - Remove a public key ### 3. MCP Tools (src/server.ts) - `list_user_keys` - List public SSH keys for a specific user - `list_my_keys` - List public SSH keys for the authenticated user - `get_public_key` - Get details of a specific public SSH key by ID - `create_public_key` - Create a new public SSH key - `delete_public_key` - Delete a public SSH key by ID All tools include proper Zod schemas for validation and comprehensive descriptions. ### 4. Build Status ✅ TypeScript compilation successful - no errors! Next steps: Testing the implementation and updating documentation.
Claude Coding Agent a référencé ce problème à partir d'un commit il y a 9 mois
Claude Coding Agent a commenté il y a 9 mois
Propriétaire

🎉 Implementation Complete!

I've successfully implemented full User Public Keys support for the Gogs MCP server.

Summary of Changes

✅ Code Implementation

  • types.ts: Added GogsPublicKey interface with all required fields
  • gogs-client.ts: Implemented 5 API client methods
  • server.ts: Added 5 MCP tools with Zod validation schemas
  • Build: All TypeScript compiles without errors

✅ Testing

Successfully tested against live Gogs API:

  • GET /user/keys - List authenticated user's keys
  • GET /users/:username/keys - List user's keys
  • GET /user/keys/:id - Get key by ID
  • ✅ Create and delete operations confirmed working

✅ Documentation

  • README.md:
    • Added "Public Key Management" to features list
    • Documented all 5 new tools with parameters and examples
    • Removed endpoints from "not yet implemented" table
  • CLAUDE.md: Updated MCP Tool Categories with Public Key Management

📦 Commit

Committed and pushed to main branch:

  • Commit: deebc5d
  • Message: feat: add User Public Keys support #12
  • Files changed: 5 files, +257 lines

Available MCP Tools

  1. list_user_keys - List public SSH keys for a specific user
  2. list_my_keys - List authenticated user's SSH keys
  3. get_public_key - Get details of a specific key by ID
  4. create_public_key - Create new SSH key
  5. delete_public_key - Delete SSH key by ID

All requirements from the issue have been fulfilled! 🚀

🎉 **Implementation Complete!** I've successfully implemented full User Public Keys support for the Gogs MCP server. ## Summary of Changes ### ✅ Code Implementation - **types.ts**: Added `GogsPublicKey` interface with all required fields - **gogs-client.ts**: Implemented 5 API client methods - **server.ts**: Added 5 MCP tools with Zod validation schemas - **Build**: All TypeScript compiles without errors ### ✅ Testing Successfully tested against live Gogs API: - ✅ `GET /user/keys` - List authenticated user's keys - ✅ `GET /users/:username/keys` - List user's keys - ✅ `GET /user/keys/:id` - Get key by ID - ✅ Create and delete operations confirmed working ### ✅ Documentation - **README.md**: - Added "Public Key Management" to features list - Documented all 5 new tools with parameters and examples - Removed endpoints from "not yet implemented" table - **CLAUDE.md**: Updated MCP Tool Categories with Public Key Management ### 📦 Commit Committed and pushed to main branch: - Commit: `deebc5d` - Message: `feat: add User Public Keys support #12` - Files changed: 5 files, +257 lines ## Available MCP Tools 1. **list_user_keys** - List public SSH keys for a specific user 2. **list_my_keys** - List authenticated user's SSH keys 3. **get_public_key** - Get details of a specific key by ID 4. **create_public_key** - Create new SSH key 5. **delete_public_key** - Delete SSH key by ID All requirements from the issue have been fulfilled! 🚀
Connectez-vous pour rejoindre cette conversation.
Aucun jalon
Pas d'assignataire
1 Participants
Chargement…
Annuler
Enregistrer
Il n'existe pas encore de contenu.