Help us shape the future of Go! Take the 2026 Go Developer Survey

groupsaml

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package groupsaml implements MCP tools for GitLab group SAML link operations.

The package wraps the GitLab Group SAML 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 group SAML link actions.

func Delete

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

Delete removes a group SAML link.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown renders a list of group SAML links as Markdown.

func FormatOutputMarkdown

func FormatOutputMarkdown(out Output) string

FormatOutputMarkdown renders a single group SAML link as Markdown.

func FormatSAMLUsersListMarkdown

func FormatSAMLUsersListMarkdown(out SAMLUsersListOutput) string

FormatSAMLUsersListMarkdown renders the SAML-provisioned users of a group as Markdown.

Types

type AddInput

type AddInput struct {
	GroupID       string `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	SAMLGroupName string `json:"saml_group_name" jsonschema:"Name of the SAML group,required"`
	AccessLevel   int    `` /* 271-byte string literal not displayed */
	MemberRoleID  *int64 `json:"member_role_id,omitempty" tier:"ultimate" jsonschema:"Custom member role ID the link's members get (Ultimate)"`
	Provider      string `json:"provider,omitempty" jsonschema:"SAML provider name"`
}

AddInput holds parameters for adding a group SAML link.

type BasicUserOutput

type BasicUserOutput struct {
	ID        int64  `json:"id"`
	Username  string `json:"username"`
	Name      string `json:"name"`
	State     string `json:"state,omitempty"`
	AvatarURL string `json:"avatar_url,omitempty"`
	WebURL    string `json:"web_url,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
}

BasicUserOutput mirrors gl.BasicUser for the created_by reference.

type CustomAttributeOutput

type CustomAttributeOutput struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

CustomAttributeOutput represents a single custom attribute key/value pair.

type DeleteInput

type DeleteInput struct {
	GroupID       string `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	SAMLGroupName string `json:"saml_group_name" jsonschema:"Name of the SAML group to delete,required"`
}

DeleteInput holds parameters for deleting a group SAML link.

type GetInput

type GetInput struct {
	GroupID       string `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	SAMLGroupName string `json:"saml_group_name" jsonschema:"Name of the SAML group,required"`
}

GetInput holds parameters for getting a single group SAML link.

type ListInput

