hub

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LoginURL path to the Hub login URL
	LoginURL = "/v2/users/login"
	// ScanTokenURL path to the Hub provider token generation URL
	ScanTokenURL = "/api/scan/v1/provider/token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Domain string
}

Client sends authenticates on Hub and sends requests to the API

func (*Client) GetScanID

func (h *Client) GetScanID(hubToken string) (string, error)

GetScanID calls the scan service which returns a DockerScanID as a JWT token

func (*Client) Login

func (h *Client) Login(hubAuthConfig types.AuthConfig) (string, error)

Login logs into Hub and returns the auth token

type Instance

type Instance struct {
	APIHubBaseURL string
	JwksURL       string
	RegistryInfo  *registry.IndexInfo
}

Instance stores all the specific pieces needed to dialog with Hub

func GetInstance

func GetInstance() *Instance

GetInstance returns the current hub instance, which can be overridden by DOCKER_SCAN_HUB_INSTANCE env var

func (*Instance) FetchJwks

func (i *Instance) FetchJwks() (jose.JSONWebKeySet, error)

FetchJwks fetches a jwks.json file and parses it

Jump to

Keyboard shortcuts

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