models

package
v4.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

* Copyright (C) 2020 Intel Corporation * SPDX-License-Identifier: BSD-3-Clause

* Copyright (C) 2020 Intel Corporation * SPDX-License-Identifier: BSD-3-Clause

* Copyright (C) 2020 Intel Corporation * SPDX-License-Identifier: BSD-3-Clause

  • Copyright (C) 2020 Intel Corporation

  • SPDX-License-Identifier: BSD-3-Clause

  • Copyright (C) 2020 Intel Corporation

  • SPDX-License-Identifier: BSD-3-Clause

  • Copyright (C) 2021 Intel Corporation

  • SPDX-License-Identifier: BSD-3-Clause

  • Copyright (C) 2020 Intel Corporation

  • SPDX-License-Identifier: BSD-3-Clause

  • Copyright (C) 2020 Intel Corporation

  • SPDX-License-Identifier: BSD-3-Clause

  • Copyright (C) 2021 Intel Corporation

  • SPDX-License-Identifier: BSD-3-Clause

  • Copyright (C) 2020 Intel Corporation

  • SPDX-License-Identifier: BSD-3-Clause

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultFlavorGroups

func GetDefaultFlavorGroups() map[FlavorGroups]bool

func GetSupportedCerts

func GetSupportedCerts() []string

Get list of certificate types including ca certificate types

func GetUniqueCertType

func GetUniqueCertType(certType string) string

GetUniqueCertTypes returns a list of unique certificate types as strings

func GetUniqueCertTypes

func GetUniqueCertTypes() []string

GetUniqueCertTypes returns a list of unique certificate types as strings

func IsDefaultFlavorgroup

func IsDefaultFlavorgroup(flavorGroupName string) bool

func IsValidCertType

func IsValidCertType(certType string) bool

Validate if certificate type is present in all certificate types including ca certificate types

func IsValidDomainType

func IsValidDomainType(domain string) bool

Validate if domain is present in specific certificate types

Types

type AuditColumnData

type AuditColumnData struct {
	Name      string
	Value     interface{}
	IsUpdated bool
}

type AuditLogEntry

type AuditLogEntry struct {
	ID         uuid.UUID
	EntityID   uuid.UUID
	EntityType string
	CreatedAt  time.Time
	Action     string
	Data       AuditTableData
}

type AuditTableData

type AuditTableData struct {
	Columns []AuditColumnData
}

type CaCertTypes

type CaCertTypes string

CaCertTypes is an enumerated set of ca certificate types

const (
	CaCertTypesRootCa        CaCertTypes = "root"
	CaCertTypesEndorsementCa CaCertTypes = "endorsement"
	CaCertTypesEkCa          CaCertTypes = "ek" //endorsement is used instead to store cert
	CaCertTypesPrivacyCa     CaCertTypes = "privacy"
	CaCertTypesAikCa         CaCertTypes = "aik" //privacy is used instead to store cert
	CaCertTypesTagCa         CaCertTypes = "tag"
)

func GetCaCertTypes

func GetCaCertTypes() []CaCertTypes

GetCaCertTypes returns a list of ca certificate types as strings

func (CaCertTypes) String

func (cct CaCertTypes) String() string

type CertLocation

type CertLocation struct {
	KeyFile  string
	CertPath string // Can hold either certFile or certDir
}

type CertTypes

type CertTypes string

CaCertTypes is an enumerated set of certificate types

const (
	CertTypesSaml          CertTypes = "saml"
	CertTypesTls           CertTypes = "tls"
	CertTypesFlavorSigning CertTypes = "flavor-signing"
)

func GetCertTypes

func GetCertTypes() []CertTypes

func (CertTypes) String

func (ct CertTypes) String() string

type CertificateStore

type CertificateStore struct {
	Key          crypto.PrivateKey
	CertPath     string
	Certificates []x509.Certificate
}

CertificateStore holds file/directory path and certificates collection

type CertificatesPathStore

type CertificatesPathStore map[string]CertLocation //map of certificate type and associated locations

CertificatesPathStore

type CertificatesStore

type CertificatesStore map[string]*CertificateStore

CertificatesStore reads and caches map of certificate type and CertificateStore in application

func (*CertificatesStore) AddCertificatesToStore

func (cs *CertificatesStore) AddCertificatesToStore(certType, certFile string, certificate *x509.Certificate) error

func (*CertificatesStore) GetKeyAndCertificates

func (cs *CertificatesStore) GetKeyAndCertificates(certType string) (crypto.PrivateKey, []x509.Certificate, error)

func (*CertificatesStore) GetPath

func (cs *CertificatesStore) GetPath(certType string) string

func (*CertificatesStore) RetrieveCertificate

