userinfo

package
v1.45.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package userinfo calls GitLab Rails' `/api/v4/iam/userinfo` endpoint, authenticated with the access token minted for the same token exchange as a bearer credential. Unlike `/oauth/userinfo`, that endpoint only accepts an IAM-issued OAuth JWT, so it exists to serve exactly this caller.

Index

Constants

View Source
const RequestTimeout = 10 * time.Second

RequestTimeout bounds the call so a slow or hanging endpoint can't stall every token exchange indefinitely. Exported so callers constructing the *http.Client passed to NewClient can size its Timeout the same way.

Variables

View Source
var ErrFetchFailed = errors.New("user info unavailable")

ErrFetchFailed is the only error FetchUserInfo ever returns. fosite's stock OpenIDConnectExplicitHandler echoes a failing storage call's error string verbatim to the OAuth client as error_debug (WriteOAuthError in auth/oauth/server/errors.go copies it through unconditionally), so the real cause — which can include this endpoint's host or a raw dial error — is logged here instead of returned.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url string, client *http.Client, logger *logrus.Entry) *Client

func (*Client) FetchUserInfo

func (c *Client) FetchUserInfo(ctx context.Context, accessToken string) (map[string]any, error)

Jump to

Keyboard shortcuts

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