api

package
Version: v0.0.0-...-0feb2aa Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 45 Imported by: 77

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChartController

func GetChartController() *chartserver.Controller

GetChartController returns the chart controller

func Init

func Init() error

Init related objects/configurations for the API controllers

Types

type BaseController

type BaseController struct {
	api.BaseAPI
	// SecurityCtx is the security context used to authN &authZ
	SecurityCtx security.Context
	// ProjectCtl is the project controller which abstracts the operations
	// related to projects
	ProjectCtl projectcontroller.Controller
}

BaseController ...

func (*BaseController) HasProjectPermission

func (b *BaseController) HasProjectPermission(projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) (bool, error)

HasProjectPermission returns true when the request has action permission on project subresource

func (*BaseController) PopulateUserSession

func (b *BaseController) PopulateUserSession(u models.User)

PopulateUserSession generates a new session ID and fill the user model in parm to the session

func (*BaseController) Prepare

func (b *BaseController) Prepare()

Prepare inits security context and project manager from request context

func (*BaseController) RequireAuthenticated

func (b *BaseController) RequireAuthenticated() bool

RequireAuthenticated returns true when the request is authenticated otherwise send Unauthorized response and returns false

func (*BaseController) RequireProjectAccess

func (b *BaseController) RequireProjectAccess(projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) bool

RequireProjectAccess returns true when the request has action access on project subresource otherwise send UnAuthorized or Forbidden response and returns false

func (*BaseController) SendPermissionError

func (b *BaseController) SendPermissionError()

SendPermissionError is a shortcut for sending different http error based on authentication status.

func (*BaseController) WriteJSONData

func (b *BaseController) WriteJSONData(object interface{})

WriteJSONData writes the JSON data to the client.

func (*BaseController) WriteYamlData

func (b *BaseController) WriteYamlData(object interface{})

WriteYamlData writes the yaml data to the client.

type ChartLabelAPI

type ChartLabelAPI struct {
	LabelResourceAPI
	// contains filtered or unexported fields
}

ChartLabelAPI handles the requests of marking/removing labels to/from charts.

func (*ChartLabelAPI) GetLabels

func (cla *ChartLabelAPI) GetLabels()

GetLabels gets labels for the specified chart version.

func (*ChartLabelAPI) MarkLabel

func (cla *ChartLabelAPI) MarkLabel()

MarkLabel handles the request of marking label to chart.

func (*ChartLabelAPI) Prepare

func (cla *ChartLabelAPI) Prepare()

Prepare required material for follow-up actions.

func (*ChartLabelAPI) RemoveLabel

func (cla *ChartLabelAPI) RemoveLabel()

RemoveLabel handles the request of removing label from chart.

type ChartRepositoryAPI

type ChartRepositoryAPI struct {
	// The base controller to provide common utilities
	BaseController
	// contains filtered or unexported fields
}

ChartRepositoryAPI provides related API handlers for the chart repository APIs

func (*ChartRepositoryAPI) DeleteChart

func (cra *ChartRepositoryAPI) DeleteChart()

DeleteChart deletes all the chart versions of the specified chart.

func (*ChartRepositoryAPI) DeleteChartVersion

func (cra *ChartRepositoryAPI) DeleteChartVersion()

DeleteChartVersion handles DELETE /api/:repo/charts/:name/:version

func (*ChartRepositoryAPI) DownloadChart

func (cra *ChartRepositoryAPI) DownloadChart()

DownloadChart handles GET /:repo/charts/:filename

func (*ChartRepositoryAPI) GetChartVersion

func (cra *ChartRepositoryAPI) GetChartVersion()

GetChartVersion handles GET /api/:repo/charts/:name/:version

func (*ChartRepositoryAPI) GetHealthStatus

func (cra *ChartRepositoryAPI) GetHealthStatus()

GetHealthStatus handles GET /api/chartrepo/health

func (*ChartRepositoryAPI) GetIndex

func (cra *ChartRepositoryAPI) GetIndex()

GetIndex handles GET /index.yaml

func (*ChartRepositoryAPI) GetIndexByRepo

func (cra *ChartRepositoryAPI) GetIndexByRepo()

GetIndexByRepo handles GET /:repo/index.yaml

func (*ChartRepositoryAPI) ListChartVersions

func (cra *ChartRepositoryAPI) ListChartVersions()

ListChartVersions GET /api/:repo/charts/:name

func (*ChartRepositoryAPI) ListCharts

func (cra *ChartRepositoryAPI) ListCharts()

ListCharts handles GET /api/:repo/charts

func (*ChartRepositoryAPI) Prepare

func (cra *ChartRepositoryAPI) Prepare()

Prepare something for the following actions

func (*ChartRepositoryAPI) UploadChartProvFile

func (cra *ChartRepositoryAPI) UploadChartProvFile()

UploadChartProvFile handles POST /api/:repo/prov

func (*ChartRepositoryAPI) UploadChartVersion

func (cra *ChartRepositoryAPI) UploadChartVersion()

UploadChartVersion handles POST /api/:repo/charts

type EmailAPI

type EmailAPI struct {
	BaseController
}

EmailAPI ...

func (*EmailAPI) Ping

func (e *EmailAPI) Ping()

Ping tests connection and authentication with email server

func (*EmailAPI) Prepare

func (e *EmailAPI) Prepare()

Prepare ...

type InternalAPI

type InternalAPI struct {
	BaseController
}

InternalAPI handles request of harbor admin...

func (*InternalAPI) Prepare

func (ia *InternalAPI) Prepare()

Prepare validates the URL and parms

func (*InternalAPI) RenameAdmin

func (ia *InternalAPI) RenameAdmin()

RenameAdmin we don't provide flexibility in this API, as this is a workaround.

func (*InternalAPI) SyncQuota

func (ia *InternalAPI) SyncQuota()

SyncQuota ...

type LabelResourceAPI

type LabelResourceAPI struct {
	BaseController
	// contains filtered or unexported fields
}

LabelResourceAPI provides the related basic functions to handle marking labels to resources

func (*LabelResourceAPI) Prepare

func (lra *LabelResourceAPI) Prepare()

Prepare resources for follow-up actions.

Jump to

Keyboard shortcuts

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