models

package
v1.8.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JobPending ...
	JobPending string = "pending"
	// JobRunning ...
	JobRunning string = "running"
	// JobError ...
	JobError string = "error"
	// JobStopped ...
	JobStopped string = "stopped"
	// JobFinished ...
	JobFinished string = "finished"
	// JobCanceled ...
	JobCanceled string = "canceled"
	// JobRetrying indicate the job needs to be retried, it will be scheduled to the end of job queue by statemachine after an interval.
	JobRetrying string = "retrying"
	// JobContinue is the status returned by statehandler to tell statemachine to move to next possible state based on trasition table.
	JobContinue string = "_continue"
	// JobScheduled ...
	JobScheduled string = "scheduled"
)
View Source
const (
	ProMetaPublic             = "public"
	ProMetaEnableContentTrust = "enable_content_trust"
	ProMetaPreventVul         = "prevent_vul" // prevent vulnerable images from being pulled
	ProMetaSeverity           = "severity"
	ProMetaAutoScan           = "auto_scan"
	SeverityNone              = "negligible"
	SeverityLow               = "low"
	SeverityMedium            = "medium"
	SeverityHigh              = "high"
	SeverityCritical          = "critical"
)

keys of project metadata and severity values

View Source
const (
	// PROJECTADMIN project administrator
	PROJECTADMIN = 1
	// DEVELOPER developer
	DEVELOPER = 2
	// GUEST guest
	GUEST = 3
)
View Source
const (
	// ScanAllNone "none" for not doing any scan all
	ScanAllNone = "none"
	// ScanAllDaily for doing scan all daily
	ScanAllDaily = "daily"
	// ScanAllOnRefresh for doing scan all when the Clair DB is refreshed.
	ScanAllOnRefresh = "on_refresh"
	// ScanAllDailyTime the key for parm of daily scan all policy.
	ScanAllDailyTime = "daily_time"
)
View Source
const (
	// AdminJobTable is table name for admin job
	AdminJobTable = "admin_job"
)
View Source
const ClairVulnTimestampTable = "clair_vuln_timestamp"

ClairVulnTimestampTable is the name of the table that tracks the timestamp of vulnerability in Clair.

View Source
const JobLogTable = "job_log"

JobLogTable is the name of the table that record the job execution result.

View Source
const ProjectTable = "project"

ProjectTable is the table name for project

View Source
const RepoTable = "repository"

RepoTable is the table name for repository

View Source
const RobotTable = "robot"

RobotTable is the name of table in DB that holds the robot object

View Source
const ScanJobTable = "img_scan_job"

ScanJobTable is the name of the table whose data is mapped by ScanJob struct.

View Source
const ScanOverviewTable = "img_scan_overview"

ScanOverviewTable is the name of the table whose data is mapped by ImgScanOverview struct.

View Source
const UserGroupTable = "user_group"

UserGroupTable is the name of table in DB that holds the user object

View Source
const UserTable = "harbor_user"

UserTable is the name of table in DB that holds the user object

Variables

View Source
var DefaultScanAllPolicy = ScanAllPolicy{
	Type: ScanAllNone,
}

DefaultScanAllPolicy ...

Functions

func ParseScheduleParamToCron added in v1.8.0

func ParseScheduleParamToCron(param *ScheduleParam) string

ParseScheduleParamToCron ...

Types

type AccessLog

type AccessLog struct {
	LogID     int       `orm:"pk;auto;column(log_id)" json:"log_id"`
	Username  string    `orm:"column(username)"  json:"username"`
	ProjectID int64     `orm:"column(project_id)"  json:"project_id"`
	RepoName  string    `orm:"column(repo_name)" json:"repo_name"`
	RepoTag   string    `orm:"column(repo_tag)" json:"repo_tag"`
	GUID      string    `orm:"column(guid)"  json:"guid"`
	Operation string    `orm:"column(operation)" json:"operation"`
	OpTime    time.Time `orm:"column(op_time)" json:"op_time"`
}

AccessLog holds information about logs which are used to record the actions that user take to the resourses.

type Actor

type Actor struct {
	Name string
}

Actor holds information about actor.

type AdminJob added in v1.6.0

