github

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package github implements the logic to detect Github tokens

Index

Constants

This section is empty.

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 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 NewClassicPATDetector added in v0.3.5

func NewClassicPATDetector() veles.Detector

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

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 NewOAuthTokenDetector added in v0.3.5

func NewOAuthTokenDetector() veles.Detector

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

Types

type App2S2TokenValidatorOption added in v0.3.5

type App2S2TokenValidatorOption func(*AppS2STokenValidator)

App2S2TokenValidatorOption configures a Validator when creating it via NewValidator.

func AppS2STokenWithClient added in v0.3.5

func AppS2STokenWithClient(c *http.Client) App2S2TokenValidatorOption

AppS2STokenWithClient configures the http.Client that the Validator uses.

By default, it uses http.DefaultClient.

type AppRefreshToken

type AppRefreshToken struct {
	Token string
}

AppRefreshToken contains a Github App refresh token

type AppS2STokenValidator added in v0.3.5

type AppS2STokenValidator struct {
	// contains filtered or unexported fields
}

AppS2STokenValidator validates Github app Server to Server token via the Github API endpoint.

func NewAppS2STokenValidator added in v0.3.5

func NewAppS2STokenValidator(opts ...App2S2TokenValidatorOption) *AppS2STokenValidator

NewAppS2STokenValidator creates a new Validator with the given ValidatorOptions.

func (*AppS2STokenValidator) Validate added in v0.3.5

Validate checks whether the given Github app Server to Server token is valid.

type AppServerToServerToken added in v0.3.5

type AppServerToServerToken struct {
	Token string
}

AppServerToServerToken contains a Github App server to server token

type AppU2STokenValidator added in v0.3.5

type AppU2STokenValidator struct {
	// contains filtered or unexported fields
}

AppU2STokenValidator validates Github app User to Server token via the Github API endpoint.

func NewAppU2STokenValidator added in v0.3.5

func NewAppU2STokenValidator(opts ...AppU2STokenValidatorOption) *AppU2STokenValidator

NewAppU2STokenValidator creates a new AppU2SValidator with the given AppU2SValidatorOptions.

func (*AppU2STokenValidator) Validate added in v0.3.5

Validate checks whether the given Github app User to Server token is valid.

type AppU2STokenValidatorOption added in v0.3.5

type AppU2STokenValidatorOption func(*AppU2STokenValidator)

AppU2STokenValidatorOption configures a AppU2SValidator when creating it via NewAppU2SValidator.

func AppU2STokenWithClient added in v0.3.5

func AppU2STokenWithClient(c *http.Client) AppU2STokenValidatorOption

AppU2STokenWithClient configures the http.Client that the AppU2SValidator uses.

By default, it uses http.DefaultClient.

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 ClassicPATValidator added in v0.3.5

type ClassicPATValidator struct {
	// contains filtered or unexported fields
}

ClassicPATValidator validates Github classic personal access token via the Github API endpoint.

func NewClassicPATValidator added in v0.3.5

func NewClassicPATValidator(opts ...ClassicPATValidatorOption) *ClassicPATValidator

NewClassicPATValidator creates a new Validator with the given ValidatorOptions.

func (*ClassicPATValidator) Validate added in v0.3.5

Validate checks whether the given Github classic personal access token is valid.

type ClassicPATValidatorOption added in v0.3.5

type ClassicPATValidatorOption func(*ClassicPATValidator)

ClassicPATValidatorOption configures a Validator when creating it via NewValidator.

func ClassicPATWithClient added in v0.3.5

func ClassicPATWithClient(c *http.Client) ClassicPATValidatorOption

ClassicPATWithClient configures the http.Client that the Validator uses.

By default, it uses http.DefaultClient.

type ClassicPersonalAccessToken added in v0.3.5

type ClassicPersonalAccessToken struct {
	Token string
}

ClassicPersonalAccessToken contains a Github classic personal access token

type FineGrainedPATValidator added in v0.3.5

type FineGrainedPATValidator struct {
	// contains filtered or unexported fields
}

FineGrainedPATValidator validates Github fine-grained personal access token via the Github API endpoint.

func NewFineGrainedPATValidator added in v0.3.5

func NewFineGrainedPATValidator(opts ...FineGrainedPATValidatorOption) *FineGrainedPATValidator

NewFineGrainedPATValidator creates a new Validator with the given ValidatorOptions.

func (*FineGrainedPATValidator) Validate added in v0.3.5

Validate checks whether the given Github fine-grained personal access token is valid.

type FineGrainedPATValidatorOption added in v0.3.5

type FineGrainedPATValidatorOption func(*FineGrainedPATValidator)

FineGrainedPATValidatorOption configures a Validator when creating it via NewValidator.

func FineGrainedPATWithClient added in v0.3.5

func FineGrainedPATWithClient(c *http.Client) FineGrainedPATValidatorOption

FineGrainedPATWithClient configures the http.Client that the Validator uses.

By default, it uses http.DefaultClient.

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

type OAuthTokenValidator added in v0.3.5

type OAuthTokenValidator struct {
	// contains filtered or unexported fields
}

OAuthTokenValidator validates Github OAuth token via the Github API endpoint.

func NewOAuthTokenValidator added in v0.3.5

func NewOAuthTokenValidator(opts ...OAuthTokenValidatorOption) *OAuthTokenValidator

NewOAuthTokenValidator creates a new OAuthValidator with the given OAuthValidatorOptions.

func (*OAuthTokenValidator) Validate added in v0.3.5

Validate checks whether the given Github OAuth token is valid.

type OAuthTokenValidatorOption added in v0.3.5

type OAuthTokenValidatorOption func(*OAuthTokenValidator)

OAuthTokenValidatorOption configures a OAuthValidator when creating it via NewOAuthValidator.

func OAuthTokenWithClient added in v0.3.5

func OAuthTokenWithClient(c *http.Client) OAuthTokenValidatorOption

OAuthTokenWithClient configures the http.Client that the OAuthValidator uses.

By default, it uses http.DefaultClient.

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