Documentation
¶
Overview ¶
Package groupserviceaccounts implements MCP tool handlers for GitLab group service account operations.
markdown.go provides Markdown formatting functions for group service account MCP tool output.
register.go wires group service account MCP tools to the MCP server.
Index ¶
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func FormatListMarkdown(out ListOutput) string
- func FormatListMarkdownString(o ListOutput) string
- func FormatListPATMarkdown(out ListPATOutput) string
- func FormatListPATMarkdownString(o ListPATOutput) string
- func FormatMarkdownString(o Output) string
- func FormatOutputMarkdown(out Output) string
- func FormatPATMarkdownString(o PATOutput) string
- func FormatPATOutputMarkdown(out PATOutput) string
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- func RevokePAT(ctx context.Context, client *gitlabclient.Client, input RevokePATInput) error
- type CreateInput
- type CreatePATInput
- type DeleteInput
- type DeleteOutput
- type ListInput
- type ListOutput
- type ListPATInput
- type ListPATOutput
- type Output
- type PATOutput
- type RevokePATInput
- type UpdateInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
Delete deletes a group service account.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders a paginated list of service accounts as Markdown.
func FormatListMarkdownString ¶
func FormatListMarkdownString(o ListOutput) string
FormatListMarkdownString renders a paginated list of service accounts.
func FormatListPATMarkdown ¶
func FormatListPATMarkdown(out ListPATOutput) string
FormatListPATMarkdown renders a paginated list of PATs as Markdown.
func FormatListPATMarkdownString ¶
func FormatListPATMarkdownString(o ListPATOutput) string
FormatListPATMarkdownString renders a paginated list of PATs.
func FormatMarkdownString ¶
FormatMarkdownString renders a service account as Markdown.
func FormatOutputMarkdown ¶
FormatOutputMarkdown renders a single service account as Markdown.
func FormatPATMarkdownString ¶
FormatPATMarkdownString renders a service account PAT as Markdown.
func FormatPATOutputMarkdown ¶
FormatPATOutputMarkdown renders a single PAT as Markdown.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers group service account tools on the MCP server.
func RevokePAT ¶
func RevokePAT(ctx context.Context, client *gitlabclient.Client, input RevokePATInput) error
RevokePAT revokes a personal access token for a group service account.
Types ¶
type CreateInput ¶
type CreateInput struct {
GroupID string `json:"group_id" jsonschema:"Group ID or URL-encoded path (top-level only),required"`
Name string `json:"name,omitempty" jsonschema:"Service account name"`
Username string `json:"username,omitempty" jsonschema:"Service account username"`
Email string `json:"email,omitempty" jsonschema:"Service account email"`
}
CreateInput holds parameters for creating a group service account.
type CreatePATInput ¶
type CreatePATInput struct {
GroupID string `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
ServiceAccountID int64 `json:"service_account_id" jsonschema:"Service account user ID,required"`
Name string `json:"name" jsonschema:"Token name,required"`
Scopes []string `json:"scopes" jsonschema:"Token scopes (e.g. api read_api read_user),required"`
Description string `json:"description,omitempty" jsonschema:"Token description"`
ExpiresAt string `json:"expires_at,omitempty" jsonschema:"Expiration date (YYYY-MM-DD)"`
}
CreatePATInput holds parameters for creating a service account PAT.
type DeleteInput ¶
type DeleteInput struct {
GroupID string `json:"group_id" jsonschema:"Group ID or URL-encoded path (top-level only),required"`
ServiceAccountID int64 `json:"service_account_id" jsonschema:"Service account user ID,required"`
HardDelete bool `json:"hard_delete,omitempty" jsonschema:"Hard delete the service account"`
}
DeleteInput holds parameters for deleting a group service account.
type DeleteOutput ¶
type DeleteOutput = toolutil.DeleteOutput
DeleteOutput confirms the deletion of a resource.
type ListInput ¶
type ListInput struct {
GroupID string `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
toolutil.PaginationInput
OrderBy string `json:"order_by,omitempty" jsonschema:"Order by id or username"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction: asc or desc"`
}
ListInput holds parameters for listing group service accounts.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Accounts []Output `json:"accounts"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput holds a paginated list of group service accounts.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List retrieves service accounts for a group.
type ListPATInput ¶
type ListPATInput struct {
GroupID string `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
ServiceAccountID int64 `json:"service_account_id" jsonschema:"Service account user ID,required"`
toolutil.PaginationInput
}
ListPATInput holds parameters for listing service account PATs.
type ListPATOutput ¶
type ListPATOutput struct {
toolutil.HintableOutput
Tokens []PATOutput `json:"tokens"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListPATOutput holds a paginated list of service account PATs.
func ListPATs ¶
func ListPATs(ctx context.Context, client *gitlabclient.Client, input ListPATInput) (ListPATOutput, error)
ListPATs retrieves personal access tokens for a group service account.
type Output ¶
type Output struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Name string `json:"name"`
Username string `json:"username"`
Email string `json:"email"`
}
Output represents a group service account.
func Create ¶
func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)
Create creates a new group service account.
func Update ¶
func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)
Update updates a group service account.
type PATOutput ¶
type PATOutput struct {
toolutil.HintableOutput
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"`
UserID int64 `json:"user_id"`
Active bool `json:"active"`
ExpiresAt string `json:"expires_at,omitempty"`
Token string `json:"token,omitempty"`
}
PATOutput represents a personal access token for a service account.
func CreatePAT ¶
func CreatePAT(ctx context.Context, client *gitlabclient.Client, input CreatePATInput) (PATOutput, error)
CreatePAT creates a new personal access token for a group service account.
type RevokePATInput ¶
type RevokePATInput struct {
GroupID string `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
ServiceAccountID int64 `json:"service_account_id" jsonschema:"Service account user ID,required"`
TokenID int64 `json:"token_id" jsonschema:"Personal access token ID to revoke,required"`
}
RevokePATInput holds parameters for revoking a service account PAT.
type UpdateInput ¶
type UpdateInput struct {
GroupID string `json:"group_id" jsonschema:"Group ID or URL-encoded path (top-level only),required"`
ServiceAccountID int64 `json:"service_account_id" jsonschema:"Service account user ID,required"`
Name string `json:"name,omitempty" jsonschema:"New name"`
Username string `json:"username,omitempty" jsonschema:"New username"`
Email string `json:"email,omitempty" jsonschema:"New email"`
}
UpdateInput holds parameters for updating a group service account.