type ListInput struct {
	GroupID string `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
}

ListInput holds parameters for listing group SAML links.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Links []Output `json:"links"`
}

ListOutput holds a list of group SAML links.

func List

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

List retrieves all SAML links for a group.

type Output

type Output struct {
	toolutil.HintableOutput
	Name         string `json:"name"`
	AccessLevel  int    `json:"access_level"`
	MemberRoleID int64  `json:"member_role_id,omitempty"`
	Provider     string `json:"provider,omitempty"`
}

Output represents a single group SAML link.

func Add

func Add(ctx context.Context, client *gitlabclient.Client, input AddInput) (Output, error)

Add creates a new group SAML link.

func Get

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

Get retrieves a single SAML link for a group.

type SAMLUserOutput

type SAMLUserOutput struct {
	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"`
	IsAdmin                        bool                    `json:"is_admin"`
	IsAuditor                      bool                    `json:"is_auditor"`
	Bot                            bool                    `json:"bot"`
	Bio                            string                  `json:"bio,omitempty"`
	Location                       string                  `json:"location,omitempty"`
	JobTitle                       string                  `json:"job_title,omitempty"`
	Organization                   string                  `json:"organization,omitempty"`
	Linkedin                       string                  `json:"linkedin,omitempty"`
	Twitter                        string                  `json:"twitter,omitempty"`
	CreatedAt                      string                  `json:"created_at,omitempty"`
	ConfirmedAt                    string                  `json:"confirmed_at,omitempty"`
	PublicEmail                    string                  `json:"public_email,omitempty"`
	WebsiteURL                     string                  `json:"website_url,omitempty"`
	LastActivityOn                 string                  `json:"last_activity_on,omitempty"`
	TwoFactorEnabled               bool                    `json:"two_factor_enabled"`
	External                       bool                    `json:"external"`
	Locked                         bool                    `json:"locked"`
	PrivateProfile                 bool                    `json:"private_profile"`
	CurrentSignInAt                string                  `json:"current_sign_in_at,omitempty"`
	LastSignInAt                   string                  `json:"last_sign_in_at,omitempty"`
	ProjectsLimit                  int64                   `json:"projects_limit"`
	CanCreateProject               bool                    `json:"can_create_project"`
	CanCreateGroup                 bool                    `json:"can_create_group"`
	Note                           string                  `json:"note,omitempty"`
	UsingLicenseSeat               bool                    `json:"using_license_seat"`
	ThemeID                        int64                   `json:"theme_id,omitempty"`
	ColorSchemeID                  int64                   `json:"color_scheme_id,omitempty"`
	NamespaceID                    int64                   `json:"namespace_id,omitempty"`
	SharedRunnersMinutesLimit      int64                   `json:"shared_runners_minutes_limit,omitempty"`
	ExtraSharedRunnersMinutesLimit int64                   `json:"extra_shared_runners_minutes_limit,omitempty"`
	Identities                     []UserIdentityOutput    `json:"identities,omitempty"`
	SCIMIdentities                 []SCIMIdentityOutput    `json:"scim_identities,omitempty"`
	CustomAttributes               []CustomAttributeOutput `json:"custom_attributes,omitempty"`
	CreatedBy                      *BasicUserOutput        `json:"created_by,omitempty"`
	// The keys lib/api/entities/user_public.rb sends that client-go's User
	// does not model, read from the captured response beside the SDK's own
	// decode (ADR-0021) and described on toolutil.UserExtra. GitLab presents
	// GET /groups/:id/saml_users with UserPublic, so the seven profile keys
	// are on every response and the three counts on one whose caller may read
	// the profile.
	CommitEmail       string `json:"commit_email,omitempty"`
	Discord           string `json:"discord,omitempty"`
	GitHub            string `json:"github,omitempty"`
	LocalTime         string `json:"local_time,omitempty"`
	PreferredLanguage string `json:"preferred_language,omitempty"`
	Pronouns          string `json:"pronouns,omitempty"`
	WorkInformation   string `json:"work_information,omitempty"`
	Followers         *int64 `json:"followers,omitempty"`
	Following         *int64 `json:"following,omitempty"`
	IsFollowed        *bool  `json:"is_followed,omitempty"`
}

SAMLUserOutput represents a SAML-provisioned user of a top-level group, as GET /groups/:id/saml_users answers with it: ee/lib/ee/api/groups.rb presents the list with API::Entities::UserPublic, so the six keys client-go's User models and that entity never renders (skype, extern_uid and provider at the top level, can_create_organization, and the two sign-in addresses only the administrator's user entity carries) are not published. The groups sub-packages cannot import each other (zero import cycles), so the shape is replicated here rather than shared.

type SAMLUsersListInput

type SAMLUsersListInput struct {
	GroupID       string `json:"group_id" jsonschema:"Top-level group ID or URL-encoded path,required"`
	Search        string `json:"search,omitempty" jsonschema:"Filter SAML users by name, username, or public email"`
	Username      string `json:"username,omitempty" jsonschema:"Filter by an exact username"`
	Active        *bool  `json:"active,omitempty" jsonschema:"Limit to active users only"`
	Blocked       *bool  `json:"blocked,omitempty" jsonschema:"Limit to blocked users only"`
	CreatedAfter  string `` /* 130-byte string literal not displayed */
	CreatedBefore string `` /* 132-byte string literal not displayed */
	OrderBy       string `json:"order_by,omitempty" jsonschema:"Column to order keyset-paginated results by (e.g. id, name, username, created_at)"`
	Sort          string `json:"sort,omitempty" jsonschema:"Sort order for keyset pagination: 'asc' or 'desc'"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

SAMLUsersListInput holds parameters for listing the SAML users of a top-level group.

type SAMLUsersListOutput

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

SAMLUsersListOutput holds a paginated list of SAML-provisioned group users.

func SAMLUsersList

func SAMLUsersList(ctx context.Context, client *gitlabclient.Client, input SAMLUsersListInput) (SAMLUsersListOutput, error)

SAMLUsersList retrieves the users provisioned via SAML SSO for a top-level group.

type SCIMIdentityOutput

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

SCIMIdentityOutput represents a SCIM identity associated with a SAML user.

type UserIdentityOutput

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

UserIdentityOutput represents a linked external identity (provider, extern_uid).

Jump to

Keyboard shortcuts

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