type AdminJob struct {
	ID           int64     `orm:"pk;auto;column(id)" json:"id"`
	Name         string    `orm:"column(job_name)"  json:"job_name"`
	Kind         string    `orm:"column(job_kind)"  json:"job_kind"`
	Cron         string    `orm:"column(cron_str)"  json:"cron_str"`
	Status       string    `orm:"column(status)"  json:"job_status"`
	UUID         string    `orm:"column(job_uuid)" json:"-"`
	Deleted      bool      `orm:"column(deleted)" json:"deleted"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now" json:"update_time"`
}

AdminJob ...

func (*AdminJob) TableName added in v1.6.0

func (a *AdminJob) TableName() string

TableName is required by by beego orm to map AdminJob to table AdminJob

type AdminJobQuery added in v1.6.0

type AdminJobQuery struct {
	ID      int64
	Name    string
	Kind    string
	Status  string
	UUID    string
	Deleted bool
	Pagination
}

AdminJobQuery : query parameters for adminjob

type AuthModel

type AuthModel struct {
	Principal string
	Password  string
}

AuthModel holds information used to authenticate.

type BaseProjectCollection

type BaseProjectCollection struct {
	Public bool
	Member string
}

BaseProjectCollection contains the query conditions which can be used to get a project collection. The collection can be used as the base to do other filter

type ClairError

type ClairError struct {
	Message string `json:"Message,omitempty"`
}

ClairError ...

type ClairFeature

type ClairFeature struct {
	Name            string               `json:"Name,omitempty"`
	NamespaceName   string               `json:"NamespaceName,omitempty"`
	VersionFormat   string               `json:"VersionFormat,omitempty"`
	Version         string               `json:"Version,omitempty"`
	Vulnerabilities []ClairVulnerability `json:"Vulnerabilities,omitempty"`
	AddedBy         string               `json:"AddedBy,omitempty"`
}

ClairFeature ...

type ClairLayer

type ClairLayer struct {
	Name           string            `json:"Name,omitempty"`
	NamespaceNames []string          `json:"NamespaceNames,omitempty"`
	Path           string            `json:"Path,omitempty"`
	Headers        map[string]string `json:"Headers,omitempty"`
	ParentName     string            `json:"ParentName,omitempty"`
	Format         string            `json:"Format,omitempty"`
	Features       []ClairFeature    `json:"Features,omitempty"`
}

ClairLayer ...

type ClairLayerEnvelope

type ClairLayerEnvelope struct {
	Layer *ClairLayer `json:"Layer,omitempty"`
	Error *ClairError `json:"Error,omitempty"`
}

ClairLayerEnvelope ...

type ClairNamespace

type ClairNamespace struct {
	Name          string `json:"Name,omitempty"`
	VersionFormat string `json:"VersionFormat,omitempty"`
}

ClairNamespace ...

type ClairNamespaceEnvelope

type ClairNamespaceEnvelope struct {
	Namespaces *[]ClairNamespace `json:"Namespaces,omitempty"`
	Error      *ClairError       `json:"Error,omitempty"`
}

ClairNamespaceEnvelope ...

type ClairNamespaceTimestamp

type ClairNamespaceTimestamp struct {
	Namespace string `json:"namespace"`
	Timestamp int64  `json:"last_update"`
}

ClairNamespaceTimestamp is a record to store the clairname space and the timestamp, in practice different namespace in Clair maybe merged into one, e.g. ubuntu:14.04 and ubuntu:16.4 maybe merged into ubuntu and put into response.

type ClairNotification

type ClairNotification struct {
	Name     string                        `json:"Name,omitempty"`
	Created  string                        `json:"Created,omitempty"`
	Notified string                        `json:"Notified,omitempty"`
	Deleted  string                        `json:"Deleted,omitempty"`
	Limit    int                           `json:"Limit,omitempty"`
	Page     string                        `json:"Page,omitempty"`
	NextPage string                        `json:"NextPage,omitempty"`
	Old      *ClairVulnerabilityWithLayers `json:"Old,omitempty"`
	New      *ClairVulnerabilityWithLayers `json:"New,omitempty"`
}

ClairNotification ...

type ClairNotificationEnvelope

type ClairNotificationEnvelope struct {
	Notification *ClairNotification `json:"Notification,omitempty"`
	Error        *ClairError        `json:"Error,omitempty"`
}

