Skip to content

Commit

Permalink
Merge branch 'main' into uffizzi-k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
OrlinVasilev authored Nov 17, 2023
2 parents 1c9d9af + 307a312 commit 7f92f51
Show file tree
Hide file tree
Showing 4,950 changed files with 6,353 additions and 1,507,462 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
20 changes: 10 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
- ubuntu-latest
timeout-minutes: 100
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.20.10
go-version: 1.21.3
id: go
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -102,10 +102,10 @@ jobs:
- ubuntu-latest
timeout-minutes: 100
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.20.10
go-version: 1.21.3
id: go
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -157,10 +157,10 @@ jobs:
- ubuntu-latest
timeout-minutes: 100
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.20.10
go-version: 1.21.3
id: go
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -212,10 +212,10 @@ jobs:
- ubuntu-latest
timeout-minutes: 100
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.20.10
go-version: 1.21.3
id: go
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -265,10 +265,10 @@ jobs:
- ubuntu-latest
timeout-minutes: 100
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.20.10
go-version: 1.21.3
id: go
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
with:
version: '430.0.0'
- run: gcloud info
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.20.10
go-version: 1.21.3
id: go
- name: Setup Docker
uses: docker-practice/actions-setup-docker@master
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/conformance_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- uses: google-github-actions/setup-gcloud@v1
- run: gcloud info
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.20.10
go-version: 1.21.3
id: go
- uses: actions/checkout@v3
with:
Expand Down
13 changes: 3 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,7 @@ The folder graph below shows the structure of the source code folder `harbor/src
│   ├── registry
│   ├── router
│   ├── v2.0
├── testing # Some utilities to handle testing.
└── vendor # Go code dependencies
├── github.com
├── golang.org
├── google.golang.org
└── gopkg.in
└── testing # Some utilities to handle testing.
```

