gitlab

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gitlab implements theauth.Provider against GitLab's OpenID Connect endpoints. The BaseURL option allows self-hosted GitLab instances; leave it empty to use gitlab.com. Import this package only when you want GitLab sign-in; the root theauth package has no hard dependency on it.

References: https://docs.gitlab.com/ee/api/oauth2.html https://docs.gitlab.com/ee/integration/openid_connect_provider.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) theauth.Provider

New returns a GitLab theauth.Provider with the supplied Config. Required fields: ClientID, ClientSecret.

Types

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	// BaseURL is the root of the GitLab instance. Defaults to https://gitlab.com.
	// For self-hosted installations set this to e.g. https://git.example.com.
	BaseURL string
	Scopes  []string

	// Endpoint overrides for tests. These override BaseURL-derived URLs when set.
	AuthorizeURL string
	TokenURL     string
	UserInfoURL  string

	HTTPClient *http.Client
}

Config is the provider wiring. ClientID + ClientSecret are required. Set BaseURL to point at a self-hosted GitLab instance, e.g. "https://git.company.internal". Defaults to "https://gitlab.com".

Jump to

Keyboard shortcuts

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