auth

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 8 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

func Bypass added in v1.2.1

func Bypass(data []byte) (bool, error)

Bypass checks if the protocol method can bypass authentication.

Types

type BearerInfo

type BearerInfo struct {
	UserID         int64  `json:"user_id"`
	InstallationID int64  `json:"installation_id"`
	Region         string `json:"awsRegion"`
	URL            string `json:"url"`
	Meta           struct {
		Scopes []string `json:"scopes"`
	} `json:"meta"`
}

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