### Setup Development Environment
Expand Down Expand Up @@ -168,12 +163,10 @@ Harbor backend is written in [Go](http://golang.org/). If you don't have a Harbo
| 2.6 | 1.18.6 |
| 2.7 | 1.19.4 |
| 2.8 | 1.20.6 |
| 2.9 | 1.20.10 |
| 2.9 | 1.21.3 |

Ensure your GOPATH and PATH have been configured in accordance with the Go environment instructions.

**Dependency Management:** Harbor uses [Go modules](https://github.com/golang/go/wiki/Modules) for dependency management of go code. The official maintainers will take the responsibility for managing the code in `vendor` directory. Please don't try to submit a PR to update the dependency code, open an issue instead. If your PR requires a change in the vendor code please make sure you discuss it with the maintainers in advance.

#### Web

Harbor web UI is built based on [Clarity](https://vmware.github.io/clarity/) and [Angular](https://angular.io/) web framework. To setup web UI development environment, please make sure the [npm](https://www.npmjs.com/get-npm) tool is installed first.
Expand Down Expand Up @@ -258,7 +251,7 @@ go install github.com/GeertJohan/fgt@latest

#In the #working_dir/harbor, run

go list ./... | grep -v -E 'vendor|tests' | xargs -L1 fgt golint
go list ./... | grep -v -E 'tests' | xargs -L1 fgt golint

```

Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ PREPARE_VERSION_NAME=versions

#versions
REGISTRYVERSION=v2.8.2-patch-redis
TRIVYVERSION=v0.46.0
TRIVYADAPTERVERSION=v0.30.17
TRIVYVERSION=v0.46.1
TRIVYADAPTERVERSION=v0.30.18

# version of registry for pulling the source code
REGISTRY_SRC_TAG=v2.8.2
Expand Down Expand Up @@ -140,7 +140,7 @@ GOINSTALL=$(GOCMD) install
GOTEST=$(GOCMD) test
GODEP=$(GOTEST) -i
GOFMT=gofmt -w
GOBUILDIMAGE=golang:1.20.10
GOBUILDIMAGE=golang:1.21.3
GOBUILDPATHINCONTAINER=/harbor

# go build
Expand All @@ -156,7 +156,7 @@ ifneq ($(GOBUILDLDFLAGS),)
endif

# go build command
GOIMAGEBUILDCMD=/usr/local/go/bin/go build -mod vendor
GOIMAGEBUILDCMD=/usr/local/go/bin/go build
GOIMAGEBUILD_COMMON=$(GOIMAGEBUILDCMD) $(GOFLAGS) ${GOTAGS} ${GOLDFLAGS}
GOIMAGEBUILD_CORE=$(GOIMAGEBUILDCMD) $(GOFLAGS) ${GOTAGS} --ldflags "-w -s $(CORE_LDFLAGS)"

Expand Down Expand Up @@ -312,7 +312,7 @@ gen_apis: lint_apis


MOCKERY_IMAGENAME=$(IMAGENAMESPACE)/mockery
MOCKERY_VERSION=v2.22.1
MOCKERY_VERSION=v2.35.4
MOCKERY=$(RUNCONTAINER) ${MOCKERY_IMAGENAME}:${MOCKERY_VERSION}
MOCKERY_IMAGE_BUILD_CMD=${DOCKERBUILD} -f ${TOOLSPATH}/mockery/Dockerfile --build-arg GOLANG=${GOBUILDIMAGE} --build-arg MOCKERY_VERSION=${MOCKERY_VERSION} -t ${MOCKERY_IMAGENAME}:$(MOCKERY_VERSION) .

Expand Down Expand Up @@ -466,7 +466,7 @@ go_check: gen_apis mocks_check misspell commentfmt lint

commentfmt:
@echo checking comment format...
@res=$$(find . -type d \( -path ./src/vendor -o -path ./tests \) -prune -o -name '*.go' -print | xargs egrep '(^|\s)\/\/(\S)'|grep -v '//go:generate'); \
@res=$$(find . -type d \( -path ./tests \) -prune -o -name '*.go' -print | xargs egrep '(^|\s)\/\/(\S)'|grep -v '//go:generate'); \
if [ -n "$${res}" ]; then \
echo checking comment format fail.. ; \
echo missing whitespace between // and comment body;\
Expand All @@ -476,7 +476,7 @@ commentfmt:

misspell:
@echo checking misspell...
@find . -type d \( -path ./src/vendor -o -path ./tests \) -prune -o -name '*.go' -print | xargs misspell -error
@find . -type d \( -path ./tests \) -prune -o -name '*.go' -print | xargs misspell -error

# golangci-lint binary installation or refer to https://golangci-lint.run/usage/install/#local-installation
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.2
Expand Down
46 changes: 44 additions & 2 deletions api/v2.0/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6140,7 +6140,31 @@ paths:
'401':
$ref: '#/responses/401'
'500':
$ref: '#/responses/500'
$ref: '#/responses/500'

/permissions:
get:
summary: Get system or project level permissions info.
operationId: getPermissions
description: |
This endpoint is for retrieving resource and action info that only provides for admin user(system admin and project admin).
tags:
- permissions
parameters:
- $ref: '#/parameters/requestId'
responses:
'200':
description: Get permissions successfully.
schema:
$ref: '#/definitions/Permissions'
'401':
$ref: '#/responses/401'
'403':
$ref: '#/responses/403'
'404':
$ref: '#/responses/404'
'500':
$ref: '#/responses/500'

parameters:
query:
Expand All @@ -6151,7 +6175,7 @@ parameters:
required: false
sort:
name: sort
description: Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with "sort=field1,-field2"
description: Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending order and field2 in descending order with "sort=field1,-field2"
in: query
type: string
required: false
Expand Down Expand Up @@ -7843,6 +7867,11 @@ definitions:
x-nullable: true
x-omitempty: true
$ref: '#/definitions/AuthproxySetting'
oidc_provider_name:
type: string
x-nullable: true
x-omitempty: true
description: The OIDC provider name, empty if current auth is not OIDC_auth or OIDC provider is not configured.
AuthproxySetting:
type: object
properties:
Expand Down Expand Up @@ -9397,6 +9426,19 @@ definitions:
action:
type: string
description: The permission action
Permissions:
type: object
properties:
system:
type: array
description: The system level permissions
items:
$ref: '#/definitions/Permission'
project:
type: array
description: The project level permissions
items:
$ref: '#/definitions/Permission'
OIDCCliSecretReq:
type: object
properties:
Expand Down
2 changes: 1 addition & 1 deletion make/photon/registry/Dockerfile.binary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.10
FROM golang:1.21.3

ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution
ENV BUILDTAGS include_oss include_gcs
Expand Down
2 changes: 1 addition & 1 deletion make/photon/trivy-adapter/Dockerfile.binary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.10
FROM golang:1.21.3

ADD . /go/src/github.com/aquasecurity/harbor-scanner-trivy/
WORKDIR /go/src/github.com/aquasecurity/harbor-scanner-trivy/
Expand Down
2 changes: 1 addition & 1 deletion make/photon/trivy-adapter/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ TEMP=$(mktemp -d ${TMPDIR-/tmp}/trivy-adapter.XXXXXX)
git clone https://github.com/aquasecurity/harbor-scanner-trivy.git $TEMP
cd $TEMP; git checkout $VERSION; cd -

echo "Building Trivy adapter binary based on golang:1.20.10..."
echo "Building Trivy adapter binary based on golang:1.21.3..."
cp Dockerfile.binary $TEMP
docker build -f $TEMP/Dockerfile.binary -t trivy-adapter-golang $TEMP

Expand Down
2 changes: 2 additions & 0 deletions src/common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,6 @@ const (
ExecutionStatusRefreshIntervalSeconds = "execution_status_refresh_interval_seconds"
// QuotaUpdateProvider is the provider for updating quota, currently support Redis and DB
QuotaUpdateProvider = "quota_update_provider"
// IllegalCharsInUsername is the illegal chars in username
IllegalCharsInUsername = `,"~#%$`
)
Loading

0 comments on commit 7f92f51

Please sign in to comment.