securefiles

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package securefiles implements MCP tools for GitLab project secure file operations.

The package wraps the GitLab Secure files 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 secure file tools.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown formats secure files as markdown.

func FormatShowMarkdown

func FormatShowMarkdown(f SecureFileItem) string

FormatShowMarkdown formats a secure file as markdown.

func Remove

func Remove(ctx context.Context, client *gitlabclient.Client, input RemoveInput) error

Remove deletes a secure file.

Types

type CreateInput

type CreateInput struct {
	ProjectID     toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	Name          string               `json:"name" jsonschema:"Name for the secure file,required"`
	FilePath      string               `` /* 190-byte string literal not displayed */
	ContentBase64 string               `` /* 133-byte string literal not displayed */
}

CreateInput contains parameters for creating a secure file. Exactly one of FilePath or ContentBase64 must be provided.

type ListInput

type ListInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	OrderBy   string               `json:"order_by,omitempty" jsonschema:"Column to order keyset-paginated results by"`
	Sort      string               `json:"sort,omitempty"     jsonschema:"Sort direction (asc, desc)"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

ListInput contains parameters for listing secure files. It mirrors gl.ListProjectSecureFilesOptions (embedded gl.ListOptions), exposing keyset pagination (order_by, sort, pagination, page_token) alongside offset pagination.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Files      []SecureFileItem          `json:"files"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListOutput contains a list of secure files.

func List

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

List retrieves secure files for a project.

type RemoveInput

type RemoveInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	FileID    int64                `json:"file_id" jsonschema:"Secure file ID,required"`
}

RemoveInput contains parameters for removing a secure file.

type SecureFileIssuer added in v2.3.0

type SecureFileIssuer struct {
	C  string `json:"C"`
	O  string `json:"O"`
	CN string `json:"CN"`
	OU string `json:"OU"`
}

SecureFileIssuer mirrors gl.SecureFileIssuer (the certificate issuer fields).

type SecureFileItem

type SecureFileItem struct {
	toolutil.HintableOutput
	ID                int64               `json:"id"`
	Name              string              `json:"name"`
	Checksum          string              `json:"checksum"`
	ChecksumAlgorithm string              `json:"checksum_algorithm"`
	CreatedAt         *time.Time          `json:"created_at"`
	ExpiresAt         *time.Time          `json:"expires_at"`
	Metadata          *SecureFileMetadata `json:"metadata"`
}

SecureFileItem represents a single secure file. It mirrors gl.SecureFile.

func Create

func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (SecureFileItem, error)

Create uploads a new secure file.

func Show

func Show(ctx context.Context, client *gitlabclient.Client, input ShowInput) (SecureFileItem, error)

Show retrieves details for a specific secure file.

type SecureFileMetadata added in v2.3.0

type SecureFileMetadata struct {
	ID        string            `json:"id"`
	Issuer    SecureFileIssuer  `json:"issuer"`
	Subject   SecureFileSubject `json:"subject"`
	ExpiresAt *time.Time        `json:"expires_at"`
}

SecureFileMetadata mirrors gl.SecureFileMetadata, the parsed certificate metadata GitLab extracts from a secure file when it is a recognized certificate format.

type SecureFileSubject added in v2.3.0

type SecureFileSubject struct {
	C   string `json:"C"`
	O   string `json:"O"`
	CN  string `json:"CN"`
	OU  string `json:"OU"`
	UID string `json:"UID"`
}

SecureFileSubject mirrors gl.SecureFileSubject (the certificate subject fields).

type ShowInput

type ShowInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	FileID    int64                `json:"file_id" jsonschema:"Secure file ID,required"`
}

ShowInput contains parameters for showing a secure file.

Jump to

Keyboard shortcuts

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