image

package
v0.0.0-...-a7ced60 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ImageExpirationTime define the expiration of the image download URL
	ImageExpirationTime = 4 * time.Hour
)

Variables

This section is empty.

Functions

func GenerateDownloadURLByToken

func GenerateDownloadURLByToken(baseUrl string, source *model.Source) (string, *strfmt.DateTime, error)

func HMACKey

func HMACKey(n int) (string, error)

HMACKey generates a hex string representing n random bytes

This string is intended to be used as a private key for signing and verifying jwt tokens. Specifically ones used for downloading images when using rhsso auth and the image service.

func IdFromJWT

func IdFromJWT(jwt string) (string, error)

func JWTForSymmetricKey

func JWTForSymmetricKey(key []byte, expiration time.Duration, sub string) (string, error)

func ParseExpiration

func ParseExpiration(tokenString string) (*strfmt.DateTime, error)

func ValidateToken

func ValidateToken(ctx context.Context, token string, keyFunc func(token *jwt.Token) (interface{}, error)) error

Types

type IgnitionData

type IgnitionData struct {
	SshKey                     string
	PlannerServiceUI           string
	PlannerService             string
	MigrationPlannerAgentImage string
	InsecureRegistry           string
	Token                      string
	PersistentDiskDevice       string
	SourceID                   string
	HttpProxyUrl               string
	HttpsProxyUrl              string
	NoProxyDomain              string
}

IgnitionData defines modifiable fields in ignition config

type ImageBuilder

type ImageBuilder struct {
	SourceID                   string
	SshKey                     string
	Proxy                      Proxy
	CertificateChain           string
	PlannerServiceUI           string
	PlannerService             string
	MigrationPlannerAgentImage string
	InsecureRegistry           string
	Token                      string
	PersistentDiskDevice       string
	PersistentDiskImage        string
	IsoImageName               string
	OvfFile                    string
	OvfName                    string
	Template                   string
	RHCOSImage                 string
	// contains filtered or unexported fields
}

func NewImageBuilder

func NewImageBuilder(sourceID uuid.UUID) *ImageBuilder

func (*ImageBuilder) Generate

func (b *ImageBuilder) Generate(ctx context.Context, w io.Writer) (int, error)

func (*ImageBuilder) Validate

func (b *ImageBuilder) Validate() error

func (*ImageBuilder) WithAgentToken

func (b *ImageBuilder) WithAgentToken(token string) *ImageBuilder

func (*ImageBuilder) WithCertificateChain

func (b *ImageBuilder) WithCertificateChain(certs string) *ImageBuilder

func (*ImageBuilder) WithImageType

func (b *ImageBuilder) WithImageType(imageType ImageType) *ImageBuilder

func (*ImageBuilder) WithInsecureRegistry

func (b *ImageBuilder) WithInsecureRegistry(insecureRegistry string) *ImageBuilder

func (*ImageBuilder) WithIsoImageName

func (b *ImageBuilder) WithIsoImageName(name string) *ImageBuilder

func (*ImageBuilder) WithOvfFile

func (b *ImageBuilder) WithOvfFile(ovfFile string) *ImageBuilder

func (*ImageBuilder) WithOvfName

func (b *ImageBuilder) WithOvfName(ovfName string) *ImageBuilder

func (*ImageBuilder) WithPersistenceDiskDevice

func (b *ImageBuilder) WithPersistenceDiskDevice(persistenceDevice string) *ImageBuilder

func (*ImageBuilder) WithPersistentDiskImage

func (b *ImageBuilder) WithPersistentDiskImage(imagePath string) *ImageBuilder

func (*ImageBuilder) WithPlannerAgentImage

func (b *ImageBuilder) WithPlannerAgentImage(imageUrl string) *ImageBuilder

func (*ImageBuilder) WithPlannerService

func (b *ImageBuilder) WithPlannerService(url string) *ImageBuilder

func (*ImageBuilder) WithPlannerServiceUI

func (b *ImageBuilder) WithPlannerServiceUI(uiUrl string) *ImageBuilder

func (*ImageBuilder) WithProxy

func (b *ImageBuilder) WithProxy(proxy Proxy) *ImageBuilder

func (*ImageBuilder) WithRHCOSImage

func (b *ImageBuilder) WithRHCOSImage(image string) *ImageBuilder

func (*ImageBuilder) WithSshKey

func (b *ImageBuilder) WithSshKey(sshKey string) *ImageBuilder

func (*ImageBuilder) WithTemplate

func (b *ImageBuilder) WithTemplate(templatePath string) *ImageBuilder

type ImageType

type ImageType int
const (
	OVAImageType ImageType = iota
	QemuImageType
)

type Key

type Key int
const ResponseWriterKey Key = 0

Key to store the ResponseWriter in the context of openapi

type Proxy

type Proxy struct {
	HttpUrl       string
	HttpsUrl      string
	NoProxyDomain string
}

Jump to

Keyboard shortcuts

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