deploykeys

package
v2.0.5 Latest Latest
Warning

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

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

Documentation

Overview

Package deploykeys implements MCP tools for GitLab deploy key operations.

The package wraps the GitLab Deploy keys API:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec

ActionSpecs returns canonical specs for deploy key actions.

func Delete

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

Delete removes a deploy key from a project.

func FormatInstanceListMarkdown

func FormatInstanceListMarkdown(o InstanceListOutput) string

FormatInstanceListMarkdown formats a list of instance deploy keys.

func FormatInstanceOutputMarkdown

func FormatInstanceOutputMarkdown(o InstanceOutput) string

FormatInstanceOutputMarkdown formats a single instance deploy key.

func FormatListMarkdown

func FormatListMarkdown(o ListOutput) string

FormatListMarkdown formats a list of project deploy keys.

func FormatOutputMarkdown

func FormatOutputMarkdown(o Output) string

FormatOutputMarkdown formats a single deploy key.

Types

type AddInput

type AddInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	Title     string               `json:"title" jsonschema:"Deploy key title,required"`
	Key       string               `json:"key" jsonschema:"Public SSH key content,required"`
	CanPush   *bool                `json:"can_push,omitempty" jsonschema:"Whether the key can push to the project"`
	ExpiresAt string               `json:"expires_at,omitempty" jsonschema:"Expiry date (YYYY-MM-DD)"`
}

AddInput represents parameters for adding a deploy key to a project.

type AddInstanceInput

type AddInstanceInput struct {
	Title     string `json:"title" jsonschema:"Deploy key title,required"`
	Key       string `json:"key" jsonschema:"Public SSH key content,required"`
	ExpiresAt string `json:"expires_at,omitempty" jsonschema:"Expiry date (YYYY-MM-DD)"`
}

AddInstanceInput represents parameters for creating an instance-level deploy key.

type DeleteInput

type DeleteInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	DeployKeyID int64                `json:"deploy_key_id" jsonschema:"Deploy key ID returned by deploy key operations; do not use deploy_token_id,required"`
}

DeleteInput represents parameters for deleting a deploy key.

type EnableInput

type EnableInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	DeployKeyID int64                `json:"deploy_key_id" jsonschema:"Deploy key ID to enable; do not use deploy_token_id,required"`
}

EnableInput represents parameters for enabling a deploy key for a project.

type GetInput

type GetInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	DeployKeyID int64                `json:"deploy_key_id" jsonschema:"Deploy key ID returned by deploy key operations; do not use deploy_token_id,required"`
}

GetInput represents parameters for getting a single deploy key.

type InstanceListOutput

type InstanceListOutput struct {
	toolutil.HintableOutput
	DeployKeys []InstanceOutput          `json:"deploy_keys"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

InstanceListOutput holds a paginated list of instance deploy keys.

func ListAll

func ListAll(ctx context.Context, client *gitlabclient.Client, input ListAllInput) (InstanceListOutput, error)

ListAll lists all instance-level deploy keys.

type InstanceOutput

type InstanceOutput struct {
	toolutil.HintableOutput
	ID                         int64            `json:"id"`
	Title                      string           `json:"title"`
	Key                        string           `json:"key"`
	Fingerprint                string           `json:"fingerprint,omitempty"`
	FingerprintSHA256          string           `json:"fingerprint_sha256,omitempty"`
	CreatedAt                  string           `json:"created_at,omitempty"`
	ExpiresAt                  string           `json:"expires_at,omitempty"`
	ProjectsWithWriteAccess    []ProjectSummary `json:"projects_with_write_access,omitempty"`
	ProjectsWithReadonlyAccess []ProjectSummary `json:"projects_with_readonly_access,omitempty"`
}

InstanceOutput represents an instance-level deploy key.

func AddInstance

func AddInstance(ctx context.Context, client *gitlabclient.Client, input AddInstanceInput) (InstanceOutput, error)

AddInstance creates an instance-level deploy key.

type ListAllInput

type ListAllInput struct {
	Public  *bool `json:"public,omitempty" jsonschema:"Filter by public keys"`
	Page    int   `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage int   `json:"per_page,omitempty" jsonschema:"Results per page (max 100)"`
}

ListAllInput represents parameters for listing all instance-level deploy keys.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	DeployKeys []Output                  `json:"deploy_keys"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListOutput holds a paginated list of project deploy keys.

func ListProject

func ListProject(ctx context.Context, client *gitlabclient.Client, input ListProjectInput) (ListOutput, error)

ListProject lists all deploy keys for a project.

func ListUserProject

func ListUserProject(ctx context.Context, client *gitlabclient.Client, input ListUserProjectInput) (ListOutput, error)

ListUserProject lists deploy keys for a specific user's projects.

type ListProjectInput

type ListProjectInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	Page      int                  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage   int                  `json:"per_page,omitempty" jsonschema:"Results per page (max 100)"`
}

ListProjectInput represents parameters for listing project deploy keys.

type ListUserProjectInput

type ListUserProjectInput struct {
	UserID  toolutil.StringOrInt `json:"user_id" jsonschema:"User ID or username,required"`
	Page    int                  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage int                  `json:"per_page,omitempty" jsonschema:"Results per page (max 100)"`
}

ListUserProjectInput represents parameters for listing a user's project deploy keys.

type Output

type Output struct {
	toolutil.HintableOutput
	ID                int64  `json:"id"`
	Title             string `json:"title"`
	Key               string `json:"key"`
	Fingerprint       string `json:"fingerprint,omitempty"`
	FingerprintSHA256 string `json:"fingerprint_sha256,omitempty"`
	CreatedAt         string `json:"created_at,omitempty"`
	CanPush           bool   `json:"can_push"`
	ExpiresAt         string `json:"expires_at,omitempty"`
}

Output represents a project-level deploy key.

func Add

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

Add adds a deploy key to a project.

func Enable

func Enable(ctx context.Context, client *gitlabclient.Client, input EnableInput) (Output, error)

Enable enables a deploy key for a project.

func Get

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

Get retrieves a single deploy key by ID.

func Update

func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)

Update updates an existing deploy key.

type ProjectSummary

type ProjectSummary struct {
	ID                int64  `json:"id"`
	Name              string `json:"name"`
	PathWithNamespace string `json:"path_with_namespace"`
	CreatedAt         string `json:"created_at,omitempty"`
}

ProjectSummary holds basic project info for an InstanceDeployKey.

type UpdateInput

type UpdateInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	DeployKeyID int64                `json:"deploy_key_id" jsonschema:"Deploy key ID returned by deploy key operations; do not use deploy_token_id,required"`
	Title       string               `json:"title,omitempty" jsonschema:"New deploy key title"`
	CanPush     *bool                `json:"can_push,omitempty" jsonschema:"Whether the key can push to the project"`
}

UpdateInput represents parameters for updating a deploy key.

Jump to

Keyboard shortcuts

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