ClairNotificationEnvelope ...

type ClairOrderedLayerName

type ClairOrderedLayerName struct {
	Index     int    `json:"Index"`
	LayerName string `json:"LayerName"`
}

ClairOrderedLayerName ...

type ClairVulnTimestamp

type ClairVulnTimestamp struct {
	ID            int64     `orm:"pk;auto;column(id)" json:"-"`
	Namespace     string    `orm:"column(namespace)" json:"namespace"`
	LastUpdate    time.Time `orm:"column(last_update)" json:"-"`
	LastUpdateUTC int64     `orm:"-" json:"last_update"`
}

ClairVulnTimestamp represents a record in DB that tracks the timestamp of vulnerability in Clair.

func (*ClairVulnTimestamp) TableName

func (ct *ClairVulnTimestamp) TableName() string

TableName is required by beego to map struct to table.

type ClairVulnerability

type ClairVulnerability struct {
	Name          string                 `json:"Name,omitempty"`
	NamespaceName string                 `json:"NamespaceName,omitempty"`
	Description   string                 `json:"Description,omitempty"`
	Link          string                 `json:"Link,omitempty"`
	Severity      string                 `json:"Severity,omitempty"`
	Metadata      map[string]interface{} `json:"Metadata,omitempty"`
	FixedBy       string                 `json:"FixedBy,omitempty"`
	FixedIn       []ClairFeature         `json:"FixedIn,omitempty"`
}

ClairVulnerability ...

type ClairVulnerabilityStatus

type ClairVulnerabilityStatus struct {
	OverallUTC int64                     `json:"overall_last_update,omitempty"`
	Details    []ClairNamespaceTimestamp `json:"details,omitempty"`
}

ClairVulnerabilityStatus reflects the readiness and freshness of vulnerability data in Clair, which will be returned in response of systeminfo API.

type ClairVulnerabilityWithLayers

type ClairVulnerabilityWithLayers struct {
	Vulnerability                         *ClairVulnerability     `json:"Vulnerability,omitempty"`
	OrderedLayersIntroducingVulnerability []ClairOrderedLayerName `json:"OrderedLayersIntroducingVulnerability,omitempty"`
}

ClairVulnerabilityWithLayers ...

type ComponentsOverview

type ComponentsOverview struct {
	Total   int                        `json:"total"`
	Summary []*ComponentsOverviewEntry `json:"summary"`
}

ComponentsOverview has the total number and a list of components number of different serverity level.

type ComponentsOverviewEntry

type ComponentsOverviewEntry struct {
	Sev   int `json:"severity"`
	Count int `json:"count"`
}

ComponentsOverviewEntry ...

type ConfigEntry

type ConfigEntry struct {
	ID    int64  `orm:"pk;auto;column(id)" json:"-"`
	Key   string `orm:"column(k)" json:"k"`
	Value string `orm:"column(v)" json:"v"`
}

ConfigEntry ...

func (*ConfigEntry) TableName

func (ce *ConfigEntry) TableName() string

TableName ...

type Database

type Database struct {
	Type       string      `json:"type"`
	PostGreSQL *PostGreSQL `json:"postgresql,omitempty"`
}

Database ...

type Email

type Email struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
	SSL      bool   `json:"ssl"`
	Identity string `json:"identity"`
	From     string `json:"from"`
	Insecure bool   `json:"insecure"`
}

Email ...

type Event

type Event struct {
	ID        string `json:"Id"`
	TimeStamp time.Time
	Action    string
	Target    *Target
	Request   *Request
	Actor     *Actor
}

Event holds the details of a event.

type HTTPAuthProxy added in v1.8.0

type HTTPAuthProxy struct {
	Endpoint            string `json:"endpoint"`
	TokenReviewEndpoint string `json:"tokenreivew_endpoint"`
	VerifyCert          bool   `json:"verify_cert"`
	AlwaysOnBoard       bool   `json:"always_onboard"`
}

HTTPAuthProxy wraps the settings for HTTP auth proxy

type Image added in v1.7.0

type Image struct {
	Project string
	Repo    string
	Tag     string
}

Image holds each part (project, repo, tag) of an image name

func ParseImage added in v1.7.0

func ParseImage(image string) (*Image, error)