func (cs *CertificatesStore) RetrieveCertificate(certType, commonName string) (*x509.Certificate, error)

This function expects CN to be unique, use this only in that scenario

type ESXiClusterFilterCriteria

type ESXiClusterFilterCriteria struct {
	Id          uuid.UUID
	ClusterName string
}

type FlavorCreateRequest

type FlavorCreateRequest struct {
	ConnectionString       string                     `json:"connection_string,omitempty"`
	FlavorCollection       hvs.FlavorCollection       `json:"flavor_collection,omitempty"`
	SignedFlavorCollection hvs.SignedFlavorCollection `json:"signed_flavor_collection,omitempty"`
	FlavorgroupNames       []string                   `json:"flavorgroup_names,omitempty"`
	FlavorParts            []hvs.FlavorPartName       `json:"partial_flavor_types,omitempty"`
}

func (FlavorCreateRequest) MarshalJSON

func (fcr FlavorCreateRequest) MarshalJSON() ([]byte, error)

func (*FlavorCreateRequest) UnmarshalJSON

func (fcr *FlavorCreateRequest) UnmarshalJSON(b []byte) error

type FlavorFilterCriteria

type FlavorFilterCriteria struct {
	Ids           []uuid.UUID
	Key           string
	Value         string
	FlavorgroupID uuid.UUID
	FlavorParts   []hvs.FlavorPartName
}

type FlavorGroupFilterCriteria

type FlavorGroupFilterCriteria struct {
	Ids          []uuid.UUID
	FlavorId     *uuid.UUID
	NameEqualTo  string
	NameContains string
}

type FlavorGroups

type FlavorGroups string
const (
	FlavorGroupsAutomatic        FlavorGroups = "automatic"
	FlavorGroupsHostUnique       FlavorGroups = "host_unique"
	FlavorGroupsPlatformSoftware FlavorGroups = "platform_software"
	FlavorGroupsWorkloadSoftware FlavorGroups = "workload_software"
)

func (FlavorGroups) String

func (dfg FlavorGroups) String() string

type FlavorMetaKv

type FlavorMetaKv struct {
	Key   string
	Value interface{}
}

type FlavorTemplateFilterCriteria

type FlavorTemplateFilterCriteria struct {
	Ids                []uuid.UUID
	Label              string
	ConditionContains  string
	FlavorPartContains string
	IncludeDeleted     bool
}

type FlavorVerificationFC

type FlavorVerificationFC struct {
	FlavorFC              FlavorFilterCriteria
	FlavorMeta            map[hvs.FlavorPartName][]FlavorMetaKv
	FlavorPartsWithLatest map[hvs.FlavorPartName]bool
}

type HVSReport

type HVSReport struct {
	ID          uuid.UUID
	HostID      uuid.UUID
	TrustReport hvs.TrustReport
	CreatedAt   time.Time
	Expiration  time.Time
	// Saml is string which is actually xml encoded to string
	Saml string
}

type HostCredential

type HostCredential struct {
	Id           uuid.UUID `json:"id"`
	HostId       uuid.UUID `json:"host_id,omitempty"`
	HostName     string    `json:"host_name,omitempty"`
	HardwareUuid HwUUID    `json:"hardware_uuid,omitempty"`
	Credential   string    `json:"credential"`
	CreatedTs    time.Time `json:"created_ts,omitempty"`
}

type HostFilterCriteria

type HostFilterCriteria struct {
	Id             uuid.UUID
	HostHardwareId uuid.UUID
	NameEqualTo    string
	NameContains   string
	Key            string
	Value          string
	IdList         []uuid.UUID
	Trusted        *bool
	OrderBy        OrderType
}

type HostInfoFetchCriteria

type HostInfoFetchCriteria struct {
	GetReport      bool
	GetTrustStatus bool
	GetHostStatus  bool
}

type HostStatusFilterCriteria

type HostStatusFilterCriteria struct {
	Id             uuid.UUID
	HostId         uuid.UUID
	HostHardwareId uuid.UUID
	HostName       string
	HostStatus     string
	FromDate       time.Time
	ToDate         time.Time
	LatestPerHost  bool
	NumberOfDays   int
	Limit          int
}

HostStatusFilterCriteria holds the filter criteria for the HostStatus resource used by Search HostStatus API

type HwUUID

type HwUUID struct {
	UUID  uuid.UUID
	Valid bool
}

HwUUID can be used with the standard sql package to represent a UUID value that can be NULL in the database

func NewHwUUID

func NewHwUUID(u uuid.UUID) HwUUID

NewHwUUID returns a new, properly instantiated HwUUID object.

func (HwUUID) Interface

func (u HwUUID) Interface() interface{}

