auth

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 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.1.0

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

Bypass checks if the protocol method can bypass authentication.

func BypassMethod added in v1.6.2

func BypassMethod(method string) bool

BypassMethod 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