enterpriseusers

package
v2.4.1 Latest Latest
Warning

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

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

Documentation

Overview

Package enterpriseusers implements MCP tools for GitLab enterprise user operations.

The package wraps the GitLab Enterprise users 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 enterprise user actions.

func Delete

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

Delete removes an enterprise user.

func DeleteOutput

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

DeleteOutput deletes an enterprise user and returns the canonical success message shape.

func Disable2FA

func Disable2FA(ctx context.Context, client *gitlabclient.Client, in Disable2FAInput) error

Disable2FA disables two-factor authentication for an enterprise user.

func Disable2FAOutput

func Disable2FAOutput(ctx context.Context, client *gitlabclient.Client, input Disable2FAInput) (toolutil.VoidOutput, error)

Disable2FAOutput disables two-factor authentication and returns the canonical success message shape.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown renders enterprise users as a Markdown table.

func FormatOutputMarkdown

func FormatOutputMarkdown(o Output) string

FormatOutputMarkdown renders a single enterprise user as Markdown.

Types

type BasicUserOutput added in v2.3.0

type BasicUserOutput = toolutil.UserRefOutput

BasicUserOutput mirrors gl.BasicUser, the compact user object referenced by gl.User.CreatedBy. Canonical shape shared via toolutil.

type CustomAttributeOutput added in v2.3.0

type CustomAttributeOutput = toolutil.CustomAttributeOutput

CustomAttributeOutput mirrors gl.CustomAttribute, a key/value custom attribute attached to a user. Canonical shape shared via toolutil.

type DeleteInput

type DeleteInput struct {
	GroupID    toolutil.StringOrInt `json:"group_id"    jsonschema:"Group ID or URL-encoded path,required"`
	UserID     int64                `json:"user_id"     jsonschema:"User ID,required"`
	HardDelete *bool                `json:"hard_delete,omitempty" jsonschema:"Permanently delete user instead of soft delete"`
}

DeleteInput holds parameters for deleting an enterprise user.

type Disable2FAInput

type Disable2FAInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	UserID  int64                `json:"user_id"  jsonschema:"User ID,required"`
}

Disable2FAInput holds parameters for disabling 2FA for an enterprise user.

type GetInput

type GetInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	UserID  int64                `json:"user_id"  jsonschema:"User ID,required"`
}

GetInput holds parameters for getting a single enterprise user.

type IdentityOutput added in v2.3.0

type IdentityOutput struct {
	Provider  string `json:"provider"`
	ExternUID string `json:"extern_uid"`
}

IdentityOutput mirrors gl.UserIdentity, a provider/extern_uid pair linking a user to an external authentication source.

type ListInput

