Documentation ¶
Index ¶
- Constants
- func SyncRegistry(pm promgr.ProjectManager) error
- type BaseController
- type ConfigAPI
- type EmailAPI
- type GeneralInfo
- type InternalAPI
- type LdapAPI
- type LogAPI
- type MetadataAPI
- type ProjectAPI
- type ProjectMemberAPI
- type RepJobAPI
- type RepPolicyAPI
- type ReplicationAPI
- type RepositoryAPI
- func (ra *RepositoryAPI) Delete()
- func (ra *RepositoryAPI) Get()
- func (ra *RepositoryAPI) GetManifests()
- func (ra *RepositoryAPI) GetSignatures()
- func (ra *RepositoryAPI) GetTag()
- func (ra *RepositoryAPI) GetTags()
- func (ra *RepositoryAPI) GetTopRepos()
- func (ra *RepositoryAPI) Put()
- func (ra *RepositoryAPI) ScanAll()
- func (ra *RepositoryAPI) ScanImage()
- func (ra *RepositoryAPI) VulnerabilityDetails()
- type ScanJobAPI
- type SearchAPI
- type StatisticAPI
- type Storage
- type SystemInfo
- type SystemInfoAPI
- type TargetAPI
- type UserAPI
Constants ¶
const ( //ReplicationJobType ... ReplicationJobType = "replication" //ScanJobType ... ScanJobType = "scan" )
const ( // PriPC : count of private projects PriPC = "private_project_count" // PriRC : count of private repositories PriRC = "private_repo_count" // PubPC : count of public projects PubPC = "public_project_count" // PubRC : count of public repositories PubRC = "public_repo_count" // TPC : total count of projects TPC = "total_project_count" // TRC : total count of repositories TRC = "total_repo_count" )
Variables ¶
This section is empty.
Functions ¶
func SyncRegistry ¶
func SyncRegistry(pm promgr.ProjectManager) error
SyncRegistry syncs the repositories of registry with database.
Types ¶
type BaseController ¶
type BaseController struct { api.BaseAPI // SecurityCtx is the security context used to authN &authZ SecurityCtx security.Context // ProjectMgr is the project manager which abstracts the operations // related to projects ProjectMgr promgr.ProjectManager }
BaseController ...
func (*BaseController) Prepare ¶
func (b *BaseController) Prepare()
Prepare inits security context and project manager from request context
type EmailAPI ¶
type EmailAPI struct {
BaseController
}
EmailAPI ...
type GeneralInfo ¶
type GeneralInfo struct { WithNotary bool `json:"with_notary"` WithClair bool `json:"with_clair"` WithAdmiral bool `json:"with_admiral"` AdmiralEndpoint string `json:"admiral_endpoint"` AuthMode string `json:"auth_mode"` RegistryURL string `json:"registry_url"` ProjectCreationRestrict string `json:"project_creation_restriction"` SelfRegistration bool `json:"self_registration"` HasCARoot bool `json:"has_ca_root"` HarborVersion string `json:"harbor_version"` NextScanAll int64 `json:"next_scan_all"` ClairVulnStatus *models.ClairVulnerabilityStatus `json:"clair_vulnerability_status,omitempty"` RegistryStorageProviderName string `json:"registry_storage_provider_name"` }
GeneralInfo wraps common systeminfo for anonymous request
type InternalAPI ¶
type InternalAPI struct {
BaseController
}
InternalAPI handles request of harbor admin...
func (*InternalAPI) RenameAdmin ¶
func (ia *InternalAPI) RenameAdmin()
RenameAdmin we don't provide flexibility in this API, as this is a workaround.
type LdapAPI ¶
type LdapAPI struct {
BaseController
}
LdapAPI handles requesst to /api/ldap/ping /api/ldap/user/search /api/ldap/user/import
type LogAPI ¶
type LogAPI struct { BaseController // contains filtered or unexported fields }
LogAPI handles request api/logs
type MetadataAPI ¶
type MetadataAPI struct { BaseController // contains filtered or unexported fields }
MetadataAPI ...
type ProjectAPI ¶
type ProjectAPI struct { BaseController // contains filtered or unexported fields }
ProjectAPI handles request to /api/projects/{} /api/projects/{}/logs
type ProjectMemberAPI ¶
type ProjectMemberAPI struct { BaseController // contains filtered or unexported fields }
ProjectMemberAPI handles request to /api/projects/{}/members/{}
func (*ProjectMemberAPI) Prepare ¶
func (pma *ProjectMemberAPI) Prepare()
Prepare validates the URL and parms
type RepJobAPI ¶
type RepJobAPI struct { BaseController // contains filtered or unexported fields }
RepJobAPI handles request to /api/replicationJobs /api/replicationJobs/:id/log
type RepPolicyAPI ¶
type RepPolicyAPI struct {
BaseController
}
RepPolicyAPI handles /api/replicationPolicies /api/replicationPolicies/:id/enablement
func (*RepPolicyAPI) Prepare ¶
func (pa *RepPolicyAPI) Prepare()
Prepare validates whether the user has system admin role
type ReplicationAPI ¶
type ReplicationAPI struct {
BaseController
}
ReplicationAPI handles API calls for replication
func (*ReplicationAPI) Post ¶
func (r *ReplicationAPI) Post()
Post trigger a replication according to the specified policy
func (*ReplicationAPI) Prepare ¶
func (r *ReplicationAPI) Prepare()
Prepare does authentication and authorization works
type RepositoryAPI ¶
type RepositoryAPI struct {
BaseController
}
RepositoryAPI handles request to /api/repositories /api/repositories/tags /api/repositories/manifests, the parm has to be put in the query string as the web framework can not parse the URL if it contains veriadic sectors.
func (*RepositoryAPI) GetManifests ¶
func (ra *RepositoryAPI) GetManifests()
GetManifests returns the manifest of a tag
func (*RepositoryAPI) GetSignatures ¶
func (ra *RepositoryAPI) GetSignatures()
GetSignatures returns signatures of a repository
func (*RepositoryAPI) GetTag ¶
func (ra *RepositoryAPI) GetTag()
GetTag returns the tag of a repository
func (*RepositoryAPI) GetTags ¶
func (ra *RepositoryAPI) GetTags()
GetTags returns tags of a repository
func (*RepositoryAPI) GetTopRepos ¶
func (ra *RepositoryAPI) GetTopRepos()
GetTopRepos returns the most populor repositories
func (*RepositoryAPI) Put ¶
func (ra *RepositoryAPI) Put()
Put updates description info for the repository
func (*RepositoryAPI) ScanAll ¶
func (ra *RepositoryAPI) ScanAll()
ScanAll handles the api to scan all images on Harbor.
func (*RepositoryAPI) ScanImage ¶
func (ra *RepositoryAPI) ScanImage()
ScanImage handles request POST /api/repository/$repository/tags/$tag/scan to trigger image scan manually.
func (*RepositoryAPI) VulnerabilityDetails ¶
func (ra *RepositoryAPI) VulnerabilityDetails()
VulnerabilityDetails fetch vulnerability info from clair, transform to Harbor's format and return to client.
type ScanJobAPI ¶
type ScanJobAPI struct { BaseController // contains filtered or unexported fields }
ScanJobAPI handles request to /api/scanJobs/:id/log
func (*ScanJobAPI) Prepare ¶
func (sj *ScanJobAPI) Prepare()
Prepare validates that whether user has read permission to the project of the repo the scan job scanned.
type StatisticAPI ¶
type StatisticAPI struct { BaseController // contains filtered or unexported fields }
StatisticAPI handles request to /api/statistics/
func (*StatisticAPI) Prepare ¶
func (s *StatisticAPI) Prepare()
Prepare validates the URL and the user
type SystemInfo ¶
type SystemInfo struct {
HarborStorage Storage `json:"storage"`
}
SystemInfo models for system info.
type SystemInfoAPI ¶
type SystemInfoAPI struct {
BaseController
}
SystemInfoAPI handle requests for getting system info /api/systeminfo
func (*SystemInfoAPI) GetCert ¶
func (sia *SystemInfoAPI) GetCert()
GetCert gets default self-signed certificate.
func (*SystemInfoAPI) GetGeneralInfo ¶
func (sia *SystemInfoAPI) GetGeneralInfo()
GetGeneralInfo returns the general system info, which is to be called by anonymous user
func (*SystemInfoAPI) GetVolumeInfo ¶
func (sia *SystemInfoAPI) GetVolumeInfo()
GetVolumeInfo gets specific volume storage info.
type TargetAPI ¶
type TargetAPI struct { BaseController // contains filtered or unexported fields }
TargetAPI handles request to /api/targets/ping /api/targets/{}
type UserAPI ¶
type UserAPI struct { BaseController SelfRegistration bool IsAdmin bool AuthMode string // contains filtered or unexported fields }
UserAPI handles request to /api/users/{}
func (*UserAPI) ChangePassword ¶
func (ua *UserAPI) ChangePassword()
ChangePassword handles PUT to /api/users/{}/password
func (*UserAPI) ToggleUserAdminRole ¶
func (ua *UserAPI) ToggleUserAdminRole()
ToggleUserAdminRole handles PUT api/users/{}/sysadmin