ParseImage parses an image name such as 'library/app:v1.0' to a structure with project, repo, and tag fields

type ImageScanReq

type ImageScanReq struct {
	Repo string `json:"repository"`
	Tag  string `json:"tag"`
}

ImageScanReq represents the request body to send to job service for image scan

type ImgScanOverview

type ImgScanOverview struct {
	ID              int64               `orm:"pk;auto;column(id)" json:"-"`
	Digest          string              `orm:"column(image_digest)" json:"image_digest"`
	Status          string              `orm:"-" json:"scan_status"`
	JobID           int64               `orm:"column(scan_job_id)" json:"job_id"`
	Sev             int                 `orm:"column(severity)" json:"severity"`
	CompOverviewStr string              `orm:"column(components_overview)" json:"-"`
	CompOverview    *ComponentsOverview `orm:"-" json:"components,omitempty"`
	DetailsKey      string              `orm:"column(details_key)" json:"details_key"`
	CreationTime    time.Time           `orm:"column(creation_time);auto_now_add" json:"creation_time,omitempty"`
	UpdateTime      time.Time           `orm:"column(update_time);auto_now" json:"update_time,omitempty"`
}

ImgScanOverview mapped to a record of image scan overview.

func (*ImgScanOverview) TableName

func (iso *ImgScanOverview) TableName() string

TableName ...

type JobLog added in v1.7.0

type JobLog struct {
	LogID        int       `orm:"pk;auto;column(log_id)" json:"log_id"`
	UUID         string    `orm:"column(job_uuid)" json:"uuid"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	Content      string    `orm:"column(content)" json:"content"`
}

JobLog holds information about logs which are used to record the result of execution of a job.

func (*JobLog) TableName added in v1.7.0

func (a *JobLog) TableName() string

TableName is required by by beego orm to map JobLog to table job_log

type Label added in v1.5.0

type Label struct {
	ID           int64     `orm:"pk;auto;column(id)" json:"id"`
	Name         string    `orm:"column(name)" json:"name"`
	Description  string    `orm:"column(description)" json:"description"`
	Color        string    `orm:"column(color)" json:"color"`
	Level        string    `orm:"column(level)" json:"-"`
	Scope        string    `orm:"column(scope)" json:"scope"`
	ProjectID    int64     `orm:"column(project_id)" json:"project_id"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now" json:"update_time"`
	Deleted      bool      `orm:"column(deleted)" json:"deleted"`
}

Label holds information used for a label

func (*Label) TableName added in v1.5.0

func (l *Label) TableName() string

TableName ...

func (*Label) Valid added in v1.5.0

func (l *Label) Valid(v *validation.Validation)

Valid ...

type LabelQuery added in v1.5.0

type LabelQuery struct {
	Name           string
	FuzzyMatchName bool // the property is used to determine the query for lable name is fuzzy matching or exaxt matching
	Level          string
	Scope          string
	ProjectID      int64
	Pagination
}

LabelQuery : query parameters for labels

type LdapConf

type LdapConf struct {
	LdapURL               string `json:"ldap_url"`
	LdapSearchDn          string `json:"ldap_search_dn"`
	LdapSearchPassword    string `json:"ldap_search_password"`
	LdapBaseDn            string `json:"ldap_base_dn"`
	LdapFilter            string `json:"ldap_filter"`
	LdapUID               string `json:"ldap_uid"`
	LdapScope             int    `json:"ldap_scope"`
	LdapConnectionTimeout int    `json:"ldap_connection_timeout"`
	LdapVerifyCert        bool   `json:"ldap_verify_cert"`
}

LdapConf holds information about ldap configuration

type LdapFailedImportUser

type LdapFailedImportUser struct {
	UID   string `json:"uid"`
	Error string `json:"err_msg"`
}

LdapFailedImportUser ...

type LdapGroup added in v1.5.0

type LdapGroup struct {
	GroupName string `json:"group_name,omitempty"`
	GroupDN   string `json:"ldap_group_dn,omitempty"`
}

LdapGroup ...

type LdapGroupConf added in v1.5.0