type ListInput struct {
	GroupID       toolutil.StringOrInt `json:"group_id"        jsonschema:"Group ID or URL-encoded path,required"`
	Username      string               `json:"username,omitempty" jsonschema:"Filter by exact username"`
	Search        string               `json:"search,omitempty"   jsonschema:"Search by name or username or email"`
	Active        *bool                `json:"active,omitempty"   jsonschema:"Filter for active users only"`
	Blocked       *bool                `json:"blocked,omitempty"  jsonschema:"Filter for blocked users only"`
	CreatedAfter  string               `json:"created_after,omitempty"  jsonschema:"Filter users created after this date (ISO 8601)"`
	CreatedBefore string               `json:"created_before,omitempty" jsonschema:"Filter users created before this date (ISO 8601)"`
	TwoFactor     string               `json:"two_factor,omitempty"     jsonschema:"Filter by 2FA status: enabled or disabled"`
	OrderBy       string               `json:"order_by,omitempty" jsonschema:"Column to order keyset-paginated results by (e.g. id)"`
	Sort          string               `json:"sort,omitempty"     jsonschema:"Sort order for keyset pagination: asc or desc"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

ListInput holds parameters for listing enterprise users.

type ListOutput

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

ListOutput holds the list response.

func List

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

List returns all enterprise users for a group.

type Output

type Output struct {
	toolutil.HintableOutput
	ID                             int64                   `json:"id"`
	Username                       string                  `json:"username"`
	Email                          string                  `json:"email"`
	Name                           string                  `json:"name"`
	State                          string                  `json:"state"`
	WebURL                         string                  `json:"web_url"`
	AvatarURL                      string                  `json:"avatar_url,omitempty"`
	Bio                            string                  `json:"bio,omitempty"`
	Bot                            bool                    `json:"bot"`
	Location                       string                  `json:"location,omitempty"`
	PublicEmail                    string                  `json:"public_email,omitempty"`
	Skype                          string                  `json:"skype,omitempty"`
	Linkedin                       string                  `json:"linkedin,omitempty"`
	Twitter                        string                  `json:"twitter,omitempty"`
	WebsiteURL                     string                  `json:"website_url,omitempty"`
	Organization                   string                  `json:"organization,omitempty"`
	JobTitle                       string                  `json:"job_title,omitempty"`
	ExternUID                      string                  `json:"extern_uid,omitempty"`
	Provider                       string                  `json:"provider,omitempty"`
	ThemeID                        int64                   `json:"theme_id,omitempty"`
	LastActivityOn                 string                  `json:"last_activity_on,omitempty"`
	ColorSchemeID                  int64                   `json:"color_scheme_id,omitempty"`
	IsAdmin                        bool                    `json:"is_admin"`
	IsAuditor                      bool                    `json:"is_auditor"`
	CanCreateGroup                 bool                    `json:"can_create_group"`
	CanCreateProject               bool                    `json:"can_create_project"`
	CanCreateOrganization          bool                    `json:"can_create_organization"`
	ProjectsLimit                  int64                   `json:"projects_limit"`
	CurrentSignInAt                string                  `json:"current_sign_in_at,omitempty"`
	CurrentSignInIP                string                  `json:"current_sign_in_ip,omitempty"`
	LastSignInAt                   string                  `json:"last_sign_in_at,omitempty"`
	LastSignInIP                   string                  `json:"last_sign_in_ip,omitempty"`
	ConfirmedAt                    string                  `json:"confirmed_at,omitempty"`
	TwoFactorEnabled               bool                    `json:"two_factor_enabled"`
	Note                           string                  `json:"note,omitempty"`
	Identities                     []IdentityOutput        `json:"identities,omitempty"`
	SCIMIdentities                 []SCIMIdentityOutput    `json:"scim_identities,omitempty"`
	External                       bool                    `json:"external"`
	PrivateProfile                 bool                    `json:"private_profile"`
	SharedRunnersMinutesLimit      int64                   `json:"shared_runners_minutes_limit,omitempty"`
	ExtraSharedRunnersMinutesLimit int64                   `json:"extra_shared_runners_minutes_limit,omitempty"`
	UsingLicenseSeat               bool                    `json:"using_license_seat"`
	CustomAttributes               []CustomAttributeOutput `json:"custom_attributes,omitempty"`
	NamespaceID                    int64                   `json:"namespace_id,omitempty"`
	Locked                         bool                    `json:"locked"`
	CreatedBy                      *BasicUserOutput        `json:"created_by,omitempty"`
	CreatedAt                      string                  `json:"created_at,omitempty"`
}

Output mirrors the top-level fields of gl.User returned by the GitLab group_enterprise_users endpoints. Enterprise-user endpoints return full User objects, so this shape reflects gl.User as completely as practical: every top-level scalar plus the nested identities, SCIM identities, custom attributes, and created_by sub-objects.

func Get

func Get(ctx context.Context, client *gitlabclient.Client, in GetInput) (Output, error)

Get returns details for a single enterprise user.

type SCIMIdentityOutput added in v2.3.0

type SCIMIdentityOutput struct {
	ExternUID string `json:"extern_uid"`
	GroupID   int64  `json:"group_id"`
	Active    bool   `json:"active"`
}

SCIMIdentityOutput mirrors gl.SCIMIdentity, a SCIM provisioning identity for an enterprise user.

Jump to

Keyboard shortcuts

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