auth

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package auth provides GitHub authentication utilities.

Index

Constants

View Source
const (
	// UsernameDependabot is the username for GitHub's Dependabot.
	UsernameDependabot = "dependabot[bot]"
	// UserIDDependabot is the user ID for GitHub's Dependabot.
	UserIDDependabot = 49699333
)

Known bot users.

Variables

This section is empty.

Functions

func GetAuthenticatedUser

func GetAuthenticatedUser(ctx context.Context, gh *github.Client) (string, error)

GetAuthenticatedUser returns the authenticated user's login.

func GetUser

func GetUser(ctx context.Context, gh *github.Client, username string) (*github.User, error)

GetUser returns information about a specific user.

func NewGitHubClient

func NewGitHubClient(ctx context.Context, token string) *github.Client

NewGitHubClient creates a GitHub client authenticated with the given token.

func NewTokenClient

func NewTokenClient(ctx context.Context, token string) *http.Client

NewTokenClient creates an HTTP client authenticated with the given token.

Types

type AuthError

type AuthError struct {
	Message string
	Err     error // Wrapped error for Go 1.13+ error chain compatibility
}

AuthError indicates an authentication failure.

func (*AuthError) Error

func (e *AuthError) Error() string

func (*AuthError) Unwrap added in v0.4.0

func (e *AuthError) Unwrap() error

Unwrap returns the wrapped error for Go 1.13+ error chain compatibility.

Jump to

Keyboard shortcuts

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