auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBearerInfoUnauthorized = errors.New("unauthorized: failed to get bearer info")

ErrBearerInfoUnauthorized is returned when the bearer token is invalid or unauthorized.

Functions

This section is empty.

Types

type BearerInfo

type BearerInfo struct {
	UserID         int64  `json:"user_id"`
	InstallationID int64  `json:"installation_id"`
	Region         string `json:"awsRegion"`
	URL            string `json:"url"`
}

BearerInfo contains information about the bearer token used to authenticate with Teamwork API.

func GetBearerInfo

func GetBearerInfo(ctx context.Context, resources config.Resources, token string) (*BearerInfo, error)

GetBearerInfo retrieves information about the bearer token from Teamwork API. It returns a BearerInfo struct containing the user ID, installation ID, and installation URL. If the token is invalid or unauthorized, it returns BearerInfoUnauthorizedError.

Jump to

Keyboard shortcuts

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