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

groupcredentials

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package groupcredentials implements MCP tools for GitLab group credential inventory operations.

The package wraps the GitLab Credentials inventory 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 group credential inventory actions.

func DeleteSSHKey

func DeleteSSHKey(ctx context.Context, client *gitlabclient.Client, in DeleteSSHKeyInput) error

DeleteSSHKey deletes an SSH key from a group.

func FormatPATListMarkdown

func FormatPATListMarkdown(out PATListOutput) string

FormatPATListMarkdown renders a page of enterprise personal access tokens as a Markdown table.

The hints used to be written between the heading and the table header, which left the header lazily continuing the guidance list: no table rendered at all, and ExtractHints found no section to read.

func FormatPATMarkdown

func FormatPATMarkdown(out PATOutput) string

FormatPATMarkdown renders one enterprise personal access token as a card.

Revoked is written as a warning rather than as a flag: a tick against "Revoked" reads as success, which is the opposite of what it says.

func FormatSSHKeyListMarkdown

func FormatSSHKeyListMarkdown(out SSHKeyListOutput) string

FormatSSHKeyListMarkdown renders a page of enterprise SSH keys as a Markdown table.

func FormatSSHKeyMarkdown

func FormatSSHKeyMarkdown(out SSHKeyOutput) string

FormatSSHKeyMarkdown renders one enterprise SSH key as a card.

func RevokePAT

func RevokePAT(ctx context.Context, client *gitlabclient.Client, in RevokePATInput) error

RevokePAT revokes a personal access token for a group.

Types

type DeleteSSHKeyInput

type DeleteSSHKeyInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	KeyID   int64                `json:"key_id"   jsonschema:"SSH key ID,required"`
}

DeleteSSHKeyInput holds parameters for deleting a group SSH key.

type ListPATsInput

type ListPATsInput struct {
	GroupID        toolutil.StringOrInt `json:"group_id"                  jsonschema:"Group ID or URL-encoded path,required"`
	Search         string               `json:"search,omitempty"          jsonschema:"Filter tokens by name"`
	State          string               `json:"state,omitempty"           jsonschema:"Filter by token state: active or inactive"`
	Revoked        *bool                `json:"revoked,omitempty"         jsonschema:"Filter by revoked status"`
	CreatedAfter   string               `json:"created_after,omitempty"   jsonschema:"Return tokens created on or after this date (YYYY-MM-DD)"`
	CreatedBefore  string               `json:"created_before,omitempty"  jsonschema:"Return tokens created on or before this date (YYYY-MM-DD)"`
	LastUsedAfter  string               `json:"last_used_after,omitempty" jsonschema:"Return tokens last used on or after this date (YYYY-MM-DD)"`
	LastUsedBefore string               `json:"last_used_before,omitempty" jsonschema:"Return tokens last used on or before this date (YYYY-MM-DD)"`
	OrderBy        string               `json:"order_by,omitempty"        jsonschema:"Column to order keyset-paginated results by"`
	Sort           string               `json:"sort,omitempty"            jsonschema:"Sort order for keyset pagination: 'asc' or 'desc'"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

ListPATsInput holds parameters for listing group personal access tokens.

type ListSSHKeysInput

type ListSSHKeysInput struct {
	GroupID       toolutil.StringOrInt `json:"group_id"                 jsonschema:"Group ID or URL-encoded path,required"`
	CreatedAfter  string               `json:"created_after,omitempty"  jsonschema:"Return keys created on or after this date (YYYY-MM-DD)"`
	CreatedBefore string               `json:"created_before,omitempty" jsonschema:"Return keys created on or before this date (YYYY-MM-DD)"`
	ExpiresAfter  string               `json:"expires_after,omitempty"  jsonschema:"Return keys expiring on or after this date (YYYY-MM-DD)"`
	ExpiresBefore string               `json:"expires_before,omitempty" jsonschema:"Return keys expiring on or before this date (YYYY-MM-DD)"`
	OrderBy       string               `json:"order_by,omitempty"       jsonschema:"Column to order keyset-paginated results by"`
	Sort          string               `json:"sort,omitempty"           jsonschema:"Sort order for keyset pagination: 'asc' or 'desc'"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

ListSSHKeysInput holds parameters for listing group SSH keys.

type PATListOutput

type PATListOutput struct {
	toolutil.HintableOutput
	Tokens     []PATOutput               `json:"tokens"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

PATListOutput holds the list response for PATs.

func ListPATs

func ListPATs(ctx context.Context, client *gitlabclient.Client, in ListPATsInput) (PATListOutput, error)

ListPATs returns all personal access tokens for a group.

type PATOutput

type PATOutput struct {
	ID          int64    `json:"id"`
	Name        string   `json:"name"`
	Revoked     bool     `json:"revoked"`
	CreatedAt   string   `json:"created_at,omitempty"`
	Description string   `json:"description,omitempty"`
	Scopes      []string `json:"scopes,omitempty"`
	UserID      int64    `json:"user_id"`
	LastUsedAt  string   `json:"last_used_at,omitempty"`
	Active      bool     `json:"active"`
	ExpiresAt   string   `json:"expires_at,omitempty"`
}

PATOutput represents a group personal access token.

type RevokePATInput

type RevokePATInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	TokenID int64                `json:"token_id" jsonschema:"Personal access token ID,required"`
}

RevokePATInput holds parameters for revoking a group personal access token.

type SSHKeyListOutput

type SSHKeyListOutput struct {
	toolutil.HintableOutput
	Keys       []SSHKeyOutput            `json:"keys"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

SSHKeyListOutput holds the list response for SSH keys.

func ListSSHKeys

func ListSSHKeys(ctx context.Context, client *gitlabclient.Client, in ListSSHKeysInput) (SSHKeyListOutput, error)

ListSSHKeys returns all SSH keys for a group.

type SSHKeyOutput

type SSHKeyOutput struct {
	ID         int64  `json:"id"`
	Title      string `json:"title"`
	CreatedAt  string `json:"created_at,omitempty"`
	ExpiresAt  string `json:"expires_at,omitempty"`
	LastUsedAt string `json:"last_used_at,omitempty"`
	UsageType  string `json:"usage_type,omitempty"`
	UserID     int64  `json:"user_id"`
}

SSHKeyOutput represents a group SSH key.

Jump to

Keyboard shortcuts

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