github

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0, BSD-3-Clause, MIT Imports: 7 Imported by: 0

Documentation

Overview

Package github implements the logic to detect Github tokens

Index

Constants

View Source
const (

	// S2SValidationEndpoint is endpoint for app s2s token validation.
	S2SValidationEndpoint = "/installation/repositories"
	// UserValidationEndpoint is endpoint for user token validation.
	UserValidationEndpoint = "/user"
)

Variables

This section is empty.

Functions

func NewAppRefreshTokenDetector

func NewAppRefreshTokenDetector() veles.Detector

NewAppRefreshTokenDetector returns a new Veles Detector that finds Github app refresh tokens

func NewAppS2STokenDetector added in v0.3.5

func NewAppS2STokenDetector() veles.Detector

NewAppS2STokenDetector returns a new Veles Detector that finds Github app server to server tokens

func NewAppS2STokenValidator added in v0.3.5

func NewAppS2STokenValidator() *simplevalidate.Validator[AppServerToServerToken]

NewAppS2STokenValidator creates a new Validator that validates Github app Server to Server token via the Github API endpoint.

func NewAppU2SDetector added in v0.3.5

func NewAppU2SDetector() veles.Detector

NewAppU2SDetector returns a new Veles Detector that finds Github app user to server tokens

func NewAppU2STokenValidator added in v0.3.5

func NewAppU2STokenValidator() *simplevalidate.Validator[AppUserToServerToken]

NewAppU2STokenValidator creates a new Validator that validates Github app User to Server token via the Github API endpoint.

func NewClassicPATDetector added in v0.3.5

func NewClassicPATDetector() veles.Detector

NewClassicPATDetector returns a new Veles Detector that finds Github classic personal access tokens

func NewClassicPATValidator added in v0.3.5

func NewClassicPATValidator() *simplevalidate.Validator[ClassicPersonalAccessToken]

NewClassicPATValidator creates a new Validator that validates Github classic personal access token via the Github API endpoint.

func NewFineGrainedPATDetector added in v0.3.5

func NewFineGrainedPATDetector() veles.Detector

NewFineGrainedPATDetector returns a new Veles Detector that finds Github fine-grained personal access tokens

func NewFineGrainedPATValidator added in v0.3.5

func NewFineGrainedPATValidator() *simplevalidate.Validator[FineGrainedPersonalAccessToken]

NewFineGrainedPATValidator creates a new Validator that validates Github fine-grained personal access token via the Github API endpoint.

func NewOAuthTokenDetector added in v0.3.5

func NewOAuthTokenDetector() veles.Detector

NewOAuthTokenDetector returns a new Veles Detector that finds Github oauth tokens.

func NewOAuthTokenValidator added in v0.3.5

func NewOAuthTokenValidator() *simplevalidate.Validator[OAuthToken]

NewOAuthTokenValidator creates a new Validator that validates Github OAuth token via the Github API endpoint.

Types

type AppRefreshToken

type AppRefreshToken struct {
	Token string
}

AppRefreshToken contains a Github App refresh token

type AppServerToServerToken added in v0.3.5

type AppServerToServerToken struct {
	Token string
}

AppServerToServerToken contains a Github App server to server token

type AppUserToServerToken added in v0.3.5

type AppUserToServerToken struct {
	Token string
}

AppUserToServerToken contains a user to server token

A Github App User to Server token is a temporary, secure credential that allows a GitHub App to perform actions on the platform on behalf of a user

type ClassicPersonalAccessToken added in v0.3.5

type ClassicPersonalAccessToken struct {
	Token string
}

ClassicPersonalAccessToken contains a Github classic personal access token

type FineGrainedPersonalAccessToken added in v0.3.5

type FineGrainedPersonalAccessToken struct {
	Token string
}

FineGrainedPersonalAccessToken contains a Github fine-grained personal access token

type OAuthToken added in v0.3.5

type OAuthToken struct {
	Token string
}

OAuthToken contains an oauth token

Directories

Path Synopsis
Package checksum contains the checksum validation logic for github tokens
Package checksum contains the checksum validation logic for github tokens
Package mockgithub contains a mock implementation of the Github APIss
Package mockgithub contains a mock implementation of the Github APIss
Package validate contains common logic to validate github tokens
Package validate contains common logic to validate github tokens

Jump to

Keyboard shortcuts

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