type LdapGroupConf struct {
	LdapGroupBaseDN              string `json:"ldap_group_base_dn,omitempty"`
	LdapGroupFilter              string `json:"ldap_group_filter,omitempty"`
	LdapGroupNameAttribute       string `json:"ldap_group_name_attribute,omitempty"`
	LdapGroupSearchScope         int    `json:"ldap_group_search_scope"`
	LdapGroupAdminDN             string `json:"ldap_group_admin_dn,omitempty"`
	LdapGroupMembershipAttribute string `json:"ldap_group_membership_attribute,omitempty"`
}

LdapGroupConf holds information about ldap group

type LdapImportUser

type LdapImportUser struct {
	LdapUIDList []string `json:"ldap_uid_list"`
}

LdapImportUser ...

type LdapUser

type LdapUser struct {
	Username    string   `json:"ldap_username"`
	Email       string   `json:"ldap_email"`
	Realname    string   `json:"ldap_realname"`
	DN          string   `json:"-"`
	GroupDNList []string `json:"ldap_groupdn"`
}

LdapUser ...

type LogQueryParam

type LogQueryParam struct {
	ProjectIDs []int64     // the IDs of projects to which the operation is done
	Username   string      // the operator's username of the log
	Repository string      // repository name
	Tag        string      // tag name
	Operations []string    // operations
	BeginTime  *time.Time  // the time after which the operation is done
	EndTime    *time.Time  // the time before which the operation is doen
	Pagination *Pagination // pagination information
}

LogQueryParam is used to set query conditions when listing access logs.

type Member

type Member struct {
	ID         int    `orm:"pk;column(id)" json:"id"`
	ProjectID  int64  `orm:"column(project_id)" json:"project_id"`
	Entityname string `orm:"column(entity_name)" json:"entity_name"`
	Rolename   string `json:"role_name"`
	Role       int    `json:"role_id"`
	EntityID   int    `orm:"column(entity_id)" json:"entity_id"`
	EntityType string `orm:"column(entity_type)" json:"entity_type"`
}

Member holds the details of a member.

type MemberQuery

type MemberQuery struct {
	Name      string       // the username of member
	Role      int          // the role of the member has to the project
	GroupList []*UserGroup // the group list of current user
}

MemberQuery filter by member's username and role

type MemberReq added in v1.5.0

type MemberReq struct {
	ProjectID   int64     `json:"project_id"`
	Role        int       `json:"role_id,omitempty"`
	MemberUser  User      `json:"member_user,omitempty"`
	MemberGroup UserGroup `json:"member_group,omitempty"`
}

MemberReq - Create Project Member Request

type MySQL

type MySQL struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password,omitempty"`
	Database string `json:"database"`
}

MySQL ...

type Notification

type Notification struct {
	Events []Event
}

Notification holds all events.

type OIDCSetting added in v1.8.0

type OIDCSetting struct {
	Name         string   `json:"name"`
	Endpoint     string   `json:"endpoint"`
	VerifyCert   bool     `json:"verify_cert"`
	ClientID     string   `json:"client_id"`
	ClientSecret string   `json:"client_secret"`
	RedirectURL  string   `json:"redirect_url"`
	Scope        []string `json:"scope"`
}

OIDCSetting wraps the settings for OIDC auth endpoint

type OIDCUser added in v1.8.0

type OIDCUser struct {
	ID     int64 `orm:"pk;auto;column(id)" json:"id"`
	UserID int   `orm:"column(user_id)" json:"user_id"`
	// encrypted secret
	Secret string `orm:"column(secret)" json:"-"`
	// secret in plain text
	PlainSecret  string    `orm:"-" json:"secret"`
	SubIss       string    `orm:"column(subiss)" json:"subiss"`
	Token        string    `orm:"column(token)" json:"-"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now" json:"update_time"`
}

OIDCUser ...

func (*OIDCUser) TableName added in v1.8.0

func (o *OIDCUser) TableName() string

TableName ...

type Pagination

type Pagination struct {
	Page int64
	Size int64
}

Pagination ...

type PostGreSQL

type PostGreSQL struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password,omitempty"`
	Database string `json:"database"`
	SSLMode  string `json:"sslmode"`
}

PostGreSQL ...

type Project

