Documentation ¶
Index ¶
- Constants
- func New() http.Handler
- type BaseAPI
- func (b *BaseAPI) BuildQuery(_ context.Context, query, sort *string, pageNumber, pageSize *int64) (*q.Query, error)
- func (*BaseAPI) GetSecurityContext(ctx context.Context) (security.Context, error)
- func (b *BaseAPI) HasPermission(ctx context.Context, action rbac.Action, resource rbac.Resource) bool
- func (b *BaseAPI) HasProjectPermission(ctx context.Context, projectIDOrName interface{}, action rbac.Action, ...) bool
- func (b *BaseAPI) Links(_ context.Context, u *url.URL, total, pageNumber, pageSize int64) lib.Links
- func (*BaseAPI) Prepare(_ context.Context, _ string, _ interface{}) middleware.Responder
- func (b *BaseAPI) RequireAuthenticated(ctx context.Context) error
- func (b *BaseAPI) RequireProjectAccess(ctx context.Context, projectIDOrName interface{}, action rbac.Action, ...) error
- func (b *BaseAPI) RequireSolutionUserAccess(ctx context.Context) error
- func (b *BaseAPI) RequireSystemAccess(ctx context.Context, action rbac.Action, subresource ...rbac.Resource) error
- func (*BaseAPI) SendError(_ context.Context, err error) middleware.Responder
- type ErrResponder
Constants ¶
const ( // ScheduleHourly : 'Hourly' ScheduleHourly = "Hourly" // ScheduleDaily : 'Daily' ScheduleDaily = "Daily" // ScheduleWeekly : 'Weekly' ScheduleWeekly = "Weekly" // ScheduleCustom : 'Custom' ScheduleCustom = "Custom" // ScheduleManual : 'Manual' ScheduleManual = "Manual" // ScheduleNone : 'None' ScheduleNone = "None" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseAPI ¶
type BaseAPI struct{}
BaseAPI base API handler
func (*BaseAPI) BuildQuery ¶
func (b *BaseAPI) BuildQuery(_ context.Context, query, sort *string, pageNumber, pageSize *int64) (*q.Query, error)
BuildQuery builds the query model according to the query string
func (*BaseAPI) GetSecurityContext ¶
GetSecurityContext from the provided context
func (*BaseAPI) HasPermission ¶
func (b *BaseAPI) HasPermission(ctx context.Context, action rbac.Action, resource rbac.Resource) bool
HasPermission returns true when the request has action permission on resource
func (*BaseAPI) HasProjectPermission ¶
func (b *BaseAPI) HasProjectPermission(ctx context.Context, projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) bool
HasProjectPermission returns true when the request has action permission on project subresource
func (*BaseAPI) RequireAuthenticated ¶
RequireAuthenticated checks it's authenticated according to the security context
func (*BaseAPI) RequireProjectAccess ¶
func (b *BaseAPI) RequireProjectAccess(ctx context.Context, projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) error
RequireProjectAccess checks the permission against the resources according to the context An error will be returned if it doesn't meet the requirement
func (*BaseAPI) RequireSolutionUserAccess ¶
RequireSolutionUserAccess check if current user is internal service
type ErrResponder ¶
type ErrResponder struct {
// contains filtered or unexported fields
}
ErrResponder error responder
func NewErrResponder ¶
func NewErrResponder(err error) *ErrResponder
NewErrResponder returns responder for err
func (*ErrResponder) WriteResponse ¶
func (r *ErrResponder) WriteResponse(rw http.ResponseWriter, _ runtime.Producer)
WriteResponse ...
Source Files ¶
- artifact.go
- auditlog.go
- base.go
- config.go
- gc.go
- handler.go
- health.go
- icon.go
- immutable.go
- jobservice.go
- label.go
- ldap.go
- member.go
- oidc.go
- permissions.go
- ping.go
- preheat.go
- project.go
- project_metadata.go
- purge.go
- quota.go
- registry.go
- replication.go
- repository.go
- retention.go
- robot.go
- robotV1.go
- scan.go
- scan_all.go
- scanexport.go
- scanner.go
- schedule.go
- search.go
- security.go
- statistic.go
- sys_cve_allowlist.go
- systeminfo.go
- user.go
- usergroup.go
- util.go
- webhook.go
- webhook_job.go