hubcli

package
v0.0.0-...-b9085d8 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Copyright (C) 2020 Synopsys, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (C) 2020 Synopsys, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetectDockerConfig

type DetectDockerConfig struct {
	ImageTag string
}

type NamingConfig

type NamingConfig struct {
	ProjectName string
	VersionName string
	ScanName    string
}

type OSType

type OSType string
const (
	OSTypeLinux   OSType = "Linux"
	OSTypeMac     OSType = "Mac"
	OSTypeWindows OSType = "Windows"
)

func (OSType) MarshalJSON

func (t OSType) MarshalJSON() ([]byte, error)

func (OSType) MarshalText

func (t OSType) MarshalText() (text []byte, err error)

func (OSType) String

func (t OSType) String() string

func (*OSType) UnmarshalJSON

func (t *OSType) UnmarshalJSON(data []byte) error

func (*OSType) UnmarshalText

func (t *OSType) UnmarshalText(text []byte) (err error)

type ScanClient

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

ScanClient implements ScanClientInterface using the Black Duck hub and scan client programs.

func NewScanClient

func NewScanClient(host string, username string, password string, port int, os OSType) (*ScanClient, error)

NewScanClient requires hub login credentials

func (*ScanClient) DetectBinaryScan

func (sc *ScanClient) DetectBinaryScan(path string, projectName string, versionName string, scanName string) error

func (*ScanClient) DetectDocker

func (sc *ScanClient) DetectDocker(projectName string, versionName string, scanName string, image string) error

func (*ScanClient) DetectOffline

func (sc *ScanClient) DetectOffline(path string) error

DetectOffline TODO is this method even necessary?

func (*ScanClient) DetectSignatureScan

func (sc *ScanClient) DetectSignatureScan(path string, projectName string, versionName string, scanName string) error

func (*ScanClient) IScan

func (sc *ScanClient) IScan(path string, projectName string, versionName string, scanName string) error

Scan ...

func (*ScanClient) Scan

func (sc *ScanClient) Scan(path string, cfg *ScanConfig) error

func (*ScanClient) ScanSh

func (sc *ScanClient) ScanSh(path string, projectName string, versionName string, scanName string) error

ScanSh invokes scan.cli.sh example:

BD_HUB_PASSWORD=??? ./bin/scan.cli.sh --host ??? --port 443 --scheme https --username sysadmin --insecure --name ??? --release ??? --project ??? ???.tar

type ScanClientInfo

type ScanClientInfo struct {
	HubVersion string
	RootPath   string
	OSType     OSType
}

ScanClientInfo ...

func DownloadScanClient

func DownloadScanClient(osType OSType, cliRootPath string, hubHost string, hubUser string, hubPassword string, hubPort int, timeout time.Duration) (*ScanClientInfo, error)

DownloadScanClient ...

func NewScanClientInfo

func NewScanClientInfo(hubVersion string, rootPath string, osType OSType) *ScanClientInfo

NewScanClientInfo ...

func (*ScanClientInfo) ScanCliImplJarPath

func (sci *ScanClientInfo) ScanCliImplJarPath() string

ScanCliImplJarPath ...

func (*ScanClientInfo) ScanCliJarPath

func (sci *ScanClientInfo) ScanCliJarPath() string

ScanCliJarPath ...

func (*ScanClientInfo) ScanCliJavaHomePath

func (sci *ScanClientInfo) ScanCliJavaHomePath() string

func (*ScanClientInfo) ScanCliJavaPath

func (sci *ScanClientInfo) ScanCliJavaPath() string

ScanCliJavaPath ...

func (*ScanClientInfo) ScanCliShPath

func (sci *ScanClientInfo) ScanCliShPath() string

ScanCliShPath ...

func (*ScanClientInfo) ScanCliZipPath

func (sci *ScanClientInfo) ScanCliZipPath() string

ScanCliZipPath ...

type ScanClientInterface

type ScanClientInterface interface {
	IScan(path string, projectName string, versionName string, scanName string) error

	DetectDocker(projectName string, versionName string, scanName string, image string) error
	DetectSignatureScan(path string, projectName string, versionName string, scanName string) error
	DetectBinaryScan(path string, projectName string, versionName string, scanName string) error

	Scan(path string, cfg *ScanConfig) error
}

ScanClientInterface ...

type ScanConfig

type ScanConfig struct {
	Names               *NamingConfig
	IScan               bool
	DetectDocker        *DetectDockerConfig
	DetectSignatureScan bool
	DetectBinaryScan    bool
}

Jump to

Keyboard shortcuts

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