checks

package
v0.0.0-...-b95a7b5 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLicenceCheck

func NewLicenceCheck() types.Check

func NewNpmChecksManager

func NewNpmChecksManager(trustedScopes []string, allowedPackages []*config.PackagesAllowList, httpClient *http.Client, projectMirror types.ProjectMirror) types.ChecksManager

NewNpmChecksManager returns an instance of NpmChecksManager.

func NewPublishAgeCheck

func NewPublishAgeCheck() types.Check

Types

type LegacyNpmLicense

type LegacyNpmLicense struct {
	Type string `json:"type"`
	URL  string `json:"url"`
}

type LicenseCheck

type LicenseCheck struct {
}

LicenseCheck implements the types.Checks interface.

func (*LicenseCheck) Name

func (lc *LicenseCheck) Name() string

Name implements the types.Checks interface.

func (*LicenseCheck) PerformCheck

func (lc *LicenseCheck) PerformCheck(packageName, packageVersion string, npmPackage *types.NpmPackage) (bool, string, error)

PerformCheck implements the types.Checks interface. This check looks for 'restricted' licenses. In general we attempt to not be overly defensive here. If there is something we do not recognize then we error log it and move on. NPM license specs are here: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#license

type NpmChecksManager

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

NpmChecksManager implements types.ChecksManager.

func (*NpmChecksManager) PerformChecks

func (ncm *NpmChecksManager) PerformChecks(packageRequestURL string) (bool, string, error)

PerformChecks implements the types.ChecksManager interface.

type PublishAgeCheck

type PublishAgeCheck struct{}

PublishAgeCheck implements the types.Checks interface.

func (*PublishAgeCheck) Name

func (lc *PublishAgeCheck) Name() string

Name implements the types.Checks interface.

func (*PublishAgeCheck) PerformCheck

func (lc *PublishAgeCheck) PerformCheck(packageName, packageVersion string, npmPackage *types.NpmPackage) (bool, string, error)

PerformCheck implements the types.Checks interface.

Jump to

Keyboard shortcuts

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