Documentation
¶
Overview ¶
Package groupcredentials implements GitLab group credential operations including listing and revoking personal access tokens and SSH keys for groups.
markdown.go provides Markdown formatting functions for group credential MCP tool output.
register.go wires group credential MCP tools to the MCP server.
Index ¶
- func DeleteSSHKey(ctx context.Context, client *gitlabclient.Client, in DeleteSSHKeyInput) error
- func FormatPATListMarkdown(out PATListOutput) string
- func FormatPATMarkdown(out PATOutput) string
- func FormatSSHKeyListMarkdown(out SSHKeyListOutput) string
- func FormatSSHKeyMarkdown(out SSHKeyOutput) string
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- func RevokePAT(ctx context.Context, client *gitlabclient.Client, in RevokePATInput) error
- type DeleteSSHKeyInput
- type ListPATsInput
- type ListSSHKeysInput
- type PATListOutput
- type PATOutput
- type RevokePATInput
- type SSHKeyListOutput
- type SSHKeyOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 formats a list of personal access tokens as Markdown.
func FormatPATMarkdown ¶
FormatPATMarkdown formats a single personal access token as Markdown.
func FormatSSHKeyListMarkdown ¶
func FormatSSHKeyListMarkdown(out SSHKeyListOutput) string
FormatSSHKeyListMarkdown formats a list of SSH keys as Markdown.
func FormatSSHKeyMarkdown ¶
func FormatSSHKeyMarkdown(out SSHKeyOutput) string
FormatSSHKeyMarkdown formats a single SSH key as Markdown.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers MCP tools for GitLab group credential operations.
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 state (active, inactive)"`
Revoked *bool `json:"revoked,omitempty" jsonschema:"Filter by revoked status"`
toolutil.PaginationInput
}
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"`
toolutil.PaginationInput
}
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"`
State string `json:"state,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"`
Key string `json:"key,omitempty"`
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.