type Project struct {
	ProjectID    int64             `orm:"pk;auto;column(project_id)" json:"project_id"`
	OwnerID      int               `orm:"column(owner_id)" json:"owner_id"`
	Name         string            `orm:"column(name)" json:"name"`
	CreationTime time.Time         `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time         `orm:"column(update_time);auto_now" json:"update_time"`
	Deleted      bool              `orm:"column(deleted)" json:"deleted"`
	OwnerName    string            `orm:"-" json:"owner_name"`
	Togglable    bool              `orm:"-" json:"togglable"`
	Role         int               `orm:"-" json:"current_user_role_id"`
	RepoCount    int64             `orm:"-" json:"repo_count"`
	ChartCount   uint64            `orm:"-" json:"chart_count"`
	Metadata     map[string]string `orm:"-" json:"metadata"`
}

Project holds the details of a project.

func (*Project) AutoScan

func (p *Project) AutoScan() bool

AutoScan ...

func (*Project) ContentTrustEnabled

func (p *Project) ContentTrustEnabled() bool

ContentTrustEnabled ...

func (*Project) GetMetadata

func (p *Project) GetMetadata(key string) (string, bool)

GetMetadata ...

func (*Project) IsPublic

func (p *Project) IsPublic() bool

IsPublic ...

func (*Project) SetMetadata

func (p *Project) SetMetadata(key, value string)

SetMetadata ...

func (*Project) Severity

func (p *Project) Severity() string

Severity ...

func (*Project) TableName

func (p *Project) TableName() string

TableName is required by beego orm to map Project to table project

func (*Project) VulPrevented

func (p *Project) VulPrevented() bool

VulPrevented ...

type ProjectMetadata

type ProjectMetadata struct {
	ID           int64     `orm:"pk;auto;column(id)" json:"id"`
	ProjectID    int64     `orm:"column(project_id)" json:"project_id"`
	Name         string    `orm:"column(name)" json:"name"`
	Value        string    `orm:"column(value)" json:"value"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now" json:"update_time"`
	Deleted      bool      `orm:"column(deleted)" json:"deleted"`
}

ProjectMetadata holds the metadata of a project.

type ProjectQueryParam

type ProjectQueryParam struct {
	Name       string       // the name of project
	Owner      string       // the username of project owner
	Public     *bool        // the project is public or not, can be ture, false and nil
	Member     *MemberQuery // the member of project
	Pagination *Pagination  // pagination information
	ProjectIDs []int64      // project ID list
}

ProjectQueryParam can be used to set query parameters when listing projects. The query condition will be set in the query if its corresponding field is not nil. Leave it empty if you don't want to apply this condition.

e.g. List all projects: query := nil List all public projects: query := &QueryParam{Public: true} List projects the owner of which is user1: query := &QueryParam{Owner:"user1"} List all public projects the owner of which is user1: query := &QueryParam{Owner:"user1",Public:true} List projects which user1 is member of: query := &QueryParam{Member:&Member{Name:"user1"}} List projects which user1 is the project admin : query := &QueryParam{Member:&Member{Name:"user1",Role:1}}

type ProjectQueryResult

type ProjectQueryResult struct {
	Total    int64
	Projects []*Project
}

ProjectQueryResult ...

type ProjectRequest

type ProjectRequest struct {
	Name     string            `json:"project_name"`
	Public   *int              `json:"public"` // deprecated, reserved for project creation in replication
	Metadata map[string]string `json:"metadata"`
}

ProjectRequest holds informations that need for creating project API

type RepoRecord

type RepoRecord struct {
	RepositoryID int64     `orm:"pk;auto;column(repository_id)" json:"repository_id"`
	Name         string    `orm:"column(name)" json:"name"`
	ProjectID    int64     `orm:"column(project_id)"  json:"project_id"`
	Description  string    `orm:"column(description)" json:"description"`
	PullCount    int64     `orm:"column(pull_count)" json:"pull_count"`
	StarCount    int64     `orm:"column(star_count)" json:"star_count"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now" json:"update_time"`
}

RepoRecord holds the record of an repository in DB, all the infors are from the registry notification event.

func (*RepoRecord) TableName

func (rp *RepoRecord) TableName() string

TableName is required by by beego orm to map RepoRecord to table repository

type RepositoryQuery added in v1.5.0

type RepositoryQuery struct {
	Name        string
	ProjectIDs  []int64
	ProjectName string
	LabelID     int64
	Pagination
	Sorting
}