Interface implements the nullable interface. It returns nil if the HwUUID is not valid, otherwise it returns the UUID value.

func (HwUUID) MarshalJSON

func (u HwUUID) MarshalJSON() ([]byte, error)

MarshalJSON marshals the underlying value to a proper JSON representation.

func (*HwUUID) Scan

func (u *HwUUID) Scan(src interface{}) error

Scan implements the sql.Scanner interface.

func (*HwUUID) UnmarshalJSON

func (u *HwUUID) UnmarshalJSON(text []byte) error

UnmarshalJSON will unmarshal a JSON value into the proper representation of that value.

func (HwUUID) Value

func (u HwUUID) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

type OrderType

type OrderType string
const (
	Ascending  OrderType = "asc"
	Descending           = "desc"
)

func GetOrderType

func GetOrderType(oType string) (OrderType, error)

func (OrderType) String

func (ot OrderType) String() string

type Queue

type Queue struct {
	Id      uuid.UUID              `json:"id,omitempty"`
	Action  string                 `json:"action"`
	Params  map[string]interface{} `json:"action_params"`
	Created time.Time              `json:"created,omitempty"`
	Updated time.Time              `json:"updated,omitempty"`
	State   QueueState             `json:"state"`
	Message string                 `json:"message,omitempty"`
}

type QueueFilterCriteria

type QueueFilterCriteria struct {
	Id          uuid.UUID
	Action      string
	ParamKey    string
	ParamValue  string
	ParamMap    map[string]string
	QueueStates []QueueState
	Limit       int
}

type QueueState

type QueueState int
const (
	QueueStateUnknown QueueState = iota
	QueueStateNew
	QueueStatePending
	QueueStateCompleted
	QueueStateReturned
	QueueStateTimeout
	QueueStateConnectionFailure
	QueueStateError
)

func (QueueState) MarshalJSON

func (s QueueState) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (*QueueState) Unmarshal

func (s *QueueState) Unmarshal(str string)

func (*QueueState) UnmarshalJSON

func (s *QueueState) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshalls a quoted json string to the enum value

func (QueueState) Valid

func (s QueueState) Valid() bool

type QuoteReportCache

type QuoteReportCache struct {
	QuoteDigest  string
	TrustPcrList []int
	TrustReport  *hvs.TrustReport
}

type ReportFilterCriteria

type ReportFilterCriteria struct {
	ID             uuid.UUID
	HostID         uuid.UUID
	HostName       string
	HostHardwareID uuid.UUID
	HostStatus     string
	NumberOfDays   int
	FromDate       time.Time
	ToDate         time.Time
	LatestPerHost  bool
	Limit          int
}

type ReportLocator

type ReportLocator struct {
	ID     uuid.UUID
	HostID uuid.UUID
}

type TagCertificateCreateCriteria

type TagCertificateCreateCriteria struct {
	// HardwareUUID The hardware UUID of the host to which the tag certificate is associated.
	// swagger:strfmt uuid
	HardwareUUID uuid.UUID `json:"hardware_uuid"`
	// SelectionContent is an array of one or more key-value pairs with the tag selection attributes.
	SelectionContent []hvs.TagKvAttribute `json:"selection_content,omitempty"`
}

TagCertificateCreateCriteria holds the data used to create a TagCertificate

type TagCertificateDeployCriteria

type TagCertificateDeployCriteria struct {
	// swagger:strfmt uuid
	CertID uuid.UUID `json:"certificate_id,omitempty"`
}

TagCertificateDeployCriteria holds the data used to deploy a TagCertificate onto a host

type TagCertificateFilterCriteria

type TagCertificateFilterCriteria struct {
	// swagger:strfmt uuid
	ID              uuid.UUID `json:"id"`
	SubjectEqualTo  string    `json:"subjectEqualTo"`
	SubjectContains string    `json:"subjectContains"`
	IssuerEqualTo   string    `json:"issuerEqualTo"`
	IssuerContains  string    `json:"issuerContains"`
	ValidOn         time.Time `json:"validOn"`
	ValidBefore     time.Time `json:"validBefore"`
	ValidAfter      time.Time `json:"validAfter"`
	// swagger:strfmt uuid
	HardwareUUID uuid.UUID `json:"hardwareUuid"`
}

TagCertificateFilterCriteria is passed to the TagCertificates Search API to filter the response

type TpmEndorsementFilterCriteria

type TpmEndorsementFilterCriteria struct {
	Id                       uuid.UUID
	HardwareUuidEqualTo      uuid.UUID
	IssuerEqualTo            string
	IssuerContains           string
	RevokedEqualTo           bool
	CommentEqualTo           string
	CommentContains          string
	CertificateDigestEqualTo string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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