github

package
v3.0.0-...-eed492a Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetHeaderInfo

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

func SetUserResponse

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

Types

type HeaderInfo

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) CloudEndpoint

func (Scanner) CloudEndpoint() string

func (Scanner) Description

func (s Scanner) Description() 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

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

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