keys

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package keys implements MCP tools for GitLab SSH key lookup operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatMarkdown

func FormatMarkdown(out Output) *mcp.CallToolResult

FormatMarkdown formats a key as Markdown.

func FormatMarkdownString

func FormatMarkdownString(out Output) string

FormatMarkdownString renders a key as Markdown.

func RegisterMeta

func RegisterMeta(server *mcp.Server, client *gitlabclient.Client)

RegisterMeta registers the gitlab_key meta-tool.

func RegisterTools

func RegisterTools(server *mcp.Server, client *gitlabclient.Client)

RegisterTools registers all key tools on the MCP server.

Types

type GetByFingerprintInput

type GetByFingerprintInput struct {
	Fingerprint string `json:"fingerprint" jsonschema:"SSH key fingerprint (e.g. SHA256:abc123 or MD5:aa:bb:cc),required"`
}

GetByFingerprintInput is the input for getting a key by fingerprint.

type GetByIDInput

type GetByIDInput struct {
	KeyID int64 `json:"key_id" jsonschema:"SSH key ID,required"`
}

GetByIDInput is the input for getting a key by its ID.

type Output

type Output struct {
	toolutil.HintableOutput
	ID        int64      `json:"id"`
	Title     string     `json:"title"`
	Key       string     `json:"key"`
	CreatedAt string     `json:"created_at,omitempty"`
	User      UserOutput `json:"user"`
}

Output represents an SSH key with its associated user.

func GetKeyByFingerprint

func GetKeyByFingerprint(ctx context.Context, client *gitlabclient.Client, input GetByFingerprintInput) (Output, error)

GetKeyByFingerprint retrieves an SSH key by its fingerprint.

func GetKeyWithUser

func GetKeyWithUser(ctx context.Context, client *gitlabclient.Client, input GetByIDInput) (Output, error)

GetKeyWithUser retrieves an SSH key and the user it belongs to.

type UserOutput

type UserOutput struct {
	ID       int64  `json:"id"`
	Username string `json:"username"`
	Name     string `json:"name"`
}

UserOutput represents the user associated with a key.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL