github

package
v3.76.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetHeaderInfo added in v3.70.1

func SetHeaderInfo(headers *HeaderInfo, s1 *detectors.Result)

func SetUserResponse added in v3.70.1

func SetUserResponse(userResponse *UserRes, s1 *detectors.Result)

Types

type HeaderInfo added in v3.70.1

type HeaderInfo struct {
	Scopes string `json:"X-OAuth-Scopes"`
	Expiry string `json:"github-authentication-token-expiration"`
}

type Scanner

type Scanner struct{ detectors.EndpointSetter }

func (Scanner) DefaultEndpoint

func (Scanner) DefaultEndpoint() string

func (Scanner) FromData

func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results []detectors.Result, err error)

FromData will find and optionally verify GitHub secrets in a given set of bytes.

func (Scanner) Keywords

func (s Scanner) Keywords() []string

Keywords are used for efficiently pre-filtering chunks. Use identifiers in the secret preferably, or the provider name.

func (Scanner) Type

func (s Scanner) Type() detectorspb.DetectorType

func (Scanner) VerifyGithub added in v3.70.1

func (s Scanner) VerifyGithub(ctx context.Context, client *http.Client, token string) (bool, *UserRes, *HeaderInfo, error)

func (Scanner) Version

func (Scanner) Version() int

type UserRes added in v3.70.1

type UserRes struct {
	Login     string `json:"login"`
	Type      string `json:"type"`
	SiteAdmin bool   `json:"site_admin"`
	Name      string `json:"name"`
	Company   string `json:"company"`
	UserURL   string `json:"html_url"`
	Email     string `json:"email"`
	Location  string `json:"location"`
	// Included in GitHub Enterprise Server.
	LdapDN string `json:"ldap_dn"`
}

TODO: Add secret context?? Information about access, ownership etc

Jump to

Keyboard shortcuts

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