Help us shape the future of Go! Take the 2026 Go Developer Survey

securefiles

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 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 FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown formats secure files as markdown.

func FormatShowMarkdown

func FormatShowMarkdown(f SecureFileItem) string

FormatShowMarkdown renders one secure file as the card of one object: the identity, the digest, the two timestamps, and the parsed certificate or provisioning-profile metadata as a section of its own.

The download hint this card used to carry named `gitlab_show_secure_file`, which is the action that produced the card and downloads nothing: GitLab serves a secure file's contents only to a CI job, and this server exposes no such route. A hint pointing at a route nobody implements is worse than no hint, so it is gone.

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

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"`
	FileExtension     string              `json:"file_extension,omitempty"`
	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

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

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