RepositoryQuery : query parameters for repository

type Request

type Request struct {
	ID        string `json:"Id"`
	Method    string
	UserAgent string
}

Request holds information about a request.

type ResourceActions added in v1.8.0

type ResourceActions struct {
	Name    string   `json:"name"`
	Actions []string `json:"actions"`
}

ResourceActions ...

type ResourceLabel added in v1.5.0

type ResourceLabel struct {
	ID           int64     `orm:"pk;auto;column(id)"`
	LabelID      int64     `orm:"column(label_id)"`
	ResourceID   int64     `orm:"column(resource_id)"`
	ResourceName string    `orm:"column(resource_name)"`
	ResourceType string    `orm:"column(resource_type)"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now"`
}

ResourceLabel records the relationship between resource and label

func (*ResourceLabel) TableName added in v1.5.0

func (r *ResourceLabel) TableName() string

TableName ...

type ResourceLabelQuery added in v1.5.0

type ResourceLabelQuery struct {
	LabelID      int64
	ResourceID   int64
	ResourceName string
	ResourceType string
}

ResourceLabelQuery : query parameters for the mapping relationships of resource and label

type RetagRequest added in v1.7.0

type RetagRequest struct {
	Tag      string `json:"tag"`       // The new tag
	SrcImage string `json:"src_image"` // Source images in format <project>/<repo>:<reference>
	Override bool   `json:"override"`  // If target tag exists, whether override it
}

RetagRequest gives the source image and target image of retag

type Robot added in v1.8.0

type Robot struct {
	ID           int64     `orm:"pk;auto;column(id)" json:"id"`
	Name         string    `orm:"column(name)" json:"name"`
	Description  string    `orm:"column(description)" json:"description"`
	ProjectID    int64     `orm:"column(project_id)" json:"project_id"`
	ExpiresAt    int64     `orm:"column(expiresat)" json:"expires_at"`
	Disabled     bool      `orm:"column(disabled)" json:"disabled"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now" json:"update_time"`
}

Robot holds the details of a robot.

func (*Robot) TableName added in v1.8.0

func (r *Robot) TableName() string

TableName ...

type RobotQuery added in v1.8.0

type RobotQuery struct {
	Name           string
	ProjectID      int64
	Disabled       bool
	FuzzyMatchName bool
	Pagination
}

RobotQuery ...

type RobotRep added in v1.8.0

type RobotRep struct {
	Name  string `json:"name"`
	Token string `json:"token"`
}

RobotRep ...

type RobotReq added in v1.8.0

type RobotReq struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Disabled    bool           `json:"disabled"`
	Access      []*rbac.Policy `json:"access"`
}

RobotReq ...

func (*RobotReq) Valid added in v1.8.0

func (rq *RobotReq) Valid(v *validation.Validation)

Valid put request validation

type Role

type Role struct {
	RoleID   int    `orm:"pk;auto;column(role_id)" json:"role_id"`
	RoleCode string `orm:"column(role_code)" json:"role_code"`
	Name     string `orm:"column(name)" json:"role_name"`

	RoleMask int `orm:"column(role_mask)" json:"role_mask"`
}

Role holds the details of a role.

type SQLite

type SQLite struct {
	File string `json:"file"`
}

SQLite ...

type ScanAllPolicy

type ScanAllPolicy struct {
	Type string                 `json:"type"`
	Parm map[string]interface{} `json:"parameter,omitempty"`
}

ScanAllPolicy is represent the json request and object for scan all policy, the parm is het

type ScanJob

type ScanJob struct {
	ID           int64     `orm:"pk;auto;column(id)" json:"id"`
	Status       string    `orm:"column(status)" json:"status"`
	Repository   string    `orm:"column(repository)" json:"repository"`
	Tag          string    `orm:"column(tag)" json:"tag"`
	Digest       string    `orm:"column(digest)" json:"digest"`
	UUID         string    `orm:"column(job_uuid)" json:"-"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now" json:"update_time"`
}

ScanJob is the model to represent a job for image scan in DB.

func (*ScanJob) TableName

func (s *ScanJob) TableName() string

TableName is required by by beego orm to map ScanJob to table img_scan_job

type ScheduleParam added in v1.8.0

