applications

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package applications implements MCP tools for GitLab OAuth application operations.

The package wraps the GitLab Applications 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 OAuth application tools.

func Delete

func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error

Delete deletes an application (admin).

func FormatCreateMarkdown

func FormatCreateMarkdown(out CreateOutput) string

FormatCreateMarkdown formats a created application as markdown.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown formats application list as markdown.

func FormatRenewSecretMarkdown added in v2.4.0

func FormatRenewSecretMarkdown(out RenewSecretOutput) string

FormatRenewSecretMarkdown formats a renewed application secret as markdown.

Types

type ApplicationItem

type ApplicationItem struct {
	ID              int64    `json:"id"`
	ApplicationID   string   `json:"application_id"`
	ApplicationName string   `json:"application_name"`
	Secret          string   `json:"secret"`
	CallbackURL     string   `json:"callback_url"`
	Confidential    bool     `json:"confidential"`
	Scopes          []string `json:"scopes,omitempty"`
}

ApplicationItem represents a single application.

type CreateInput

type CreateInput struct {
	Name         string `json:"name" jsonschema:"Application name,required"`
	RedirectURI  string `json:"redirect_uri" jsonschema:"OAuth2 redirect URI,required"`
	Scopes       string `json:"scopes" jsonschema:"Space-separated list of scopes,required"`
	Confidential *bool  `json:"confidential,omitempty" jsonschema:"Whether application is confidential"`
}

CreateInput is the input for creating an application.

type CreateOutput

type CreateOutput struct {
	toolutil.HintableOutput
	ApplicationItem
}

CreateOutput is the output for creating an application.

func Create

func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (CreateOutput, error)

Create creates a new OAuth2 application (admin).

type DeleteInput

type DeleteInput struct {
	ID int64 `json:"id" jsonschema:"Application ID to delete,required"`
}

DeleteInput is the input for deleting an application.

type ListInput

type ListInput struct {
	OrderBy string `json:"order_by,omitempty" jsonschema:"For keyset pagination: name of the column by which to order results"`
	Sort    string `json:"sort,omitempty"     jsonschema:"For keyset pagination: sort order (asc or desc)"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

ListInput is the input for listing applications. It mirrors gl.ListApplicationsOptions, which embeds gl.ListOptions and therefore exposes both offset and keyset pagination plus order_by/sort.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Applications []ApplicationItem         `json:"applications"`
	Pagination   toolutil.PaginationOutput `json:"pagination"`
}

ListOutput is the output for listing applications.

func List

func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)

List retrieves all applications (admin).

type RenewSecretInput added in v2.4.0

type RenewSecretInput struct {
	ID int64 `json:"id" jsonschema:"Application ID whose secret should be renewed,required"`
}

RenewSecretInput is the input for renewing an application secret.

type RenewSecretOutput added in v2.4.0

type RenewSecretOutput struct {
	toolutil.HintableOutput
	ApplicationItem
}

RenewSecretOutput is the output for renewing an application secret. It carries the application record including the freshly generated secret.

func RenewSecret added in v2.4.0

func RenewSecret(ctx context.Context, client *gitlabclient.Client, input RenewSecretInput) (RenewSecretOutput, error)

RenewSecret renews (rotates) the secret of an existing OAuth application (admin). The previous secret is invalidated, so any client using it must be updated with the new value returned here.

Jump to

Keyboard shortcuts

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