accessrequests

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package accessrequests implements MCP tools for GitLab project and group access request operations.

The package wraps the GitLab Access requests 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 project and group access request actions.

func DenyGroup

func DenyGroup(ctx context.Context, client *gitlabclient.Client, input DenyGroupInput) error

DenyGroup denies a group access request.

func DenyGroupOutput

func DenyGroupOutput(ctx context.Context, client *gitlabclient.Client, input DenyGroupInput) (toolutil.DeleteOutput, error)

DenyGroupOutput denies a group access request and returns the legacy success message shape.

func DenyProject

func DenyProject(ctx context.Context, client *gitlabclient.Client, input DenyProjectInput) error

DenyProject denies a project access request.

func DenyProjectOutput

func DenyProjectOutput(ctx context.Context, client *gitlabclient.Client, input DenyProjectInput) (toolutil.DeleteOutput, error)

DenyProjectOutput denies a project access request and returns the legacy success message shape.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown formats a list of access requests as markdown.

func FormatOutputMarkdown

func FormatOutputMarkdown(out Output) string

FormatOutputMarkdown formats a single access request as markdown.

Types

type ApproveGroupInput

type ApproveGroupInput struct {
	GroupID     toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or path,required"`
	UserID      int64                `json:"user_id" jsonschema:"User ID of the access requester,required"`
	AccessLevel int                  `json:"access_level,omitempty" jsonschema:"Access level to grant (10=Guest, 20=Reporter, 30=Developer, 40=Maintainer)"`
}

ApproveGroupInput identifies the group access request to approve and the optional granted role.

type ApproveProjectInput

type ApproveProjectInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	UserID      int64                `json:"user_id" jsonschema:"User ID of the access requester,required"`
	AccessLevel int                  `json:"access_level,omitempty" jsonschema:"Access level to grant (10=Guest, 20=Reporter, 30=Developer, 40=Maintainer)"`
}

ApproveProjectInput identifies the project access request to approve and the optional granted role.

type DenyGroupInput

type DenyGroupInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or path,required"`
	UserID  int64                `json:"user_id" jsonschema:"User ID of the access requester,required"`
}

DenyGroupInput identifies the pending group access request to reject.

type DenyProjectInput

type DenyProjectInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	UserID    int64                `json:"user_id" jsonschema:"User ID of the access requester,required"`
}

DenyProjectInput identifies the pending project access request to reject.

type ListGroupInput

type ListGroupInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or path,required"`
	Page    int                  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage int                  `json:"per_page,omitempty" jsonschema:"Number of items per page"`
}

ListGroupInput selects a group and pagination window for pending access requests.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	AccessRequests []Output                  `json:"access_requests"`
	Pagination     toolutil.PaginationOutput `json:"pagination"`
}

ListOutput represents a paginated list of access requests.

func ListGroup

func ListGroup(ctx context.Context, client *gitlabclient.Client, input ListGroupInput) (ListOutput, error)

ListGroup lists access requests for a group.

func ListProject

func ListProject(ctx context.Context, client *gitlabclient.Client, input ListProjectInput) (ListOutput, error)

ListProject lists access requests for a project.

type ListProjectInput

type ListProjectInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
	Page      int                  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage   int                  `json:"per_page,omitempty" jsonschema:"Number of items per page"`
}

ListProjectInput selects a project and pagination window for pending access requests.

type Output

type Output struct {
	toolutil.HintableOutput
	ID          int64  `json:"id"`
	Username    string `json:"username"`
	Name        string `json:"name"`
	State       string `json:"state"`
	CreatedAt   string `json:"created_at,omitempty"`
	RequestedAt string `json:"requested_at,omitempty"`
	AccessLevel int    `json:"access_level"`
}

Output represents a single access request.

func ApproveGroup

func ApproveGroup(ctx context.Context, client *gitlabclient.Client, input ApproveGroupInput) (Output, error)

ApproveGroup approves a group access request.

func ApproveProject

func ApproveProject(ctx context.Context, client *gitlabclient.Client, input ApproveProjectInput) (Output, error)

ApproveProject approves a project access request.

func RequestGroup

func RequestGroup(ctx context.Context, client *gitlabclient.Client, input RequestGroupInput) (Output, error)

RequestGroup requests access to a group for the authenticated user.

func RequestProject

func RequestProject(ctx context.Context, client *gitlabclient.Client, input RequestProjectInput) (Output, error)

RequestProject requests access to a project for the authenticated user.

type RequestGroupInput

type RequestGroupInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or path,required"`
}

RequestGroupInput identifies the group the authenticated user wants to join.

type RequestProjectInput

type RequestProjectInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
}

RequestProjectInput identifies the project the authenticated user wants to join.

Jump to

Keyboard shortcuts

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