usergpgkeys

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: 9 Imported by: 0

Documentation

Overview

Package usergpgkeys implements GitLab GPG key management operations for users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDeleteMarkdownString

func FormatDeleteMarkdownString(o DeleteOutput) string

FormatDeleteMarkdownString renders a GPG key deletion confirmation.

func FormatListMarkdownString

func FormatListMarkdownString(o ListOutput) string

FormatListMarkdownString renders a GPG key list as a Markdown string.

func FormatMarkdownString

func FormatMarkdownString(o Output) string

FormatMarkdownString renders a single GPG key as a Markdown string.

func RegisterTools

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

RegisterTools registers GPG key management tools.

Types

type AddForUserInput

type AddForUserInput struct {
	UserID int64  `json:"user_id" jsonschema:"The ID of the user,required"`
	Key    string `json:"key" jsonschema:"The armored GPG public key content,required"`
}

AddForUserInput holds parameters for adding a GPG key to a specific user.

type AddInput

type AddInput struct {
	Key string `json:"key" jsonschema:"The armored GPG public key content,required"`
}

AddInput holds parameters for adding a GPG key to the current user.

type DeleteForUserInput

type DeleteForUserInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user,required"`
	KeyID  int64 `json:"key_id" jsonschema:"The ID of the GPG key to delete,required"`
}

DeleteForUserInput holds parameters for deleting a GPG key from a specific user.

type DeleteInput

type DeleteInput struct {
	KeyID int64 `json:"key_id" jsonschema:"The ID of the GPG key to delete,required"`
}

DeleteInput holds parameters for deleting a GPG key from the current user.

type DeleteOutput

type DeleteOutput struct {
	KeyID   int64 `json:"key_id"`
	Deleted bool  `json:"deleted"`
}

DeleteOutput represents the result of deleting a GPG key.

func Delete

func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) (DeleteOutput, error)

Delete deletes a GPG key from the current authenticated user.

func DeleteForUser

func DeleteForUser(ctx context.Context, client *gitlabclient.Client, input DeleteForUserInput) (DeleteOutput, error)

DeleteForUser deletes a GPG key from a specific user (admin only).

type GetForUserInput

type GetForUserInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user,required"`
	KeyID  int64 `json:"key_id" jsonschema:"The ID of the GPG key,required"`
}

GetForUserInput holds parameters for retrieving a specific GPG key for a user.

type GetInput

type GetInput struct {
	KeyID int64 `json:"key_id" jsonschema:"The ID of the GPG key,required"`
}

GetInput holds parameters for retrieving a specific GPG key.

type ListForUserInput

type ListForUserInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user,required"`
}

ListForUserInput holds parameters for listing GPG keys for a specific user.

type ListInput

type ListInput struct{}

ListInput is empty — lists GPG keys for the current user.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Keys []Output `json:"keys"`
}

ListOutput holds a list of GPG keys.

func List

func List(ctx context.Context, client *gitlabclient.Client, _ ListInput) (ListOutput, error)

List retrieves GPG keys for the current authenticated user.

func ListForUser

func ListForUser(ctx context.Context, client *gitlabclient.Client, input ListForUserInput) (ListOutput, error)

ListForUser retrieves GPG keys for a specific user.

type Output

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

Output represents a GPG key.

func Add

func Add(ctx context.Context, client *gitlabclient.Client, input AddInput) (Output, error)

Add adds a GPG key to the current authenticated user.

func AddForUser

func AddForUser(ctx context.Context, client *gitlabclient.Client, input AddForUserInput) (Output, error)

AddForUser adds a GPG key to a specific user (admin only).

func Get

func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)

Get retrieves a specific GPG key for the current user.

func GetForUser

func GetForUser(ctx context.Context, client *gitlabclient.Client, input GetForUserInput) (Output, error)

GetForUser retrieves a specific GPG key for a specific user.

Jump to

Keyboard shortcuts

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