From 0bf977dd42622f5226521d506bfbeb5754577efb Mon Sep 17 00:00:00 2001 From: Eike David Lenz Date: Fri, 22 Dec 2023 14:47:28 +0100 Subject: [PATCH] bump v2 client apis to 2.9.1 --- Makefile | 2 +- README.md | 2 +- apiv1/client.go | 27 +- apiv1/project/project.go | 15 +- apiv1/registry/registry.go | 6 +- apiv1/replication/replication.go | 9 +- apiv1/system/system.go | 6 +- apiv1/user/user.go | 3 +- apiv2/client.go | 12 +- .../configure/get_configurations_responses.go | 2 +- apiv2/internal/api/client/harbor_client.go | 5 + .../purge/create_purge_schedule_parameters.go | 6 +- .../purge/update_purge_schedule_parameters.go | 6 +- .../get_security_summary_parameters.go | 224 ++++++++++++ .../get_security_summary_responses.go | 253 +++++++++++++ .../list_vulnerabilities_parameters.go | 336 ++++++++++++++++++ .../list_vulnerabilities_responses.go | 224 ++++++++++++ .../client/securityhub/securityhub_client.go | 124 +++++++ apiv2/mocks/securityhub_client_service.go | 81 +++++ apiv2/model/configurations.go | 3 + apiv2/model/configurations_response.go | 25 ++ apiv2/model/dangerous_artifact.go | 58 +++ apiv2/model/dangerous_cve.go | 58 +++ apiv2/model/general_info.go | 6 +- apiv2/model/scanner_registration.go | 20 +- apiv2/model/schedule_obj.go | 12 +- apiv2/model/security_summary.go | 142 ++++++++ apiv2/model/tag.go | 3 - apiv2/model/vulnerability_item.go | 76 ++++ apiv2/pkg/clients/gc/gc.go | 3 +- apiv2/pkg/clients/ping/ping_test.go | 1 + apiv2/pkg/clients/purge/purge.go | 5 + .../clients/purge/purge_integration_test.go | 2 + apiv2/pkg/clients/purge/purge_test.go | 4 +- apiv2/pkg/clients/repository/repository.go | 1 - apiv2/pkg/clients/retention/retention.go | 4 + .../retention/retention_integration_test.go | 2 +- apiv2/pkg/clients/scanall/scanall.go | 4 - apiv2/pkg/clients/scanall/scanall_test.go | 7 +- apiv2/pkg/clients/statistic/statistic_test.go | 4 +- .../systeminfo/systeminfo_integration_test.go | 1 - go.mod | 44 +-- go.sum | 213 +++-------- 43 files changed, 1800 insertions(+), 241 deletions(-) create mode 100644 apiv2/internal/api/client/securityhub/get_security_summary_parameters.go create mode 100644 apiv2/internal/api/client/securityhub/get_security_summary_responses.go create mode 100644 apiv2/internal/api/client/securityhub/list_vulnerabilities_parameters.go create mode 100644 apiv2/internal/api/client/securityhub/list_vulnerabilities_responses.go create mode 100644 apiv2/internal/api/client/securityhub/securityhub_client.go create mode 100644 apiv2/mocks/securityhub_client_service.go create mode 100644 apiv2/model/dangerous_artifact.go create mode 100644 apiv2/model/dangerous_cve.go create mode 100644 apiv2/model/security_summary.go create mode 100644 apiv2/model/vulnerability_item.go diff --git a/Makefile b/Makefile index 29a3a679..923c56f8 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ harbor-teardown test integration-test-v1-ci integration-test-v2-ci integration-t fmt gofmt gofumpt goimports lint uninstall-harbor-v2 uninstall-harbor-v1 V1_VERSION = v1.10.18 -V2_VERSION = v2.8.3 +V2_VERSION = v2.9.1 MOCKERY_VERSION = v2.14.0 GOSWAGGER_VERSION = v0.25.0 GOLANGCI_LINT_VERSION = v1.50.1 diff --git a/README.md b/README.md index 0ec50adc..df30f768 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A Go client library enabling programs to perform CRUD operations on the [goharbo This client library utilizes types generated by [go-swagger](https://github.com/go-swagger/go-swagger). ## Compatibility -This library includes separate clients supporting the **v1.10** & **v2.8** versions of goharbor. +This library includes separate clients supporting the **v1.10** & **v2.9** versions of goharbor. ## Installation Install the desired client library version using `go get`: diff --git a/apiv1/client.go b/apiv1/client.go index c1a1be5d..8ee3c6b7 100644 --- a/apiv1/client.go +++ b/apiv1/client.go @@ -93,7 +93,8 @@ func (c *RESTClient) UpdateUserPassword(ctx context.Context, id int64, password // NewProject wraps the NewProject method of the project sub-package. func (c *RESTClient) NewProject(ctx context.Context, name string, - countLimit int, storageLimit int) (*model.Project, error) { + countLimit int, storageLimit int, +) (*model.Project, error) { return c.project.NewProject(ctx, name, countLimit, storageLimit) } @@ -140,7 +141,8 @@ func (c *RESTClient) DeleteProjectMember(ctx context.Context, p *model.Project, // AddProjectMetadata wraps the AddProjectMetadata method of the project sub-package. func (c *RESTClient) AddProjectMetadata(ctx context.Context, - p *model.Project, key project.MetadataKey, value string) error { + p *model.Project, key project.MetadataKey, value string, +) error { return c.project.AddProjectMetadata(ctx, p, key, value) } @@ -151,13 +153,15 @@ func (c *RESTClient) ListProjectMetadata(ctx context.Context, p *model.Project) // UpdateProjectMetadata wraps the UpdateProjectMetadata method of the project sub-package. func (c *RESTClient) UpdateProjectMetadata(ctx context.Context, - p *model.Project, key project.MetadataKey, value string) error { + p *model.Project, key project.MetadataKey, value string, +) error { return c.project.UpdateProjectMetadata(ctx, p, key, value) } // DeleteProjectMetadataValue wraps the DeleteProjectMetadataValue method of the project sub-package. func (c *RESTClient) DeleteProjectMetadataValue(ctx context.Context, - p *model.Project, key project.MetadataKey) error { + p *model.Project, key project.MetadataKey, +) error { return c.project.DeleteProjectMetadataValue(ctx, p, key) } @@ -165,7 +169,8 @@ func (c *RESTClient) DeleteProjectMetadataValue(ctx context.Context, // NewRegistry wraps the NewRegistry method of the registry sub-package. func (c *RESTClient) NewRegistry(ctx context.Context, name, registryType, url string, - credential *model.RegistryCredential, insecure bool) (*model.Registry, error) { + credential *model.RegistryCredential, insecure bool, +) (*model.Registry, error) { return c.registry.NewRegistry(ctx, name, registryType, url, credential, insecure) } @@ -190,7 +195,8 @@ func (c *RESTClient) UpdateRegistry(ctx context.Context, r *model.Registry) erro // NewReplicationPolicy wraps the NewReplicationPolicy method of the replication sub-package. func (c *RESTClient) NewReplicationPolicy(ctx context.Context, destRegistry, srcRegistry *model.Registry, replicateDeletion, override, enablePolicy bool, filters []*model.ReplicationFilter, - trigger *model.ReplicationTrigger, destNamespace, description, name string) (*model.ReplicationPolicy, error) { + trigger *model.ReplicationTrigger, destNamespace, description, name string, +) (*model.ReplicationPolicy, error) { return c.replication.NewReplicationPolicy(ctx, destRegistry, srcRegistry, replicateDeletion, override, enablePolicy, filters, trigger, destNamespace, description, name) } @@ -222,7 +228,8 @@ func (c *RESTClient) TriggerReplicationExecution(ctx context.Context, r *model.R // GetReplicationExecutions wraps the GetReplicationExecutions method of the replication sub-package. func (c *RESTClient) GetReplicationExecutions(ctx context.Context, - r *model.ReplicationExecution) ([]*model.ReplicationExecution, error) { + r *model.ReplicationExecution, +) ([]*model.ReplicationExecution, error) { return c.replication.GetReplicationExecutions(ctx, r) } @@ -235,13 +242,15 @@ func (c *RESTClient) GetReplicationExecutionByID(ctx context.Context, id int64) // NewSystemGarbageCollection wraps the NewSystemGarbageCollection method of the system sub-package. func (c *RESTClient) NewSystemGarbageCollection(ctx context.Context, - cron, scheduleType string) (*model.AdminJobSchedule, error) { + cron, scheduleType string, +) (*model.AdminJobSchedule, error) { return c.system.NewSystemGarbageCollection(ctx, cron, scheduleType) } // UpdateSystemGarbageCollection wraps the UpdateSystemGarbageCollection method of the system sub-package. func (c *RESTClient) UpdateSystemGarbageCollection(ctx context.Context, - newGcSchedule *model.AdminJobScheduleObj) error { + newGcSchedule *model.AdminJobScheduleObj, +) error { return c.system.UpdateSystemGarbageCollection(ctx, newGcSchedule) } diff --git a/apiv1/project/project.go b/apiv1/project/project.go index f671f5b0..8db31925 100644 --- a/apiv1/project/project.go +++ b/apiv1/project/project.go @@ -63,7 +63,8 @@ type Client interface { // CountLimit limits the number of repositories for this project. // StorageLimit limits the allocatable space for this project. func (c *RESTClient) NewProject(ctx context.Context, name string, - countLimit int, storageLimit int) (*model.Project, error) { + countLimit int, storageLimit int, +) (*model.Project, error) { pReq := &model.ProjectReq{ CveWhitelist: nil, Metadata: nil, @@ -93,7 +94,8 @@ func (c *RESTClient) NewProject(ctx context.Context, name string, // Returns an error when no matching project is found or when // having difficulties talking to the API. func (c *RESTClient) DeleteProject(ctx context.Context, - p *model.Project) error { + p *model.Project, +) error { if p == nil { return &ErrProjectNotProvided{} } @@ -119,7 +121,8 @@ func (c *RESTClient) DeleteProject(ctx context.Context, // Returns an error if it cannot find a matching project or when // having difficulties talking to the API. func (c *RESTClient) GetProject(ctx context.Context, - name string) (*model.Project, error) { + name string, +) (*model.Project, error) { if name == "" { return nil, &ErrProjectNameNotProvided{} } @@ -145,7 +148,8 @@ func (c *RESTClient) GetProject(ctx context.Context, // Returns all projects if name is an empty string. // Returns an error if no projects were found. func (c *RESTClient) ListProjects(ctx context.Context, - nameFilter string) ([]*model.Project, error) { + nameFilter string, +) ([]*model.Project, error) { resp, err := c.Client.Products.GetProjects( &products.GetProjectsParams{ Name: &nameFilter, @@ -165,7 +169,8 @@ func (c *RESTClient) ListProjects(ctx context.Context, // UpdateProject updates a project with the specified data. // Returns an error if name/ID pair of p does not match a stored project. func (c *RESTClient) UpdateProject(ctx context.Context, p *model.Project, - countLimit int, storageLimit int) error { + countLimit int, storageLimit int, +) error { project, err := c.GetProject(ctx, p.Name) if err != nil { return err diff --git a/apiv1/registry/registry.go b/apiv1/registry/registry.go index 8808be4d..3ab6e781 100644 --- a/apiv1/registry/registry.go +++ b/apiv1/registry/registry.go @@ -39,7 +39,8 @@ type Client interface { // Returns the registry as it is stored inside Harbor or an error, // if it cannot be created. func (c *RESTClient) NewRegistry(ctx context.Context, name, registryType, url string, - credential *model.RegistryCredential, insecure bool) (*model.Registry, error) { + credential *model.RegistryCredential, insecure bool, +) (*model.Registry, error) { rReq := &model.Registry{ Credential: credential, Insecure: insecure, @@ -94,7 +95,8 @@ func (c *RESTClient) GetRegistry(ctx context.Context, name string) (*model.Regis // Returns an error when no matching registry is found or when // having difficulties talking to the API. func (c *RESTClient) DeleteRegistry(ctx context.Context, - r *model.Registry) error { + r *model.Registry, +) error { if r == nil { return &ErrRegistryNotProvided{} } diff --git a/apiv1/replication/replication.go b/apiv1/replication/replication.go index 6a6ca4fc..636eb447 100644 --- a/apiv1/replication/replication.go +++ b/apiv1/replication/replication.go @@ -45,7 +45,8 @@ type Client interface { func (c *RESTClient) NewReplicationPolicy(ctx context.Context, destRegistry, srcRegistry *model.Registry, replicateDeletion, override, enablePolicy bool, filters []*model.ReplicationFilter, trigger *model.ReplicationTrigger, - destNamespace, description, name string) (*model.ReplicationPolicy, error) { + destNamespace, description, name string, +) (*model.ReplicationPolicy, error) { pReq := &model.ReplicationPolicy{ Deletion: replicateDeletion, Description: description, @@ -125,7 +126,8 @@ func (c *RESTClient) GetReplicationPolicyByID(ctx context.Context, id int64) (*m // Returns an error when no matching replication is found or when // having difficulties talking to the API. func (c *RESTClient) DeleteReplicationPolicy(ctx context.Context, - r *model.ReplicationPolicy) error { + r *model.ReplicationPolicy, +) error { if r == nil { return &ErrReplicationNotProvided{} } @@ -150,7 +152,8 @@ func (c *RESTClient) DeleteReplicationPolicy(ctx context.Context, // Update updates a replication. func (c *RESTClient) UpdateReplicationPolicy(ctx context.Context, - r *model.ReplicationPolicy) error { + r *model.ReplicationPolicy, +) error { if r == nil { return &ErrReplicationNotProvided{} } diff --git a/apiv1/system/system.go b/apiv1/system/system.go index 1f43934e..1aed5f5a 100644 --- a/apiv1/system/system.go +++ b/apiv1/system/system.go @@ -35,7 +35,8 @@ type Client interface { // NewSystemGarbageCollection creates a new garbage collection schedule. func (c *RESTClient) NewSystemGarbageCollection(ctx context.Context, cron, - scheduleType string) (*model.AdminJobSchedule, error) { + scheduleType string, +) (*model.AdminJobSchedule, error) { gcReq := &model.AdminJobSchedule{ Schedule: &model.AdminJobScheduleObj{ Cron: cron, @@ -64,7 +65,8 @@ func (c *RESTClient) NewSystemGarbageCollection(ctx context.Context, cron, // UpdateSystemGarbageCollection updates the system GC schedule. func (c *RESTClient) UpdateSystemGarbageCollection(ctx context.Context, - newGcSchedule *model.AdminJobScheduleObj) error { + newGcSchedule *model.AdminJobScheduleObj, +) error { if newGcSchedule == nil { return &ErrSystemGcScheduleNotProvided{} } diff --git a/apiv1/user/user.go b/apiv1/user/user.go index b75337f1..5dc66be6 100644 --- a/apiv1/user/user.go +++ b/apiv1/user/user.go @@ -43,7 +43,8 @@ type Client interface { // password is the password for this user. // comments as a comment attached to the user. func (c *RESTClient) NewUser(ctx context.Context, username, email, realname, password, - comments string) (*model.User, error) { + comments string, +) (*model.User, error) { uReq := &model.User{ Username: username, Password: password, diff --git a/apiv2/client.go b/apiv2/client.go index 7712858c..e7aab998 100644 --- a/apiv2/client.go +++ b/apiv2/client.go @@ -374,24 +374,31 @@ func (c *RESTClient) DeleteProjectMetadataValue(ctx context.Context, projectName func (c *RESTClient) CreatePurgeSchedule(ctx context.Context, schedule *modelv2.Schedule) error { return c.purge.CreatePurgeSchedule(ctx, schedule) } + func (c *RESTClient) RunPurge(ctx context.Context, dryRun bool) error { return c.purge.RunPurge(ctx, dryRun) } + func (c *RESTClient) ListPurgeHistory(ctx context.Context) ([]*modelv2.ExecHistory, error) { return c.purge.ListPurgeHistory(ctx) } + func (c *RESTClient) GetPurgeJob(ctx context.Context, id int64) (*modelv2.ExecHistory, error) { return c.purge.GetPurgeJob(ctx, id) } + func (c *RESTClient) GetPurgeJobLog(ctx context.Context, id int64) (string, error) { return c.purge.GetPurgeJobLog(ctx, id) } + func (c *RESTClient) GetPurgeSchedule(ctx context.Context) (*modelv2.ExecHistory, error) { return c.purge.GetPurgeSchedule(ctx) } + func (c *RESTClient) StopPurge(ctx context.Context, id int64) error { return c.purge.StopPurge(ctx, id) } + func (c *RESTClient) UpdatePurgeSchedule(ctx context.Context, schedule *modelv2.Schedule) error { return c.purge.UpdatePurgeSchedule(ctx, schedule) } @@ -441,7 +448,8 @@ func (c *RESTClient) UpdateRegistry(ctx context.Context, u *modelv2.RegistryUpda func (c *RESTClient) NewReplicationPolicy(ctx context.Context, destRegistry, srcRegistry *modelv2.Registry, replicateDeletion, override, enablePolicy bool, filters []*modelv2.ReplicationFilter, trigger *modelv2.ReplicationTrigger, - destNamespace, description, name string) error { + destNamespace, description, name string, +) error { return c.replication.NewReplicationPolicy(ctx, destRegistry, srcRegistry, replicateDeletion, override, enablePolicy, filters, trigger, destNamespace, description, name) @@ -590,9 +598,11 @@ func (c *RESTClient) GetStatistic(ctx context.Context) (*modelv2.Statistic, erro func (c *RESTClient) CreateScanAllSchedule(ctx context.Context, schedule *modelv2.Schedule) error { return c.scanall.CreateScanAllSchedule(ctx, schedule) } + func (c *RESTClient) GetScanAllSchedule(ctx context.Context) (*modelv2.Schedule, error) { return c.scanall.GetScanAllSchedule(ctx) } + func (c *RESTClient) UpdateScanAllSchedule(ctx context.Context, schedule *modelv2.Schedule) error { return c.scanall.UpdateScanAllSchedule(ctx, schedule) } diff --git a/apiv2/internal/api/client/configure/get_configurations_responses.go b/apiv2/internal/api/client/configure/get_configurations_responses.go index 47f26f02..9bacc3ab 100644 --- a/apiv2/internal/api/client/configure/get_configurations_responses.go +++ b/apiv2/internal/api/client/configure/get_configurations_responses.go @@ -93,7 +93,7 @@ func NewGetConfigurationsUnauthorized() *GetConfigurationsUnauthorized { /*GetConfigurationsUnauthorized handles this case with default header values. -User need to log in first.ß +User need to log in first. */ type GetConfigurationsUnauthorized struct { } diff --git a/apiv2/internal/api/client/harbor_client.go b/apiv2/internal/api/client/harbor_client.go index eb8beab6..bc11f759 100644 --- a/apiv2/internal/api/client/harbor_client.go +++ b/apiv2/internal/api/client/harbor_client.go @@ -40,6 +40,7 @@ import ( "github.com/mittwald/goharbor-client/v5/apiv2/internal/api/client/scanner" "github.com/mittwald/goharbor-client/v5/apiv2/internal/api/client/schedule" "github.com/mittwald/goharbor-client/v5/apiv2/internal/api/client/search" + "github.com/mittwald/goharbor-client/v5/apiv2/internal/api/client/securityhub" "github.com/mittwald/goharbor-client/v5/apiv2/internal/api/client/statistic" "github.com/mittwald/goharbor-client/v5/apiv2/internal/api/client/system_cve_allowlist" "github.com/mittwald/goharbor-client/v5/apiv2/internal/api/client/systeminfo" @@ -121,6 +122,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Harbor { cli.Scanner = scanner.New(transport, formats) cli.Schedule = schedule.New(transport, formats) cli.Search = search.New(transport, formats) + cli.Securityhub = securityhub.New(transport, formats) cli.Statistic = statistic.New(transport, formats) cli.SystemCVEAllowlist = system_cve_allowlist.New(transport, formats) cli.Systeminfo = systeminfo.New(transport, formats) @@ -232,6 +234,8 @@ type Harbor struct { Search search.ClientService + Securityhub securityhub.ClientService + Statistic statistic.ClientService SystemCVEAllowlist system_cve_allowlist.ClientService @@ -282,6 +286,7 @@ func (c *Harbor) SetTransport(transport runtime.ClientTransport) { c.Scanner.SetTransport(transport) c.Schedule.SetTransport(transport) c.Search.SetTransport(transport) + c.Securityhub.SetTransport(transport) c.Statistic.SetTransport(transport) c.SystemCVEAllowlist.SetTransport(transport) c.Systeminfo.SetTransport(transport) diff --git a/apiv2/internal/api/client/purge/create_purge_schedule_parameters.go b/apiv2/internal/api/client/purge/create_purge_schedule_parameters.go index 06519b39..2cc953a9 100644 --- a/apiv2/internal/api/client/purge/create_purge_schedule_parameters.go +++ b/apiv2/internal/api/client/purge/create_purge_schedule_parameters.go @@ -68,9 +68,9 @@ type CreatePurgeScheduleParams struct { */ XRequestID *string /*Schedule - The purge job's schedule, it is a json object. | - The sample format is | - {"parameters":{"audit_retention_hour":168,"dry_run":true, "include_operations":"create,delete,pull"},"schedule":{"type":"Hourly","cron":"0 0 * * * *"}} | + The purge job's schedule, it is a json object. | + The sample format is | + {"parameters":{"audit_retention_hour":168,"dry_run":true, "include_operations":"create,delete,pull"},"schedule":{"type":"Hourly","cron":"0 0 * * * *"}} | the include_operation should be a comma separated string, e.g. create,delete,pull, if it is empty, no operation will be purged. diff --git a/apiv2/internal/api/client/purge/update_purge_schedule_parameters.go b/apiv2/internal/api/client/purge/update_purge_schedule_parameters.go index e82fd471..b672d10e 100644 --- a/apiv2/internal/api/client/purge/update_purge_schedule_parameters.go +++ b/apiv2/internal/api/client/purge/update_purge_schedule_parameters.go @@ -68,9 +68,9 @@ type UpdatePurgeScheduleParams struct { */ XRequestID *string /*Schedule - The purge job's schedule, it is a json object. | - The sample format is | - {"parameters":{"audit_retention_hour":168,"dry_run":true, "include_operations":"create,delete,pull"},"schedule":{"type":"Hourly","cron":"0 0 * * * *"}} | + The purge job's schedule, it is a json object. | + The sample format is | + {"parameters":{"audit_retention_hour":168,"dry_run":true, "include_operations":"create,delete,pull"},"schedule":{"type":"Hourly","cron":"0 0 * * * *"}} | the include_operation should be a comma separated string, e.g. create,delete,pull, if it is empty, no operation will be purged. diff --git a/apiv2/internal/api/client/securityhub/get_security_summary_parameters.go b/apiv2/internal/api/client/securityhub/get_security_summary_parameters.go new file mode 100644 index 00000000..f531f6cc --- /dev/null +++ b/apiv2/internal/api/client/securityhub/get_security_summary_parameters.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package securityhub + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetSecuritySummaryParams creates a new GetSecuritySummaryParams object +// with the default values initialized. +func NewGetSecuritySummaryParams() *GetSecuritySummaryParams { + var ( + withDangerousArtifactDefault = bool(false) + withDangerousCVEDefault = bool(false) + ) + return &GetSecuritySummaryParams{ + WithDangerousArtifact: &withDangerousArtifactDefault, + WithDangerousCVE: &withDangerousCVEDefault, + + timeout: cr.DefaultTimeout, + } +} + +// NewGetSecuritySummaryParamsWithTimeout creates a new GetSecuritySummaryParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetSecuritySummaryParamsWithTimeout(timeout time.Duration) *GetSecuritySummaryParams { + var ( + withDangerousArtifactDefault = bool(false) + withDangerousCVEDefault = bool(false) + ) + return &GetSecuritySummaryParams{ + WithDangerousArtifact: &withDangerousArtifactDefault, + WithDangerousCVE: &withDangerousCVEDefault, + + timeout: timeout, + } +} + +// NewGetSecuritySummaryParamsWithContext creates a new GetSecuritySummaryParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetSecuritySummaryParamsWithContext(ctx context.Context) *GetSecuritySummaryParams { + var ( + withDangerousArtifactDefault = bool(false) + withDangerousCveDefault = bool(false) + ) + return &GetSecuritySummaryParams{ + WithDangerousArtifact: &withDangerousArtifactDefault, + WithDangerousCVE: &withDangerousCveDefault, + + Context: ctx, + } +} + +// NewGetSecuritySummaryParamsWithHTTPClient creates a new GetSecuritySummaryParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetSecuritySummaryParamsWithHTTPClient(client *http.Client) *GetSecuritySummaryParams { + var ( + withDangerousArtifactDefault = bool(false) + withDangerousCveDefault = bool(false) + ) + return &GetSecuritySummaryParams{ + WithDangerousArtifact: &withDangerousArtifactDefault, + WithDangerousCVE: &withDangerousCveDefault, + HTTPClient: client, + } +} + +/*GetSecuritySummaryParams contains all the parameters to send to the API endpoint +for the get security summary operation typically these are written to a http.Request +*/ +type GetSecuritySummaryParams struct { + + /*XRequestID + An unique ID for the request + + */ + XRequestID *string + /*WithDangerousArtifact + Specify whether the dangerous Artifact are included inside summary information + + */ + WithDangerousArtifact *bool + /*WithDangerousCVE + Specify whether the dangerous CVEs are included inside summary information + + */ + WithDangerousCVE *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get security summary params +func (o *GetSecuritySummaryParams) WithTimeout(timeout time.Duration) *GetSecuritySummaryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get security summary params +func (o *GetSecuritySummaryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get security summary params +func (o *GetSecuritySummaryParams) WithContext(ctx context.Context) *GetSecuritySummaryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get security summary params +func (o *GetSecuritySummaryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get security summary params +func (o *GetSecuritySummaryParams) WithHTTPClient(client *http.Client) *GetSecuritySummaryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get security summary params +func (o *GetSecuritySummaryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithXRequestID adds the xRequestID to the get security summary params +func (o *GetSecuritySummaryParams) WithXRequestID(xRequestID *string) *GetSecuritySummaryParams { + o.SetXRequestID(xRequestID) + return o +} + +// SetXRequestID adds the xRequestId to the get security summary params +func (o *GetSecuritySummaryParams) SetXRequestID(xRequestID *string) { + o.XRequestID = xRequestID +} + +// WithWithDangerousArtifact adds the withDangerousArtifact to the get security summary params +func (o *GetSecuritySummaryParams) WithWithDangerousArtifact(withDangerousArtifact *bool) *GetSecuritySummaryParams { + o.SetWithDangerousArtifact(withDangerousArtifact) + return o +} + +// SetWithDangerousArtifact adds the withDangerousArtifact to the get security summary params +func (o *GetSecuritySummaryParams) SetWithDangerousArtifact(withDangerousArtifact *bool) { + o.WithDangerousArtifact = withDangerousArtifact +} + +// WithWithDangerousCVE adds the withDangerousCVE to the get security summary params +func (o *GetSecuritySummaryParams) WithWithDangerousCVE(withDangerousCVE *bool) *GetSecuritySummaryParams { + o.SetWithDangerousCVE(withDangerousCVE) + return o +} + +// SetWithDangerousCVE adds the withDangerousCve to the get security summary params +func (o *GetSecuritySummaryParams) SetWithDangerousCVE(withDangerousCVE *bool) { + o.WithDangerousCVE = withDangerousCVE +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSecuritySummaryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.XRequestID != nil { + + // header param X-Request-Id + if err := r.SetHeaderParam("X-Request-Id", *o.XRequestID); err != nil { + return err + } + + } + + if o.WithDangerousArtifact != nil { + + // query param with_dangerous_artifact + var qrWithDangerousArtifact bool + if o.WithDangerousArtifact != nil { + qrWithDangerousArtifact = *o.WithDangerousArtifact + } + qWithDangerousArtifact := swag.FormatBool(qrWithDangerousArtifact) + if qWithDangerousArtifact != "" { + if err := r.SetQueryParam("with_dangerous_artifact", qWithDangerousArtifact); err != nil { + return err + } + } + + } + + if o.WithDangerousCVE != nil { + + // query param with_dangerous_cve + var qrWithDangerousCVE bool + if o.WithDangerousCVE != nil { + qrWithDangerousCVE = *o.WithDangerousCVE + } + qWithDangerousCVE := swag.FormatBool(qrWithDangerousCVE) + if qWithDangerousCVE != "" { + if err := r.SetQueryParam("with_dangerous_cve", qWithDangerousCVE); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/apiv2/internal/api/client/securityhub/get_security_summary_responses.go b/apiv2/internal/api/client/securityhub/get_security_summary_responses.go new file mode 100644 index 00000000..9fa7cab1 --- /dev/null +++ b/apiv2/internal/api/client/securityhub/get_security_summary_responses.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package securityhub + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/mittwald/goharbor-client/v5/apiv2/model" +) + +// GetSecuritySummaryReader is a Reader for the GetSecuritySummary structure. +type GetSecuritySummaryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSecuritySummaryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSecuritySummaryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetSecuritySummaryUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetSecuritySummaryForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetSecuritySummaryNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetSecuritySummaryInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetSecuritySummaryOK creates a GetSecuritySummaryOK with default headers values +func NewGetSecuritySummaryOK() *GetSecuritySummaryOK { + return &GetSecuritySummaryOK{} +} + +/*GetSecuritySummaryOK handles this case with default header values. + +Success +*/ +type GetSecuritySummaryOK struct { + Payload *model.SecuritySummary +} + +func (o *GetSecuritySummaryOK) Error() string { + return fmt.Sprintf("[GET /security/summary][%d] getSecuritySummaryOK %+v", 200, o.Payload) +} + +func (o *GetSecuritySummaryOK) GetPayload() *model.SecuritySummary { + return o.Payload +} + +func (o *GetSecuritySummaryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(model.SecuritySummary) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSecuritySummaryUnauthorized creates a GetSecuritySummaryUnauthorized with default headers values +func NewGetSecuritySummaryUnauthorized() *GetSecuritySummaryUnauthorized { + return &GetSecuritySummaryUnauthorized{} +} + +/*GetSecuritySummaryUnauthorized handles this case with default header values. + +Unauthorized +*/ +type GetSecuritySummaryUnauthorized struct { + /*The ID of the corresponding request for the response + */ + XRequestID string + + Payload *model.Errors +} + +func (o *GetSecuritySummaryUnauthorized) Error() string { + return fmt.Sprintf("[GET /security/summary][%d] getSecuritySummaryUnauthorized %+v", 401, o.Payload) +} + +func (o *GetSecuritySummaryUnauthorized) GetPayload() *model.Errors { + return o.Payload +} + +func (o *GetSecuritySummaryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header X-Request-Id + o.XRequestID = response.GetHeader("X-Request-Id") + + o.Payload = new(model.Errors) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSecuritySummaryForbidden creates a GetSecuritySummaryForbidden with default headers values +func NewGetSecuritySummaryForbidden() *GetSecuritySummaryForbidden { + return &GetSecuritySummaryForbidden{} +} + +/*GetSecuritySummaryForbidden handles this case with default header values. + +Forbidden +*/ +type GetSecuritySummaryForbidden struct { + /*The ID of the corresponding request for the response + */ + XRequestID string + + Payload *model.Errors +} + +func (o *GetSecuritySummaryForbidden) Error() string { + return fmt.Sprintf("[GET /security/summary][%d] getSecuritySummaryForbidden %+v", 403, o.Payload) +} + +func (o *GetSecuritySummaryForbidden) GetPayload() *model.Errors { + return o.Payload +} + +func (o *GetSecuritySummaryForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header X-Request-Id + o.XRequestID = response.GetHeader("X-Request-Id") + + o.Payload = new(model.Errors) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSecuritySummaryNotFound creates a GetSecuritySummaryNotFound with default headers values +func NewGetSecuritySummaryNotFound() *GetSecuritySummaryNotFound { + return &GetSecuritySummaryNotFound{} +} + +/*GetSecuritySummaryNotFound handles this case with default header values. + +Not found +*/ +type GetSecuritySummaryNotFound struct { + /*The ID of the corresponding request for the response + */ + XRequestID string + + Payload *model.Errors +} + +func (o *GetSecuritySummaryNotFound) Error() string { + return fmt.Sprintf("[GET /security/summary][%d] getSecuritySummaryNotFound %+v", 404, o.Payload) +} + +func (o *GetSecuritySummaryNotFound) GetPayload() *model.Errors { + return o.Payload +} + +func (o *GetSecuritySummaryNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header X-Request-Id + o.XRequestID = response.GetHeader("X-Request-Id") + + o.Payload = new(model.Errors) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetSecuritySummaryInternalServerError creates a GetSecuritySummaryInternalServerError with default headers values +func NewGetSecuritySummaryInternalServerError() *GetSecuritySummaryInternalServerError { + return &GetSecuritySummaryInternalServerError{} +} + +/*GetSecuritySummaryInternalServerError handles this case with default header values. + +Internal server error +*/ +type GetSecuritySummaryInternalServerError struct { + /*The ID of the corresponding request for the response + */ + XRequestID string + + Payload *model.Errors +} + +func (o *GetSecuritySummaryInternalServerError) Error() string { + return fmt.Sprintf("[GET /security/summary][%d] getSecuritySummaryInternalServerError %+v", 500, o.Payload) +} + +func (o *GetSecuritySummaryInternalServerError) GetPayload() *model.Errors { + return o.Payload +} + +func (o *GetSecuritySummaryInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header X-Request-Id + o.XRequestID = response.GetHeader("X-Request-Id") + + o.Payload = new(model.Errors) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/apiv2/internal/api/client/securityhub/list_vulnerabilities_parameters.go b/apiv2/internal/api/client/securityhub/list_vulnerabilities_parameters.go new file mode 100644 index 00000000..54db0fa9 --- /dev/null +++ b/apiv2/internal/api/client/securityhub/list_vulnerabilities_parameters.go @@ -0,0 +1,336 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package securityhub + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListVulnerabilitiesParams creates a new ListVulnerabilitiesParams object +// with the default values initialized. +func NewListVulnerabilitiesParams() *ListVulnerabilitiesParams { + var ( + pageDefault = int64(1) + pageSizeDefault = int64(10) + tuneCountDefault = bool(false) + withTagDefault = bool(false) + ) + return &ListVulnerabilitiesParams{ + Page: &pageDefault, + PageSize: &pageSizeDefault, + TuneCount: &tuneCountDefault, + WithTag: &withTagDefault, + + timeout: cr.DefaultTimeout, + } +} + +// NewListVulnerabilitiesParamsWithTimeout creates a new ListVulnerabilitiesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListVulnerabilitiesParamsWithTimeout(timeout time.Duration) *ListVulnerabilitiesParams { + var ( + pageDefault = int64(1) + pageSizeDefault = int64(10) + tuneCountDefault = bool(false) + withTagDefault = bool(false) + ) + return &ListVulnerabilitiesParams{ + Page: &pageDefault, + PageSize: &pageSizeDefault, + TuneCount: &tuneCountDefault, + WithTag: &withTagDefault, + + timeout: timeout, + } +} + +// NewListVulnerabilitiesParamsWithContext creates a new ListVulnerabilitiesParams object +// with the default values initialized, and the ability to set a context for a request +func NewListVulnerabilitiesParamsWithContext(ctx context.Context) *ListVulnerabilitiesParams { + var ( + pageDefault = int64(1) + pageSizeDefault = int64(10) + tuneCountDefault = bool(false) + withTagDefault = bool(false) + ) + return &ListVulnerabilitiesParams{ + Page: &pageDefault, + PageSize: &pageSizeDefault, + TuneCount: &tuneCountDefault, + WithTag: &withTagDefault, + + Context: ctx, + } +} + +// NewListVulnerabilitiesParamsWithHTTPClient creates a new ListVulnerabilitiesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListVulnerabilitiesParamsWithHTTPClient(client *http.Client) *ListVulnerabilitiesParams { + var ( + pageDefault = int64(1) + pageSizeDefault = int64(10) + tuneCountDefault = bool(false) + withTagDefault = bool(false) + ) + return &ListVulnerabilitiesParams{ + Page: &pageDefault, + PageSize: &pageSizeDefault, + TuneCount: &tuneCountDefault, + WithTag: &withTagDefault, + HTTPClient: client, + } +} + +/*ListVulnerabilitiesParams contains all the parameters to send to the API endpoint +for the list vulnerabilities operation typically these are written to a http.Request +*/ +type ListVulnerabilitiesParams struct { + + /*XRequestID + An unique ID for the request + + */ + XRequestID *string + /*Page + The page number + + */ + Page *int64 + /*PageSize + The size of per page + + */ + PageSize *int64 + /*Q + Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3=[min~max] + + */ + Q *string + /*TuneCount + Enable to ignore X-Total-Count when the total count > 1000, if the total count is less than 1000, the real total count is returned, else -1. + + */ + TuneCount *bool + /*WithTag + Specify whether the tag information is included inside vulnerability information + + */ + WithTag *bool + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) WithTimeout(timeout time.Duration) *ListVulnerabilitiesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) WithContext(ctx context.Context) *ListVulnerabilitiesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) WithHTTPClient(client *http.Client) *ListVulnerabilitiesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithXRequestID adds the xRequestID to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) WithXRequestID(xRequestID *string) *ListVulnerabilitiesParams { + o.SetXRequestID(xRequestID) + return o +} + +// SetXRequestID adds the xRequestId to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) SetXRequestID(xRequestID *string) { + o.XRequestID = xRequestID +} + +// WithPage adds the page to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) WithPage(page *int64) *ListVulnerabilitiesParams { + o.SetPage(page) + return o +} + +// SetPage adds the page to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) SetPage(page *int64) { + o.Page = page +} + +// WithPageSize adds the pageSize to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) WithPageSize(pageSize *int64) *ListVulnerabilitiesParams { + o.SetPageSize(pageSize) + return o +} + +// SetPageSize adds the pageSize to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) SetPageSize(pageSize *int64) { + o.PageSize = pageSize +} + +// WithQ adds the q to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) WithQ(q *string) *ListVulnerabilitiesParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) SetQ(q *string) { + o.Q = q +} + +// WithTuneCount adds the tuneCount to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) WithTuneCount(tuneCount *bool) *ListVulnerabilitiesParams { + o.SetTuneCount(tuneCount) + return o +} + +// SetTuneCount adds the tuneCount to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) SetTuneCount(tuneCount *bool) { + o.TuneCount = tuneCount +} + +// WithWithTag adds the withTag to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) WithWithTag(withTag *bool) *ListVulnerabilitiesParams { + o.SetWithTag(withTag) + return o +} + +// SetWithTag adds the withTag to the list vulnerabilities params +func (o *ListVulnerabilitiesParams) SetWithTag(withTag *bool) { + o.WithTag = withTag +} + +// WriteToRequest writes these params to a swagger request +func (o *ListVulnerabilitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.XRequestID != nil { + + // header param X-Request-Id + if err := r.SetHeaderParam("X-Request-Id", *o.XRequestID); err != nil { + return err + } + + } + + if o.Page != nil { + + // query param page + var qrPage int64 + if o.Page != nil { + qrPage = *o.Page + } + qPage := swag.FormatInt64(qrPage) + if qPage != "" { + if err := r.SetQueryParam("page", qPage); err != nil { + return err + } + } + + } + + if o.PageSize != nil { + + // query param page_size + var qrPageSize int64 + if o.PageSize != nil { + qrPageSize = *o.PageSize + } + qPageSize := swag.FormatInt64(qrPageSize) + if qPageSize != "" { + if err := r.SetQueryParam("page_size", qPageSize); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.TuneCount != nil { + + // query param tune_count + var qrTuneCount bool + if o.TuneCount != nil { + qrTuneCount = *o.TuneCount + } + qTuneCount := swag.FormatBool(qrTuneCount) + if qTuneCount != "" { + if err := r.SetQueryParam("tune_count", qTuneCount); err != nil { + return err + } + } + + } + + if o.WithTag != nil { + + // query param with_tag + var qrWithTag bool + if o.WithTag != nil { + qrWithTag = *o.WithTag + } + qWithTag := swag.FormatBool(qrWithTag) + if qWithTag != "" { + if err := r.SetQueryParam("with_tag", qWithTag); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/apiv2/internal/api/client/securityhub/list_vulnerabilities_responses.go b/apiv2/internal/api/client/securityhub/list_vulnerabilities_responses.go new file mode 100644 index 00000000..0218d0ed --- /dev/null +++ b/apiv2/internal/api/client/securityhub/list_vulnerabilities_responses.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package securityhub + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/mittwald/goharbor-client/v5/apiv2/model" +) + +// ListVulnerabilitiesReader is a Reader for the ListVulnerabilities structure. +type ListVulnerabilitiesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListVulnerabilitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListVulnerabilitiesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewListVulnerabilitiesBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewListVulnerabilitiesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewListVulnerabilitiesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewListVulnerabilitiesOK creates a ListVulnerabilitiesOK with default headers values +func NewListVulnerabilitiesOK() *ListVulnerabilitiesOK { + return &ListVulnerabilitiesOK{} +} + +/*ListVulnerabilitiesOK handles this case with default header values. + +The vulnerability list. +*/ +type ListVulnerabilitiesOK struct { + /*Link refers to the previous page and next page + */ + Link string + /*The total count of vulnerabilities + */ + XTotalCount int64 + + Payload []*model.VulnerabilityItem +} + +func (o *ListVulnerabilitiesOK) Error() string { + return fmt.Sprintf("[GET /security/vul][%d] listVulnerabilitiesOK %+v", 200, o.Payload) +} + +func (o *ListVulnerabilitiesOK) GetPayload() []*model.VulnerabilityItem { + return o.Payload +} + +func (o *ListVulnerabilitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header Link + o.Link = response.GetHeader("Link") + + // response header X-Total-Count + xTotalCount, err := swag.ConvertInt64(response.GetHeader("X-Total-Count")) + if err != nil { + return errors.InvalidType("X-Total-Count", "header", "int64", response.GetHeader("X-Total-Count")) + } + o.XTotalCount = xTotalCount + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListVulnerabilitiesBadRequest creates a ListVulnerabilitiesBadRequest with default headers values +func NewListVulnerabilitiesBadRequest() *ListVulnerabilitiesBadRequest { + return &ListVulnerabilitiesBadRequest{} +} + +/*ListVulnerabilitiesBadRequest handles this case with default header values. + +Bad request +*/ +type ListVulnerabilitiesBadRequest struct { + /*The ID of the corresponding request for the response + */ + XRequestID string + + Payload *model.Errors +} + +func (o *ListVulnerabilitiesBadRequest) Error() string { + return fmt.Sprintf("[GET /security/vul][%d] listVulnerabilitiesBadRequest %+v", 400, o.Payload) +} + +func (o *ListVulnerabilitiesBadRequest) GetPayload() *model.Errors { + return o.Payload +} + +func (o *ListVulnerabilitiesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header X-Request-Id + o.XRequestID = response.GetHeader("X-Request-Id") + + o.Payload = new(model.Errors) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListVulnerabilitiesUnauthorized creates a ListVulnerabilitiesUnauthorized with default headers values +func NewListVulnerabilitiesUnauthorized() *ListVulnerabilitiesUnauthorized { + return &ListVulnerabilitiesUnauthorized{} +} + +/*ListVulnerabilitiesUnauthorized handles this case with default header values. + +Unauthorized +*/ +type ListVulnerabilitiesUnauthorized struct { + /*The ID of the corresponding request for the response + */ + XRequestID string + + Payload *model.Errors +} + +func (o *ListVulnerabilitiesUnauthorized) Error() string { + return fmt.Sprintf("[GET /security/vul][%d] listVulnerabilitiesUnauthorized %+v", 401, o.Payload) +} + +func (o *ListVulnerabilitiesUnauthorized) GetPayload() *model.Errors { + return o.Payload +} + +func (o *ListVulnerabilitiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header X-Request-Id + o.XRequestID = response.GetHeader("X-Request-Id") + + o.Payload = new(model.Errors) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListVulnerabilitiesInternalServerError creates a ListVulnerabilitiesInternalServerError with default headers values +func NewListVulnerabilitiesInternalServerError() *ListVulnerabilitiesInternalServerError { + return &ListVulnerabilitiesInternalServerError{} +} + +/*ListVulnerabilitiesInternalServerError handles this case with default header values. + +Internal server error +*/ +type ListVulnerabilitiesInternalServerError struct { + /*The ID of the corresponding request for the response + */ + XRequestID string + + Payload *model.Errors +} + +func (o *ListVulnerabilitiesInternalServerError) Error() string { + return fmt.Sprintf("[GET /security/vul][%d] listVulnerabilitiesInternalServerError %+v", 500, o.Payload) +} + +func (o *ListVulnerabilitiesInternalServerError) GetPayload() *model.Errors { + return o.Payload +} + +func (o *ListVulnerabilitiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response header X-Request-Id + o.XRequestID = response.GetHeader("X-Request-Id") + + o.Payload = new(model.Errors) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/apiv2/internal/api/client/securityhub/securityhub_client.go b/apiv2/internal/api/client/securityhub/securityhub_client.go new file mode 100644 index 00000000..1e38b7f1 --- /dev/null +++ b/apiv2/internal/api/client/securityhub/securityhub_client.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package securityhub + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new securityhub API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for securityhub API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientService is the interface for Client methods +type ClientService interface { + ListVulnerabilities(params *ListVulnerabilitiesParams, authInfo runtime.ClientAuthInfoWriter) (*ListVulnerabilitiesOK, error) + + GetSecuritySummary(params *GetSecuritySummaryParams, authInfo runtime.ClientAuthInfoWriter) (*GetSecuritySummaryOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + ListVulnerabilities gets the vulnerability list + + Get the vulnerability list. use q to pass the query condition, +supported conditions: +cve_id(exact match) +cvss_score_v3(range condition) +severity(exact match) +repository_name(exact match) +project_id(exact match) +package(exact match) +tag(exact match) +digest(exact match) + +*/ +func (a *Client) ListVulnerabilities(params *ListVulnerabilitiesParams, authInfo runtime.ClientAuthInfoWriter) (*ListVulnerabilitiesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListVulnerabilitiesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ListVulnerabilities", + Method: "GET", + PathPattern: "/security/vul", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ListVulnerabilitiesReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*ListVulnerabilitiesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ListVulnerabilities: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetSecuritySummary gets vulnerability system summary + + Retrieve the vulnerability summary of the system +*/ +func (a *Client) GetSecuritySummary(params *GetSecuritySummaryParams, authInfo runtime.ClientAuthInfoWriter) (*GetSecuritySummaryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSecuritySummaryParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getSecuritySummary", + Method: "GET", + PathPattern: "/security/summary", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetSecuritySummaryReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetSecuritySummaryOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getSecuritySummary: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/apiv2/mocks/securityhub_client_service.go b/apiv2/mocks/securityhub_client_service.go new file mode 100644 index 00000000..8e002371 --- /dev/null +++ b/apiv2/mocks/securityhub_client_service.go @@ -0,0 +1,81 @@ +// Code generated by mockery v2.14.0. DO NOT EDIT. + +package mocks + +import ( + runtime "github.com/go-openapi/runtime" + mock "github.com/stretchr/testify/mock" + + securityhub "github.com/mittwald/goharbor-client/v5/apiv2/internal/api/client/securityhub" +) + +// MockSecurityhubClientService is an autogenerated mock type for the ClientService type +type MockSecurityhubClientService struct { + mock.Mock +} + +// GetSecuritySummary provides a mock function with given fields: params, authInfo +func (_m *MockSecurityhubClientService) GetSecuritySummary(params *securityhub.GetSecuritySummaryParams, authInfo runtime.ClientAuthInfoWriter) (*securityhub.GetSecuritySummaryOK, error) { + ret := _m.Called(params, authInfo) + + var r0 *securityhub.GetSecuritySummaryOK + if rf, ok := ret.Get(0).(func(*securityhub.GetSecuritySummaryParams, runtime.ClientAuthInfoWriter) *securityhub.GetSecuritySummaryOK); ok { + r0 = rf(params, authInfo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*securityhub.GetSecuritySummaryOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*securityhub.GetSecuritySummaryParams, runtime.ClientAuthInfoWriter) error); ok { + r1 = rf(params, authInfo) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ListVulnerabilities provides a mock function with given fields: params, authInfo +func (_m *MockSecurityhubClientService) ListVulnerabilities(params *securityhub.ListVulnerabilitiesParams, authInfo runtime.ClientAuthInfoWriter) (*securityhub.ListVulnerabilitiesOK, error) { + ret := _m.Called(params, authInfo) + + var r0 *securityhub.ListVulnerabilitiesOK + if rf, ok := ret.Get(0).(func(*securityhub.ListVulnerabilitiesParams, runtime.ClientAuthInfoWriter) *securityhub.ListVulnerabilitiesOK); ok { + r0 = rf(params, authInfo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*securityhub.ListVulnerabilitiesOK) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(*securityhub.ListVulnerabilitiesParams, runtime.ClientAuthInfoWriter) error); ok { + r1 = rf(params, authInfo) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SetTransport provides a mock function with given fields: transport +func (_m *MockSecurityhubClientService) SetTransport(transport runtime.ClientTransport) { + _m.Called(transport) +} + +type mockConstructorTestingTNewMockSecurityhubClientService interface { + mock.TestingT + Cleanup(func()) +} + +// NewMockSecurityhubClientService creates a new instance of MockSecurityhubClientService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMockSecurityhubClientService(t mockConstructorTestingTNewMockSecurityhubClientService) *MockSecurityhubClientService { + mock := &MockSecurityhubClientService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/apiv2/model/configurations.go b/apiv2/model/configurations.go index 4073c061..d298fb6a 100644 --- a/apiv2/model/configurations.go +++ b/apiv2/model/configurations.go @@ -21,6 +21,9 @@ type Configurations struct { // The auth mode of current system, such as "db_auth", "ldap_auth", "oidc_auth" AuthMode *string `json:"auth_mode,omitempty"` + // The banner message for the UI.It is the stringified result of the banner message object + BannerMessage *string `json:"banner_message,omitempty"` + // The group which has the harbor admin privileges HTTPAuthproxyAdminGroups *string `json:"http_authproxy_admin_groups,omitempty"` diff --git a/apiv2/model/configurations_response.go b/apiv2/model/configurations_response.go index 68285545..58fbe5cf 100644 --- a/apiv2/model/configurations_response.go +++ b/apiv2/model/configurations_response.go @@ -22,6 +22,9 @@ type ConfigurationsResponse struct { // The auth mode of current system, such as "db_auth", "ldap_auth", "oidc_auth" AuthMode *StringConfigItem `json:"auth_mode,omitempty"` + // The banner message for the UI.It is the stringified result of the banner message object + BannerMessage *StringConfigItem `json:"banner_message,omitempty"` + // The group which has the harbor admin privileges HTTPAuthproxyAdminGroups *StringConfigItem `json:"http_authproxy_admin_groups,omitempty"` @@ -185,6 +188,10 @@ func (m *ConfigurationsResponse) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateBannerMessage(formats); err != nil { + res = append(res, err) + } + if err := m.validateHTTPAuthproxyAdminGroups(formats); err != nil { res = append(res, err) } @@ -427,6 +434,24 @@ func (m *ConfigurationsResponse) validateAuthMode(formats strfmt.Registry) error return nil } +func (m *ConfigurationsResponse) validateBannerMessage(formats strfmt.Registry) error { + + if swag.IsZero(m.BannerMessage) { // not required + return nil + } + + if m.BannerMessage != nil { + if err := m.BannerMessage.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("banner_message") + } + return err + } + } + + return nil +} + func (m *ConfigurationsResponse) validateHTTPAuthproxyAdminGroups(formats strfmt.Registry) error { if swag.IsZero(m.HTTPAuthproxyAdminGroups) { // not required diff --git a/apiv2/model/dangerous_artifact.go b/apiv2/model/dangerous_artifact.go new file mode 100644 index 00000000..6b4bb91e --- /dev/null +++ b/apiv2/model/dangerous_artifact.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package model + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DangerousArtifact the dangerous artifact information +// +// swagger:model DangerousArtifact +type DangerousArtifact struct { + + // the count of critical vulnerabilities + CriticalCnt int64 `json:"critical_cnt"` + + // the digest of the artifact + Digest string `json:"digest,omitempty"` + + // the count of high vulnerabilities + HighCnt int64 `json:"high_cnt"` + + // the count of medium vulnerabilities + MediumCnt int64 `json:"medium_cnt"` + + // the project id of the artifact + ProjectID int64 `json:"project_id,omitempty"` + + // the repository name of the artifact + RepositoryName string `json:"repository_name,omitempty"` +} + +// Validate validates this dangerous artifact +func (m *DangerousArtifact) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DangerousArtifact) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DangerousArtifact) UnmarshalBinary(b []byte) error { + var res DangerousArtifact + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/apiv2/model/dangerous_cve.go b/apiv2/model/dangerous_cve.go new file mode 100644 index 00000000..84411a6e --- /dev/null +++ b/apiv2/model/dangerous_cve.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package model + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DangerousCVE the dangerous CVE information +// +// swagger:model DangerousCVE +type DangerousCVE struct { + + // the cve id + CVEID string `json:"cve_id,omitempty"` + + // the cvss score v3 + CvssScoreV3 float64 `json:"cvss_score_v3,omitempty"` + + // the description of the CVE + Desc string `json:"desc,omitempty"` + + // the package of the CVE + Package string `json:"package,omitempty"` + + // the severity of the CVE + Severity string `json:"severity,omitempty"` + + // the version of the package + Version string `json:"version,omitempty"` +} + +// Validate validates this dangerous CVE +func (m *DangerousCVE) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DangerousCVE) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DangerousCVE) UnmarshalBinary(b []byte) error { + var res DangerousCVE + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/apiv2/model/general_info.go b/apiv2/model/general_info.go index 3fbdd316..248d7130 100644 --- a/apiv2/model/general_info.go +++ b/apiv2/model/general_info.go @@ -23,6 +23,9 @@ type GeneralInfo struct { // The setting of auth proxy this is only available when Harbor relies on authproxy for authentication. AuthproxySettings *AuthproxySetting `json:"authproxy_settings,omitempty"` + // The banner message for the UI. It is the stringified result of the banner message object. + BannerMessage *string `json:"banner_message,omitempty"` + // The current time of the server. // Format: date-time CurrentTime *strfmt.DateTime `json:"current_time,omitempty"` @@ -56,9 +59,6 @@ type GeneralInfo struct { // Indicate whether the Harbor instance enable user to register himself. SelfRegistration *bool `json:"self_registration,omitempty"` - - // If the Harbor instance is deployed with nested notary. - WithNotary *bool `json:"with_notary,omitempty"` } // Validate validates this general info diff --git a/apiv2/model/scanner_registration.go b/apiv2/model/scanner_registration.go index ccf986c9..8696d78c 100644 --- a/apiv2/model/scanner_registration.go +++ b/apiv2/model/scanner_registration.go @@ -57,7 +57,8 @@ type ScannerRegistration struct { UpdateTime strfmt.DateTime `json:"update_time,omitempty"` // A base URL of the scanner adapter - URL string `json:"url,omitempty"` + // Format: uri + URL strfmt.URI `json:"url,omitempty"` // Indicate whether use internal registry addr for the scanner to pull content or not UseInternalAddr *bool `json:"use_internal_addr"` @@ -84,6 +85,10 @@ func (m *ScannerRegistration) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -116,6 +121,19 @@ func (m *ScannerRegistration) validateUpdateTime(formats strfmt.Registry) error return nil } +func (m *ScannerRegistration) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ScannerRegistration) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/apiv2/model/schedule_obj.go b/apiv2/model/schedule_obj.go index 12ffdc2d..c80dade9 100644 --- a/apiv2/model/schedule_obj.go +++ b/apiv2/model/schedule_obj.go @@ -26,10 +26,11 @@ type ScheduleObj struct { // Format: date-time NextScheduledTime strfmt.DateTime `json:"next_scheduled_time,omitempty"` - // The schedule type. The valid values are 'Hourly', 'Daily', 'Weekly', 'Custom', 'Manual' and 'None'. - // 'Manual' means to trigger it right away and 'None' means to cancel the schedule. + // The schedule type. The valid values are 'Hourly', 'Daily', 'Weekly', 'Custom', 'Manual', 'None' and 'Schedule'. + // 'Manual' means to trigger it right away, 'Schedule' means to trigger it by a specified cron schedule and + // 'None' means to cancel the schedule. // - // Enum: [Hourly Daily Weekly Custom Manual None] + // Enum: [Hourly Daily Weekly Custom Manual None Schedule] Type string `json:"type,omitempty"` } @@ -68,7 +69,7 @@ var scheduleObjTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["Hourly","Daily","Weekly","Custom","Manual","None"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["Hourly","Daily","Weekly","Custom","Manual","None","Schedule"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -95,6 +96,9 @@ const ( // ScheduleObjTypeNone captures enum value "None" ScheduleObjTypeNone string = "None" + + // ScheduleObjTypeSchedule captures enum value "Schedule" + ScheduleObjTypeSchedule string = "Schedule" ) // prop value enum diff --git a/apiv2/model/security_summary.go b/apiv2/model/security_summary.go new file mode 100644 index 00000000..7e1aea00 --- /dev/null +++ b/apiv2/model/security_summary.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package model + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SecuritySummary the security summary +// +// swagger:model SecuritySummary +type SecuritySummary struct { + + // the count of critical vulnerabilities + CriticalCnt int64 `json:"critical_cnt"` + + // the list of dangerous artifacts + DangerousArtifacts []*DangerousArtifact `json:"dangerous_artifacts,omitempty"` + + // the list of dangerous CVEs + DangerousCves []*DangerousCVE `json:"dangerous_cves,omitempty"` + + // the count of fixable vulnerabilities + FixableCnt int64 `json:"fixable_cnt"` + + // the count of high vulnerabilities + HighCnt int64 `json:"high_cnt,omitempty"` + + // the count of low vulnerabilities + LowCnt int64 `json:"low_cnt"` + + // the count of medium vulnerabilities + MediumCnt int64 `json:"medium_cnt"` + + // the count of none vulnerabilities + NoneCnt int64 `json:"none_cnt,omitempty"` + + // the count of scanned artifacts + ScannedCnt int64 `json:"scanned_cnt"` + + // the total count of artifacts + TotalArtifact int64 `json:"total_artifact"` + + // the count of total vulnerabilities + TotalVuls int64 `json:"total_vuls"` + + // the count of unknown vulnerabilities + UnknownCnt int64 `json:"unknown_cnt,omitempty"` +} + +// Validate validates this security summary +func (m *SecuritySummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDangerousArtifacts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDangerousCves(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecuritySummary) validateDangerousArtifacts(formats strfmt.Registry) error { + + if swag.IsZero(m.DangerousArtifacts) { // not required + return nil + } + + for i := 0; i < len(m.DangerousArtifacts); i++ { + if swag.IsZero(m.DangerousArtifacts[i]) { // not required + continue + } + + if m.DangerousArtifacts[i] != nil { + if err := m.DangerousArtifacts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dangerous_artifacts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *SecuritySummary) validateDangerousCves(formats strfmt.Registry) error { + + if swag.IsZero(m.DangerousCves) { // not required + return nil + } + + for i := 0; i < len(m.DangerousCves); i++ { + if swag.IsZero(m.DangerousCves[i]) { // not required + continue + } + + if m.DangerousCves[i] != nil { + if err := m.DangerousCves[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dangerous_cves" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SecuritySummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SecuritySummary) UnmarshalBinary(b []byte) error { + var res SecuritySummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/apiv2/model/tag.go b/apiv2/model/tag.go index 054adb7f..446acf1c 100644 --- a/apiv2/model/tag.go +++ b/apiv2/model/tag.go @@ -39,9 +39,6 @@ type Tag struct { // The ID of the repository that the tag belongs to RepositoryID int64 `json:"repository_id,omitempty"` - - // The attribute indicates whether the tag is signed or not - Signed bool `json:"signed"` } // Validate validates this tag diff --git a/apiv2/model/vulnerability_item.go b/apiv2/model/vulnerability_item.go new file mode 100644 index 00000000..8be3c4fe --- /dev/null +++ b/apiv2/model/vulnerability_item.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package model + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VulnerabilityItem the vulnerability item info +// +// swagger:model VulnerabilityItem +type VulnerabilityItem struct { + + // the CVE id of the vulnerability. + CVEID string `json:"cve_id,omitempty"` + + // the nvd cvss v3 score of the vulnerability + CvssV3Score float32 `json:"cvss_v3_score,omitempty"` + + // The description of the vulnerability + Desc string `json:"desc,omitempty"` + + // the digest of the artifact + Digest string `json:"digest,omitempty"` + + // the fixed version of the package + FixedVersion string `json:"fixed_version,omitempty"` + + // Links of the vulnerability + Links []string `json:"links"` + + // the package of the vulnerability + Package string `json:"package,omitempty"` + + // the project ID of the artifact + ProjectID int64 `json:"project_id,omitempty"` + + // the repository name of the artifact + RepositoryName string `json:"repository_name,omitempty"` + + // the severity of the vulnerability + Severity string `json:"severity,omitempty"` + + // the tags of the artifact + Tags []string `json:"tags"` + + // the version of the package + Version string `json:"version,omitempty"` +} + +// Validate validates this vulnerability item +func (m *VulnerabilityItem) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VulnerabilityItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VulnerabilityItem) UnmarshalBinary(b []byte) error { + var res VulnerabilityItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/apiv2/pkg/clients/gc/gc.go b/apiv2/pkg/clients/gc/gc.go index beb746c8..6545f5de 100644 --- a/apiv2/pkg/clients/gc/gc.go +++ b/apiv2/pkg/clients/gc/gc.go @@ -69,7 +69,8 @@ func (c *RESTClient) NewGarbageCollection(ctx context.Context, gcSchedule *model // UpdateGarbageCollection updates the system GC schedule. func (c *RESTClient) UpdateGarbageCollection(ctx context.Context, - newGCSchedule *model.Schedule) error { + newGCSchedule *model.Schedule, +) error { if newGCSchedule == nil { return &errors.ErrSystemGcScheduleNotProvided{} } diff --git a/apiv2/pkg/clients/ping/ping_test.go b/apiv2/pkg/clients/ping/ping_test.go index 705e1446..fe1e6bd6 100644 --- a/apiv2/pkg/clients/ping/ping_test.go +++ b/apiv2/pkg/clients/ping/ping_test.go @@ -26,6 +26,7 @@ func APIandMockClientsForTests() (*RESTClient, *clienttesting.MockClients) { return cl, desiredMockClients } + func TestRESTClient_GetPing(t *testing.T) { apiClient, mockClient := APIandMockClientsForTests() diff --git a/apiv2/pkg/clients/purge/purge.go b/apiv2/pkg/clients/purge/purge.go index 711a2334..ad4374ae 100644 --- a/apiv2/pkg/clients/purge/purge.go +++ b/apiv2/pkg/clients/purge/purge.go @@ -136,6 +136,7 @@ func (c *RESTClient) ListPurgeHistory(ctx context.Context) ([]*model.ExecHistory return history, nil } + func (c *RESTClient) GetPurgeJob(ctx context.Context, id int64) (*model.ExecHistory, error) { params := &purge.GetPurgeJobParams{ PurgeID: id, @@ -150,6 +151,7 @@ func (c *RESTClient) GetPurgeJob(ctx context.Context, id int64) (*model.ExecHist return resp.Payload, nil } + func (c *RESTClient) GetPurgeJobLog(ctx context.Context, id int64) (string, error) { params := &purge.GetPurgeJobLogParams{ PurgeID: id, @@ -164,6 +166,7 @@ func (c *RESTClient) GetPurgeJobLog(ctx context.Context, id int64) (string, erro return resp.Payload, nil } + func (c *RESTClient) GetPurgeSchedule(ctx context.Context) (*model.ExecHistory, error) { params := &purge.GetPurgeScheduleParams{ Context: ctx, @@ -177,6 +180,7 @@ func (c *RESTClient) GetPurgeSchedule(ctx context.Context) (*model.ExecHistory, return resp.Payload, nil } + func (c *RESTClient) StopPurge(ctx context.Context, id int64) error { params := &purge.StopPurgeParams{ PurgeID: id, @@ -191,6 +195,7 @@ func (c *RESTClient) StopPurge(ctx context.Context, id int64) error { return nil } + func (c *RESTClient) UpdatePurgeSchedule(ctx context.Context, schedule *model.Schedule) error { params := &purge.UpdatePurgeScheduleParams{ Schedule: schedule, diff --git a/apiv2/pkg/clients/purge/purge_integration_test.go b/apiv2/pkg/clients/purge/purge_integration_test.go index 5e186b79..e6ad3e95 100644 --- a/apiv2/pkg/clients/purge/purge_integration_test.go +++ b/apiv2/pkg/clients/purge/purge_integration_test.go @@ -68,6 +68,7 @@ func TestAPIGetPurgeSchedule(t *testing.T) { require.NoError(t, err) require.NotNil(t, purgeSchedule) } + func TestAPIStopPurge(t *testing.T) { ctx := context.Background() c := NewClient(clienttesting.V2SwaggerClient, clienttesting.DefaultOpts, clienttesting.AuthInfo) @@ -82,6 +83,7 @@ func TestAPIStopPurge(t *testing.T) { err = c.StopPurge(ctx, purgeJobs[0].ID) require.NoError(t, err) } + func TestAPIUpdatePurgeSchedule(t *testing.T) { ctx := context.Background() c := NewClient(clienttesting.V2SwaggerClient, clienttesting.DefaultOpts, clienttesting.AuthInfo) diff --git a/apiv2/pkg/clients/purge/purge_test.go b/apiv2/pkg/clients/purge/purge_test.go index 3b5a6554..b18e1f52 100644 --- a/apiv2/pkg/clients/purge/purge_test.go +++ b/apiv2/pkg/clients/purge/purge_test.go @@ -14,9 +14,7 @@ import ( "github.com/stretchr/testify/require" ) -var ( - ctx = context.Background() -) +var ctx = context.Background() func APIandMockClientsForTests() (*RESTClient, *clienttesting.MockClients) { desiredMockClients := &clienttesting.MockClients{ diff --git a/apiv2/pkg/clients/repository/repository.go b/apiv2/pkg/clients/repository/repository.go index a36d3a8d..a3507316 100644 --- a/apiv2/pkg/clients/repository/repository.go +++ b/apiv2/pkg/clients/repository/repository.go @@ -94,7 +94,6 @@ func (c *RESTClient) ListAllRepositories(ctx context.Context) ([]*model.Reposito for { resp, err := c.V2Client.Repository.ListAllRepositories(params, c.AuthInfo) - if err != nil { return nil, handleSwaggerRepositoryErrors(err) } diff --git a/apiv2/pkg/clients/retention/retention.go b/apiv2/pkg/clients/retention/retention.go index 2b4a10e2..15971304 100644 --- a/apiv2/pkg/clients/retention/retention.go +++ b/apiv2/pkg/clients/retention/retention.go @@ -101,6 +101,10 @@ func (t TagSelector) String() string { } // NewRetentionPolicy creates a new tag retention policy for a project. +// Note: When setting a `cron` configuration for a retention policy, +// the cron format must include `0` at the first index. +// Also, the character at the second index must be `*`, e.g. `0 * * * * *`. +// See: https://github.com/goharbor/harbor/pull/18923/files func (c *RESTClient) NewRetentionPolicy(ctx context.Context, ret *modelv2.RetentionPolicy) error { if ret == nil { return &ErrRetentionNotProvided{} diff --git a/apiv2/pkg/clients/retention/retention_integration_test.go b/apiv2/pkg/clients/retention/retention_integration_test.go index eb0ec288..56ca5538 100644 --- a/apiv2/pkg/clients/retention/retention_integration_test.go +++ b/apiv2/pkg/clients/retention/retention_integration_test.go @@ -51,7 +51,7 @@ func newTestRetention(projectID int64) modelv2.RetentionPolicy { }, Trigger: &modelv2.RetentionRuleTrigger{ Kind: "Schedule", - Settings: map[string]interface{}{"cron": "* 0 * * * *"}, + Settings: map[string]interface{}{"cron": "0 0 * * * *"}, }, } } diff --git a/apiv2/pkg/clients/scanall/scanall.go b/apiv2/pkg/clients/scanall/scanall.go index 196d23e6..9c07083e 100644 --- a/apiv2/pkg/clients/scanall/scanall.go +++ b/apiv2/pkg/clients/scanall/scanall.go @@ -12,8 +12,6 @@ import ( "github.com/mittwald/goharbor-client/v5/apiv2/pkg/errors" ) -const () - // RESTClient is a subclient for handling project related actions. type RESTClient struct { // Options contains optional configuration when making API calls. @@ -52,7 +50,6 @@ func (c *RESTClient) CreateScanAllSchedule(ctx context.Context, schedule *model. _, err := c.V2Client.ScanAll.CreateScanAllSchedule(params, c.AuthInfo) return handleSwaggerScanallErrors(err) - } // GetScanAllSchedule returns the scan all schedule. @@ -85,5 +82,4 @@ func (c *RESTClient) UpdateScanAllSchedule(ctx context.Context, schedule *model. _, err := c.V2Client.ScanAll.UpdateScanAllSchedule(params, c.AuthInfo) return handleSwaggerScanallErrors(err) - } diff --git a/apiv2/pkg/clients/scanall/scanall_test.go b/apiv2/pkg/clients/scanall/scanall_test.go index 218f35f7..3bb000fd 100644 --- a/apiv2/pkg/clients/scanall/scanall_test.go +++ b/apiv2/pkg/clients/scanall/scanall_test.go @@ -69,9 +69,10 @@ func TestRESTClient_GetScanAllSchedule(t *testing.T) { mockClient.ScanAll.On("GetScanAllSchedule", params, mock.AnythingOfType("runtime.ClientAuthInfoWriterFunc")). Return(&scan_all.GetScanAllScheduleOK{ - Payload: &model.Schedule{Schedule: &model.ScheduleObj{ - Type: "Daily", - }, + Payload: &model.Schedule{ + Schedule: &model.ScheduleObj{ + Type: "Daily", + }, }, }, nil) _, err := apiClient.GetScanAllSchedule(ctx) diff --git a/apiv2/pkg/clients/statistic/statistic_test.go b/apiv2/pkg/clients/statistic/statistic_test.go index c8e72fed..2d4fe74f 100644 --- a/apiv2/pkg/clients/statistic/statistic_test.go +++ b/apiv2/pkg/clients/statistic/statistic_test.go @@ -12,9 +12,7 @@ import ( "github.com/stretchr/testify/require" ) -var ( - ctx context.Context -) +var ctx context.Context func APIandMockClientsForTests() (*RESTClient, *clienttesting.MockClients) { desiredMockClients := &clienttesting.MockClients{ diff --git a/apiv2/pkg/clients/systeminfo/systeminfo_integration_test.go b/apiv2/pkg/clients/systeminfo/systeminfo_integration_test.go index 03e88cb4..b26cd83e 100644 --- a/apiv2/pkg/clients/systeminfo/systeminfo_integration_test.go +++ b/apiv2/pkg/clients/systeminfo/systeminfo_integration_test.go @@ -19,6 +19,5 @@ func TestAPIGetSystemInfo(t *testing.T) { require.NoError(t, err) require.Equal(t, false, *resp.ReadOnly) - require.Equal(t, false, *resp.WithNotary) require.Equal(t, "core.harbor.domain", *resp.RegistryURL) } diff --git a/go.mod b/go.mod index 33748b53..6d4f80de 100644 --- a/go.mod +++ b/go.mod @@ -1,30 +1,30 @@ module github.com/mittwald/goharbor-client/v5 -go 1.20 +go 1.21 require ( - github.com/go-openapi/errors v0.20.3 - github.com/go-openapi/runtime v0.25.0 - github.com/go-openapi/strfmt v0.21.3 - github.com/go-openapi/swag v0.22.3 - github.com/go-openapi/validate v0.22.1 - github.com/goharbor/harbor/src v0.0.0-20230220075213-6015b3efa7d0 + github.com/go-openapi/errors v0.21.0 + github.com/go-openapi/runtime v0.26.2 + github.com/go-openapi/strfmt v0.21.10 + github.com/go-openapi/swag v0.22.6 + github.com/go-openapi/validate v0.22.4 + github.com/goharbor/harbor/src v0.0.0-20231101063948-5cbb1b010a7b github.com/pkg/errors v0.9.1 - github.com/stretchr/testify v1.8.2 - k8s.io/apimachinery v0.26.2 + github.com/stretchr/testify v1.8.4 + k8s.io/apimachinery v0.29.0 ) require ( github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/analysis v0.21.4 // indirect - github.com/go-openapi/jsonpointer v0.19.6 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/loads v0.21.2 // indirect - github.com/go-openapi/spec v0.20.8 // indirect + github.com/go-openapi/analysis v0.22.0 // indirect + github.com/go-openapi/jsonpointer v0.20.2 // indirect + github.com/go-openapi/jsonreference v0.20.4 // indirect + github.com/go-openapi/loads v0.21.4 // indirect + github.com/go-openapi/spec v0.20.13 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -33,12 +33,12 @@ require ( github.com/oklog/ulid v1.3.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect - go.mongodb.org/mongo-driver v1.12.1 // indirect - go.opentelemetry.io/otel v1.14.0 // indirect - go.opentelemetry.io/otel/trace v1.14.0 // indirect - golang.org/x/sys v0.6.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/stretchr/objx v0.5.1 // indirect + go.mongodb.org/mongo-driver v1.13.1 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect + golang.org/x/sys v0.15.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.90.1 // indirect + k8s.io/klog/v2 v2.110.1 // indirect ) diff --git a/go.sum b/go.sum index b3e543c9..f50c559a 100644 --- a/go.sum +++ b/go.sum @@ -1,234 +1,136 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= -github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= -github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= -github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.3 h1:rz6kiC84sqNQoqrtulzaL/VERgkoCyB6WdEkc2ujzUc= -github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= -github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= -github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= -github.com/go-openapi/runtime v0.25.0 h1:7yQTCdRbWhX8vnIjdzU8S00tBYf7Sg71EBeorlPHvhc= -github.com/go-openapi/runtime v0.25.0/go.mod h1:Ux6fikcHXyyob6LNWxtE96hWwjBPYF0DXgVFuMTneOs= -github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/spec v0.20.8 h1:ubHmXNY3FCIOinT8RNrrPfGc9t7I1qhPtdOGoG2AxRU= -github.com/go-openapi/spec v0.20.8/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= -github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= -github.com/go-openapi/strfmt v0.21.3 h1:xwhj5X6CjXEZZHMWy1zKJxvW9AfHC9pkyUjLvHtKG7o= -github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= -github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/go-openapi/analysis v0.22.0 h1:wQ/d07nf78HNj4u+KiSY0sT234IAyePPbMgpUjUJQR0= +github.com/go-openapi/analysis v0.22.0/go.mod h1:acDnkkCI2QxIo8sSIPgmp1wUlRohV7vfGtAIVae73b0= +github.com/go-openapi/errors v0.21.0 h1:FhChC/duCnfoLj1gZ0BgaBmzhJC2SL/sJr8a2vAobSY= +github.com/go-openapi/errors v0.21.0/go.mod h1:jxNTMUxRCKj65yb/okJGEtahVd7uvWnuWfj53bse4ho= +github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= +github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= +github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= +github.com/go-openapi/loads v0.21.4 h1:PKP7B5J3tpLqmTFzg7OeM9vjmcAi3axt9+kouFOvJxQ= +github.com/go-openapi/loads v0.21.4/go.mod h1:PxTsnFBoBe+z89riT+wYt3prmSBP6GDAQh2l9H1Flz8= +github.com/go-openapi/runtime v0.26.2 h1:elWyB9MacRzvIVgAZCBJmqTi7hBzU0hlKD4IvfX0Zl0= +github.com/go-openapi/runtime v0.26.2/go.mod h1:O034jyRZ557uJKzngbMDJXkcKJVzXJiymdSfgejrcRw= +github.com/go-openapi/spec v0.20.13 h1:XJDIN+dLH6vqXgafnl5SUIMnzaChQ6QTo0/UPMbkIaE= +github.com/go-openapi/spec v0.20.13/go.mod h1:8EOhTpBoFiask8rrgwbLC3zmJfz4zsCUueRuPM6GNkw= +github.com/go-openapi/strfmt v0.21.10 h1:JIsly3KXZB/Qf4UzvzJpg4OELH/0ASDQsyk//TTBDDk= +github.com/go-openapi/strfmt v0.21.10/go.mod h1:vNDMwbilnl7xKiO/Ve/8H8Bb2JIInBnH+lqiw6QWgis= +github.com/go-openapi/swag v0.22.6 h1:dnqg1XfHXL9aBxSbktBqFR5CxVyVI+7fYWhAf1JOeTw= +github.com/go-openapi/swag v0.22.6/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= +github.com/go-openapi/validate v0.22.4 h1:5v3jmMyIPKTR8Lv9syBAIRxG6lY0RqeBPB1LKEijzk8= +github.com/go-openapi/validate v0.22.4/go.mod h1:qm6O8ZIcPVdSY5219468Jv7kBdGvkiZLPOmqnqTUZ2A= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/goharbor/harbor/src v0.0.0-20230220075213-6015b3efa7d0 h1:gMgzuiprCAnpNGXUWtNFpWhOtufmZsmLjjb2OJlNaNw= -github.com/goharbor/harbor/src v0.0.0-20230220075213-6015b3efa7d0/go.mod h1:0C9RORUO0WryiK8qxJ89y5hrim5AdE+Az5hcE+eMF2A= +github.com/goharbor/harbor/src v0.0.0-20231101063948-5cbb1b010a7b h1:hKo0ygypf4dEbf57lVNcqlr5H0+9G9zdINstpaMJ3MY= +github.com/goharbor/harbor/src v0.0.0-20231101063948-5cbb1b010a7b/go.mod h1:OMK0btSSxe03YOL2lOwtpyWtIWEsNHYtc5B9kuzWTCo= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= +github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= -go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= -go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= -go.mongodb.org/mongo-driver v1.12.1 h1:nLkghSU8fQNaK7oUmDhQFsnrtcoNy7Z6LVFKsEecqgE= -go.mongodb.org/mongo-driver v1.12.1/go.mod h1:/rGBTebI3XYboVmgz+Wv3Bcbl3aD0QF9zl6kDDw18rQ= -go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= -go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= -go.opentelemetry.io/otel/sdk v1.11.1 h1:F7KmQgoHljhUuJyA+9BiU+EkJfyX5nVVF4wyzWZpKxs= -go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= -go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= +go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= +go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -238,23 +140,16 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/apimachinery v0.26.2 h1:da1u3D5wfR5u2RpLhE/ZtZS2P7QvDgLZTi9wrNZl/tQ= -k8s.io/apimachinery v0.26.2/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= -k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= -k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/apimachinery v0.29.0 h1:+ACVktwyicPz0oc6MTMLwa2Pw3ouLAfAon1wPLtG48o= +k8s.io/apimachinery v0.29.0/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=