type ScheduleParam struct {
	Type    string `json:"type"`
	Weekday int8   `json:"weekday"`
	Offtime int64  `json:"offtime"`
}

ScheduleParam ...

type SchemaVersion

type SchemaVersion struct {
	Version string `json:"version" orm:"column(version_num)"`
}

SchemaVersion is the version of database schema

type Severity

type Severity int64

Severity represents the severity of a image/component in terms of vulnerability.

const (
	SevNone Severity
	SevUnknown
	SevLow
	SevMedium
	SevHigh
)

Sevxxx is the list of severity of image after scanning.

func (Severity) String

func (sev Severity) String() string

String is the output function for sererity variable

type Sorting added in v1.7.0

type Sorting struct {
	Sort string // in format [+-]?<FIELD_NAME>, e.g. '+creation_time', '-creation_time'
}

Sorting sort by given field, ascending or descending

type Target

type Target struct {
	MediaType  string
	Digest     string
	Repository string
	URL        string `json:"Url"`
	Tag        string
}

Target holds information about the target of a event.

type Token

type Token struct {
	Token     string `json:"token"`
	ExpiresIn int    `json:"expires_in"`
	IssuedAt  string `json:"issued_at"`
}

Token represents the json returned by registry token service

type UAASettings

type UAASettings struct {
	Endpoint     string
	ClientID     string
	ClientSecret string
	VerifyCert   bool
}

UAASettings wraps the configuraations to access UAA service

type User

type User struct {
	UserID   int    `orm:"pk;auto;column(user_id)" json:"user_id"`
	Username string `orm:"column(username)" json:"username"`
	Email    string `orm:"column(email)" json:"email"`
	Password string `orm:"column(password)" json:"password"`
	Realname string `orm:"column(realname)" json:"realname"`
	Comment  string `orm:"column(comment)" json:"comment"`
	Deleted  bool   `orm:"column(deleted)" json:"deleted"`
	Rolename string `orm:"-" json:"role_name"`
	// if this field is named as "RoleID", beego orm can not map role_id
	// to it.
	Role int `orm:"-" json:"role_id"`
	//	RoleList     []Role `json:"role_list"`
	HasAdminRole bool         `orm:"column(sysadmin_flag)" json:"has_admin_role"`
	ResetUUID    string       `orm:"column(reset_uuid)" json:"reset_uuid"`
	Salt         string       `orm:"column(salt)" json:"-"`
	CreationTime time.Time    `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time    `orm:"column(update_time);auto_now" json:"update_time"`
	GroupList    []*UserGroup `orm:"-" json:"-"`
	OIDCUserMeta *OIDCUser    `orm:"-" json:"oidc_user_meta,omitempty"`
}

User holds the details of a user.

func (*User) TableName

func (u *User) TableName() string

TableName ...

type UserGroup added in v1.5.0

type UserGroup struct {
	ID          int    `orm:"pk;auto;column(id)" json:"id,omitempty"`
	GroupName   string `orm:"column(group_name)" json:"group_name,omitempty"`
	GroupType   int    `orm:"column(group_type)" json:"group_type,omitempty"`
	LdapGroupDN string `orm:"column(ldap_group_dn)" json:"ldap_group_dn,omitempty"`
}

UserGroup ...

func (*UserGroup) TableName added in v1.5.0

func (u *UserGroup) TableName() string

TableName ...

type UserMember added in v1.5.0

type UserMember struct {
	ID       int    `orm:"pk;column(user_id)" json:"user_id"`
	Username string `json:"username"`
	Rolename string `json:"role_name"`
	Role     int    `json:"role_id"`
}

UserMember ...

type UserQuery

type UserQuery struct {
	Username   string
	Email      string
	Pagination *Pagination
}

UserQuery ...

type VulnerabilityItem

type VulnerabilityItem struct {
	ID          string   `json:"id"`
	Severity    Severity `json:"severity"`
	Pkg         string   `json:"package"`
	Version     string   `json:"version"`
	Description string   `json:"description"`
	Link        string   `json:"link"`
	Fixed       string   `json:"fixedVersion,omitempty"`
}

VulnerabilityItem is an item in the vulnerability result returned by vulnerability details API.

Jump to

Keyboard shortcuts

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