diff --git a/.aspell.yml b/.aspell.yml new file mode 100644 index 00000000..838e0f34 --- /dev/null +++ b/.aspell.yml @@ -0,0 +1,145 @@ +mode: commit +min_length: 3 +allowed: +- acls +- apk +- aspell +- auth +- autofill +- aws +- axios +- backend +- backends +- backport +- bmarkovic +- browserslist +- caniuse +- cli +- clickhouse +- composable +- conf +- config +- const +- crd +- cronjob +- cve +- cwe +- dapi +- dataplane +- dataplaneapi +- dataplanes +- datepicker +- discoverability +- dns +- dom +- dpapi +- dpapis +- dropdowns +- dsn +- e2e +- entrypoint +- enum +- env +- eol +- escaper +- eslint +- failsafe +- fbt +- formatter +- formatters +- frontend +- frontends +- github +- gitlab +- golang +- golangci +- gorm +- goroutines +- govulncheck +- hapee +- haproxy +- healthz +- hostname +- html +- http +- httpCLF +- infos +- ipam +- jose +- json +- jsonpath +- kasbin +- kpi +- kubebuilder +- kubernetes +- lifecycle +- linter +- linters +- lookups +- lts +- makefile +- maxconn +- mexchanger +- minimalistic +- mixin +- mkdir +- multipartsearch +- multiselect +- mutex +- mutexes +- namespace +- namespaces +- openapi +- optim +- param +- params +- parallelize +- passthrough +- podman +- pre +- quic +- rbac +- reimplement +- releaser +- repo +- req +- rsync +- ruleset +- rulesets +- saml +- schemas +- scrollbar +- scss +- searchselect +- spammy +- ssl +- sso +- struct +- subnet +- subresource +- subresources +- sudo +- syslog +- tcp +- timeseries +- tls +- tooltip +- tsconfig +- ubuntu +- uid +- uniq +- unix +- unsub +- uri +- url +- userlist +- userlists +- utils +- vfg +- vite +- vrrp +- vue +- waf +- wafadvanced +- workdir +- yaml diff --git a/.github/workflows/.goreleaser.yml b/.github/workflows/.goreleaser.yml index 013845cb..9c9acb43 100644 --- a/.github/workflows/.goreleaser.yml +++ b/.github/workflows/.goreleaser.yml @@ -8,14 +8,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v6 with: # we have to fetch all history to be able to generate the release note. c.f. https://goreleaser.com/ci/actions/. fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v6 with: - go-version-file: 'go.mod' + go-version: '1.26' check-latest: true - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3ba59d6..a91ef46b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,24 +4,20 @@ on: branches: - master jobs: - build: name: Build runs-on: ubuntu-latest steps: - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version-file: 'go.mod' - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v3 - - - name: Get dependencies - run: | - go get -v -t -d ./... - - name: Build - run: | - go build -v . + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + id: go + - name: Get dependencies + run: | + go get -v -t -d ./... + - name: Build + run: | + go build -v . diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2c164208..7068f888 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,4 +1,4 @@ -name: Commit subject +name: HAProxy check commit message on: pull_request: branches: @@ -7,7 +7,7 @@ jobs: check: runs-on: ubuntu-latest steps: - - name: check-commit - uses: docker://haproxytech/check-commit:v2.1.0 + - name: commit-policy + uses: docker://ghcr.io/haproxytech/commit-check:5.0.4 env: API_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8f7131a1..646926fc 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -8,17 +8,17 @@ jobs: name: HAProxy strategy: matrix: - haproxy_version: ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9"] + haproxy_version: ["3.0"] runs-on: ubuntu-latest steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v3 - - name: Downloading required packages - run: sudo apt-get install bats - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version-file: 'go.mod' - - run: make e2e - env: - HAPROXY_VERSION: ${{ matrix.haproxy_version }} + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + - name: Downloading required packages + run: sudo apt-get install bats + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - run: make e2e + env: + HAPROXY_VERSION: ${{ matrix.haproxy_version }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b0c36627..73a19e3f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,12 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: | ~/.cache/go-build @@ -31,12 +31,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code into the Go module directory - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: | ~/.cache/go-build diff --git a/.github/workflows/manual_goreleaser.yml b/.github/workflows/manual_goreleaser.yml index 10fd578a..f1cb4b94 100644 --- a/.github/workflows/manual_goreleaser.yml +++ b/.github/workflows/manual_goreleaser.yml @@ -6,12 +6,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # we have to fetch all history to be able to generate the release note. c.f. https://goreleaser.com/ci/actions/. fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' check-latest: true diff --git a/.gitignore b/.gitignore index ddef4a60..cf3c6795 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ cmd/dataplaneapi/* .vscode/ .test/ bin/golangci-lint +bin/check-commit # ignore Goland ide config .idea diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb69fcb0..70eaab68 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,15 +1,29 @@ stages: + - bots - lint + - checks - build - test - e2e variables: DOCKER_HOST: tcp://docker:2375 DOCKER_BASE_IMAGE: $CI_REGISTRY_GO/haproxy-debian - BATS_VERSION: v1.4.1 - GO_VERSION: "1.22" - DOCKER_VERSION: "26.0" + BATS_VERSION: v1.10.0 + GO_VERSION: "1.26" + DOCKER_VERSION: "29.1" +pipelines-check: + stage: bots + needs: [] + image: + name: $CI_REGISTRY_GO/docker:$DOCKER_VERSION-go$GO_VERSION + entrypoint: [""] + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + tags: + - go + script: + - go run cmd/gitlab-mr-pipelines/main.go diff: stage: lint image: @@ -72,10 +86,10 @@ gofumpt: script: - make gofumpt - test -z "$(git diff 2> /dev/null)" || exit 'Go code not formatted, issue \`make gofumpt\` and commit the result' -lint-commit-msg: +commit-policy: stage: lint image: - name: $CI_REGISTRY_GO/check-commit:v2.1.0 + name: $CI_REGISTRY_GO/commit-check:5.4.2 entrypoint: [""] tags: - go @@ -137,46 +151,38 @@ test: before_script: - apk add git bash curl jq git - git clone https://github.com/bats-core/bats-core.git && cd bats-core && git checkout $BATS_VERSION && ./install.sh /usr/local && cd .. - - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY_GO + - docker login -u='$app' -p $CI_REGISTRY_TOKEN $CI_REGISTRY_GO script: - bash -x ./e2e/run.bash rules: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == 'push' -HAProxy_2_2: - extends: .e2e - parallel: - matrix: - - TESTPART: ["1/2", "2/2"] - HAPROXY_VERSION: "2.2" -HAProxy_2_4: - extends: .e2e - parallel: - matrix: - - TESTPART: ["1/2", "2/2"] - HAPROXY_VERSION: "2.4" -HAProxy_2_6: - extends: .e2e - parallel: - matrix: - - TESTPART: ["1/2", "2/2"] - HAPROXY_VERSION: "2.6" -HAProxy_2_8: - extends: .e2e - parallel: - matrix: - - TESTPART: ["1/2", "2/2"] - HAPROXY_VERSION: "2.8" -HAProxy_2_9: - extends: .e2e - parallel: - matrix: - - TESTPART: ["1/2", "2/2"] - HAPROXY_VERSION: "2.9" +govulncheck: + stage: checks + needs: [] + image: + name: $CI_REGISTRY_GO/docker:$DOCKER_VERSION-go$GO_VERSION + entrypoint: [ "" ] + rules: + - if: $CI_PIPELINE_SOURCE == 'schedule' && $SCHEDULE_TYPE == 'daily' + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + changes: + - go.mod + - if: "$CI_PROJECT_NAMESPACE == 'haproxy-controller' && $CI_PIPELINE_SOURCE == 'push'" + changes: + - go.mod + tags: + - go + script: + - go install golang.org/x/vuln/cmd/govulncheck@latest + - govulncheck -version + - go mod tidy + - go run cmd/govulncheck-report/main.go + HAProxy_3_0: extends: .e2e parallel: matrix: - - TESTPART: ["1/2", "2/2"] + - TESTPART: ["1/4", "2/4", "3/4", "4/4"] HAPROXY_VERSION: "3.0" diff --git a/.golangci.yml b/.golangci.yml index cbcf2149..2eebe346 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,92 +1,104 @@ -linters-settings: - golint: - min-confidence: 0 - gocyclo: - min-complexity: 42 - cyclop: - max-complexity: 42 - maligned: - suggest-new: true - dupl: - threshold: 200 - goconst: - min-len: 2 - min-occurrences: 2 - revive: - rules: - - name: var-naming - severity: warning - disabled: true +version: "2" linters: - enable-all: true + default: all disable: + - containedctx + - contextcheck + - depguard - dupl + - err113 + - errcheck + - errorlint - exhaustive - - exhaustivestruct + - exhaustruct + - forbidigo + - forcetypeassert + - funcorder - funlen - - gci - gochecknoglobals - gocognit - goconst + - gocritic - gocyclo + - godoclint - godot - - goerr113 - - gomnd + - godox + - ireturn - lll + - mnd + - nakedret - nestif - nlreturn - - wrapcheck - - wsl - - nakedret - - paralleltest - - testpackage - - varnamelen - - nosnakecase - - exhaustruct - - nonamedreturns - - forcetypeassert - - golint #deprecated - - varcheck #deprecated - - ifshort #deprecated - - structcheck #deprecated - - maligned #deprecated - - scopelint #deprecated - - interfacer #deprecated - - deadcode #deprecated - - rowserrcheck #rowserrcheck is disabled because of generics - - sqlclosecheck #rowserrcheck is disabled because of generics - - wastedassign #rowserrcheck is disabled because of generics - - ireturn - - tagliatelle - noctx - - errorlint - - contextcheck - - godox - - containedctx - - unused - - unparam + - noinlineerr + - nonamedreturns + - paralleltest - prealloc - - forbidigo - - errcheck - - gocritic + - recvcheck + - rowserrcheck + - sqlclosecheck - tagalign - - depguard - -issues: - exclude: - # bugs of typecheck linter - - "undeclared name: `shellquote`" - - 'github.com/kballard/go-shellquote" imported but not used' - - 'github.com/haproxytech/client-native/v6/config-parser/types" imported but not used' - exclude-rules: - - linters: - - staticcheck - text: "duplicate struct tag" - - linters: - - gosec - text: "G[501]" - - linters: - - gosec - text: "G[404]" - exclude-dirs: - - test + - tagliatelle + - testpackage + - unparam + - unused + - varnamelen + - wastedassign + - wrapcheck + - wsl + - wsl_v5 + settings: + cyclop: + max-complexity: 42 + dupl: + threshold: 200 + goconst: + min-len: 2 + min-occurrences: 2 + gocyclo: + min-complexity: 42 + revive: + rules: + - name: var-naming + severity: warning + disabled: true + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - staticcheck + text: duplicate struct tag + - linters: + - gosec + text: G[501] + - linters: + - gosec + text: G[404] + - path: (.+)\.go$ + text: 'undeclared name: `shellquote`' + - path: (.+)\.go$ + text: github.com/kballard/go-shellquote" imported but not used + - path: (.+)\.go$ + text: github.com/haproxytech/client-native/v6/config-parser/types" imported but not used + paths: + - test + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - gofumpt + - goimports + exclusions: + generated: lax + paths: + - test + - third_party$ + - builtin$ + - examples$ diff --git a/Makefile b/Makefile index 7083aa79..4b244a28 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,8 @@ GIT_MODIFIED=${GIT_MODIFIED1}${GIT_MODIFIED2} SWAGGER_VERSION=${shell curl -s https://raw.githubusercontent.com/haproxytech/client-native/master/Makefile | grep SWAGGER_VERSION -m 1 | awk -F"=" '{print $$2}'} BUILD_DATE=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ') CGO_ENABLED?=0 -GOLANGCI_LINT_VERSION=1.57.1 +GOLANGCI_LINT_VERSION=2.11.1 +CHECK_COMMIT=5.4.0 all: update clean build @@ -65,3 +66,8 @@ generate-native: .PHONY: test test: go test ./... + +.PHONY: check-commit +check-commit: + cd bin;CHECK_COMMIT=${CHECK_COMMIT} sh check-commit.sh + bin/check-commit diff --git a/adapters/adapters.go b/adapters/adapters.go index df5cd2a7..9c4bc137 100644 --- a/adapters/adapters.go +++ b/adapters/adapters.go @@ -85,7 +85,7 @@ func RecoverMiddleware(logger *log.Logger) func(h http.Handler) http.Handler { if err := recover(); err != nil { frames := callers() - fields := make(map[string]interface{}) + fields := make(map[string]any) fields["stack_trace"] = frames.String() logger.WithFieldsf(fields, log.ErrorLevel, "Panic %v", err) diff --git a/bin/check-commit.sh b/bin/check-commit.sh new file mode 100644 index 00000000..b7390b51 --- /dev/null +++ b/bin/check-commit.sh @@ -0,0 +1,9 @@ +#!/bin/sh +V=$(./check-commit tag) + +if echo "$V" | grep -q "v$CHECK_COMMIT"; then + echo "$V" +else + echo "go install github.com/haproxytech/check-commit/v5@v$CHECK_COMMIT" + GOBIN=$(pwd) go install github.com/haproxytech/check-commit/v5@v$CHECK_COMMIT +fi diff --git a/client-native/cn.go b/client-native/cn.go index b642b384..3c955e14 100644 --- a/client-native/cn.go +++ b/client-native/cn.go @@ -34,6 +34,7 @@ func ConfigureConfigurationClient(haproxyOptions dataplaneapi_config.HAProxyConf configuration_options.UsePersistentTransactions, configuration_options.TransactionsDir(haproxyOptions.TransactionDir), configuration_options.ValidateCmd(haproxyOptions.ValidateCmd), + configuration_options.ValidateConfigFiles(haproxyOptions.ValidateFilesBefore, haproxyOptions.ValidateFilesAfter), configuration_options.MasterWorker, configuration_options.UseMd5Hash, configuration_options.PreferredTimeSuffix(haproxyOptions.PreferredTimeSuffix), @@ -44,10 +45,7 @@ func ConfigureConfigurationClient(haproxyOptions dataplaneapi_config.HAProxyConf p := confClient.Parser() comments, err := p.Get(parser.Comments, parser.CommentsSectionName, "#") - insertDisclaimer := false - if err != nil { - insertDisclaimer = true - } + insertDisclaimer := err != nil data, ok := comments.([]types.Comments) if !ok { insertDisclaimer = true diff --git a/cmd/dataplaneapi/main.go b/cmd/dataplaneapi/main.go index c808512a..1aecfe2b 100644 --- a/cmd/dataplaneapi/main.go +++ b/cmd/dataplaneapi/main.go @@ -127,7 +127,7 @@ func startServer(cfg *configuration.Configuration, cancelDebugServer context.Can fmt.Printf("HAProxy Data Plane API %s %s%s\n\n", GitTag, GitCommit, GitDirty) fmt.Printf("Build from: %s\n", GitRepo) fmt.Printf("Build date: %s\n\n", BuildTime) - return + return reload } var loadMsg []string @@ -227,7 +227,7 @@ func startServer(cfg *configuration.Configuration, cancelDebugServer context.Can api.BasicAuthenticator = func(authentication security.UserPassAuthentication) runtime.Authenticator { // if mTLS is enabled with backing Certificate Authority, skipping basic authentication if len(server.TLSCACertificate) > 0 && server.TLSPort > 0 { - return runtime.AuthenticatorFunc(func(i interface{}) (bool, interface{}, error) { + return runtime.AuthenticatorFunc(func(i any) (bool, any, error) { return true, "", nil }) } diff --git a/cmd/gitlab-mr-pipelines/ascii.txt b/cmd/gitlab-mr-pipelines/ascii.txt new file mode 100644 index 00000000..d3b21f22 --- /dev/null +++ b/cmd/gitlab-mr-pipelines/ascii.txt @@ -0,0 +1,11 @@ + ____ _ _ _ _ + / ___(_) |_| | __ _| |__ + | | _| | __| |/ _` | '_ \ + | |_| | | |_| | (_| | |_) | + \____|_|\__|_|\__,_|_.__/ + ____ _ _ _ _ _ + | _ \(_)_ __ ___| (_)_ __ ___ ___| |__ ___ ___| | __ + | |_) | | '_ \ / _ \ | | '_ \ / _ \ / __| '_ \ / _ \/ __| |/ / + | __/| | |_) | __/ | | | | | __/ | (__| | | | __/ (__| < + |_| |_| .__/ \___|_|_|_| |_|\___| \___|_| |_|\___|\___|_|\_\ + |_| diff --git a/cmd/gitlab-mr-pipelines/main.go b/cmd/gitlab-mr-pipelines/main.go new file mode 100644 index 00000000..709253bf --- /dev/null +++ b/cmd/gitlab-mr-pipelines/main.go @@ -0,0 +1,159 @@ +// Copyright 2019 HAProxy Technologies LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package main + +import ( + _ "embed" + "encoding/json" + "fmt" + "io" + "net/http" + "os" + "strconv" + "strings" +) + +//go:embed ascii.txt +var hello string + +//nolint:forbidigo +func main() { + fmt.Println(hello) + // Check if we are in a merge request context + mrIID := os.Getenv("CI_MERGE_REQUEST_IID") + if mrIID == "" { + fmt.Println("Not a merge request. Exiting.") + os.Exit(0) + } + + // Get necessary environment variables + gitlabAPIURL := os.Getenv("CI_API_V4_URL") + projectID := os.Getenv("CI_PROJECT_ID") + sourceProjectID := os.Getenv("CI_MERGE_REQUEST_SOURCE_PROJECT_ID") + gitlabToken := os.Getenv("GITLAB_TOKEN") + + if gitlabAPIURL == "" || projectID == "" || sourceProjectID == "" { + fmt.Println("Missing required GitLab CI/CD environment variables.") + os.Exit(1) + } + + if gitlabToken == "" { + fmt.Print("GitLab token not found in environment variable.\n") + os.Exit(1) + } + + // 1. Get all old pipelines for this Merge Request + pipelinesToCancel, err := getOldMergeRequestPipelines(gitlabAPIURL, projectID, mrIID, gitlabToken) + if err != nil { + fmt.Printf("Error getting merge request pipelines: %v\n", err) + os.Exit(1) + } + + if len(pipelinesToCancel) == 0 { + fmt.Println("No old, running pipelines found for this merge request.") + os.Exit(0) + } + + fmt.Printf("Found %d old pipelines to cancel.\n", len(pipelinesToCancel)) + + // 2. Cancel all found pipelines + for _, p := range pipelinesToCancel { + fmt.Printf("Canceling pipeline ID %d on project ID %d\n", p.ID, p.ProjectID) + err = cancelPipeline(gitlabAPIURL, strconv.Itoa(p.ProjectID), p.ID, gitlabToken) + if err != nil { + // Log error but continue trying to cancel others + fmt.Printf("Failed to cancel pipeline %d: %v\n", p.ID, err) + } else { + fmt.Printf("Successfully requested cancellation for pipeline %d\n", p.ID) + } + } +} + +type pipelineInfo struct { + ID int `json:"id"` + ProjectID int `json:"project_id"` + Status string `json:"status"` +} + +func getOldMergeRequestPipelines(apiURL, projectID, mrIID, token string) ([]pipelineInfo, error) { + // Get the current pipeline ID to avoid canceling ourselves + currentPipelineIDStr := os.Getenv("CI_PIPELINE_ID") + var currentPipelineID int + if currentPipelineIDStr != "" { + // a non-integer value will result in 0, which is fine since pipeline IDs are positive + currentPipelineID, _ = strconv.Atoi(currentPipelineIDStr) + } + + url := fmt.Sprintf("%s/projects/%s/merge_requests/%s/pipelines", apiURL, projectID, mrIID) + req, err := http.NewRequest("GET", url, nil) //nolint:noctx,usestdlibvars,gosec // URL constructed from trusted CI environment variables + if err != nil { + return nil, err + } + req.Header.Set("PRIVATE-TOKEN", token) //nolint:canonicalheader + + client := &http.Client{} + resp, err := client.Do(req) //nolint:gosec // URL constructed from trusted CI environment variables + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + body, _ := io.ReadAll(resp.Body) + return nil, fmt.Errorf("failed to list merge request pipelines: status %d, body: %s", resp.StatusCode, string(body)) + } + + var pipelines []pipelineInfo + if err := json.NewDecoder(resp.Body).Decode(&pipelines); err != nil { + return nil, err + } + + var pipelinesToCancel []pipelineInfo + for _, p := range pipelines { + // Cancel pipelines that are running or pending, and are not the current pipeline + if (p.Status == "running" || p.Status == "pending") && p.ID != currentPipelineID { + pipelinesToCancel = append(pipelinesToCancel, p) + } + } + + return pipelinesToCancel, nil +} + +func cancelPipeline(apiURL, projectID string, pipelineID int, token string) error { + url := fmt.Sprintf("%s/projects/%s/pipelines/%d/cancel", apiURL, projectID, pipelineID) + req, err := http.NewRequest("POST", url, nil) //nolint:noctx,usestdlibvars,gosec // URL constructed from trusted CI environment variables + if err != nil { + return err + } + req.Header.Set("PRIVATE-TOKEN", token) //nolint:canonicalheader + + client := &http.Client{} + resp, err := client.Do(req) //nolint:gosec // URL constructed from trusted CI environment variables + if err != nil { + return err + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + body, _ := io.ReadAll(resp.Body) + // It's possible the pipeline is already finished. + if strings.Contains(string(body), "Cannot cancel a pipeline that is not pending or running") { + fmt.Println("Pipeline already finished, nothing to do.") //nolint:forbidigo + return nil + } + return fmt.Errorf("failed to cancel pipeline: status %d, body: %s", resp.StatusCode, string(body)) + } + + return nil +} diff --git a/cmd/govulncheck-report/main.go b/cmd/govulncheck-report/main.go new file mode 100644 index 00000000..a02dc4fe --- /dev/null +++ b/cmd/govulncheck-report/main.go @@ -0,0 +1,359 @@ +package main + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "os" + "os/exec" + "strconv" + "strings" +) + +type Note struct { + Body string `json:"body"` + ID int `json:"id"` +} + +type Issue struct { + Title string `json:"title"` + State string `json:"state"` + ID int `json:"id"` + IID int `json:"iid"` +} + +type Thread struct { + Body string `json:"body"` + ID int `json:"id"` + IID int `json:"iid"` +} + +const baseURL = "https://gitlab.int.haproxy.com/api/v4" + +func main() { + fmt.Print(hello) + logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{ + AddSource: true, + ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr { + if a.Key == "source" { + x := a.Value + src := x.Any().(*slog.Source) + path := strings.Split(src.File, "/") + src.File = path[len(path)-1] + return slog.Attr{ + Key: "source", + Value: slog.AnyValue(src), + } + } + return a + }, + })) + slog.SetDefault(logger) + + slog.Info("Starting GoVulnCheck") + mergeRequestMode := false + currentBranch := os.Getenv("CI_COMMIT_BRANCH") + if currentBranch == "" { + currentBranch = os.Getenv("CI_MERGE_REQUEST_SOURCE_BRANCH_NAME") + mergeRequestMode = true + } + if currentBranch == "" { + cmd := exec.Command("git", "branch", "--show-current") + out, err := cmd.Output() + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + currentBranch = string(out) + } + slog.Info("Current branch: " + currentBranch) //nolint:gosec // log message from trusted CI environment variables + + cmd := exec.Command("govulncheck", "./...") + out, _ := cmd.Output() + + vulnMessage := string(out) + fmt.Println(vulnMessage) + noVuln := !strings.Contains(vulnMessage, "Vulnerability #") + + if currentBranch == "" { + if strings.Contains(vulnMessage, "Vulnerability #") { + slog.Error(vulnMessage) + os.Exit(1) + } + slog.Info("Current branch is empty, exiting...") + os.Exit(0) + } + + if mergeRequestMode { + if strings.Contains(vulnMessage, "Vulnerability #") { + os.Exit(1) + } + slog.Info("no vulnerabilities found") + os.Exit(0) + } + + token := os.Getenv("GITLAB_GOPHERS_TOKEN") + projectID := "534" + title := "Data Plane API: GoVulnCheck: Branch: " + strings.Trim(currentBranch, "\n") + + userID, err := fetchUserID(token) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + + issues, err := fetchOpenIssues(projectID, userID, token) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + + found := false + var issueFound Issue + for _, issue := range issues { + if issue.Title == title && issue.State == "opened" { + found = true + issueFound = issue + break + } + } + vulnMessage = "```\n" + vulnMessage + "\n```" + if found { + if noVuln { + closeTheIssue(baseURL, token, projectID, issueFound.IID, "No vulnerability found.") + } else { + addCommentToIssue(baseURL, token, projectID, issueFound.IID, vulnMessage) + } + } else if !noVuln { + createIssue(baseURL, token, projectID, title, vulnMessage) + } + slog.Info("GoVulnCheck done.") +} + +func createIssue(baseURL, token, projectID string, title, commentBody string) { + slog.Info("Active issue with title '" + title + "' not found in project " + projectID) //nolint:gosec // log message from trusted CI environment variables + // Create the issue here + issueData := map[string]any{ + "title": title, + "description": commentBody, + "labels": "bot,critical", + // Add other fields as needed + } + issueDataBytes, err := json.Marshal(issueData) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + + req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/projects/%s/issues", baseURL, url.PathEscape(projectID)), bytes.NewBuffer(issueDataBytes)) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + req.Header.Add("Private-Token", token) + req.Header.Add("Content-Type", "application/json") + + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + + var issue Issue + err = json.Unmarshal(body, &issue) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + + slog.Info("Issue created with ID " + strconv.Itoa(issue.ID)) +} + +func closeTheIssue(baseURL, token, projectID string, issueIID int, commentBody string) { + addCommentToIssue(baseURL, token, projectID, issueIID, commentBody) + + client := &http.Client{} + issueData := map[string]any{ + "state_event": "close", + } + issueDataBytes, err := json.Marshal(issueData) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + + req, err := http.NewRequest(http.MethodPut, fmt.Sprintf("%s/projects/%s/issues/%d", baseURL, url.PathEscape(projectID), issueIID), bytes.NewBuffer(issueDataBytes)) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + req.Header.Add("Private-Token", token) + req.Header.Add("Content-Type", "application/json") + + resp, err := client.Do(req) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + + var issue Issue + err = json.Unmarshal(body, &issue) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + + slog.Info("Issue " + strconv.Itoa(issue.IID) + " closed") +} + +func addCommentToIssue(baseURL, token, projectID string, issueIID int, commentBody string) { + client := &http.Client{} + noteData := map[string]any{ + "body": commentBody, + } + noteDataBytes, err := json.Marshal(noteData) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + + req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/projects/%s/issues/%d/notes", baseURL, url.PathEscape(projectID), issueIID), bytes.NewBuffer(noteDataBytes)) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + req.Header.Add("Private-Token", token) + req.Header.Add("Content-Type", "application/json") + + resp, err := client.Do(req) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + + var note Note + err = json.Unmarshal(body, ¬e) + if err != nil { + slog.Error(err.Error()) + os.Exit(1) + } + + slog.Info("Comment added with ID " + strconv.Itoa(note.ID)) +} + +func fetchOpenIssues(projectID string, userID int, accessToken string) ([]Issue, error) { + perPage := 20 // Number of issues to fetch per page + + var allIssues []Issue + page := 1 + + for { + url := fmt.Sprintf("%s/projects/%s/issues?state=opened&author_id=%s&page=%d&per_page=%d", baseURL, projectID, strconv.Itoa(userID), page, perPage) + + req, err := http.NewRequest(http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + req.Header.Set("Authorization", "Bearer "+accessToken) + + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + var issues []Issue + err = json.Unmarshal(body, &issues) + if err != nil { + return nil, err + } + + allIssues = append(allIssues, issues...) + + // Check if there are more pages + linkHeader := resp.Header.Get("Link") + if !strings.Contains(linkHeader, `rel="next"`) { + break + } + + page++ + } + + return allIssues, nil +} + +func fetchUserID(accessToken string) (int, error) { + url := baseURL + "/user" + + req, err := http.NewRequest(http.MethodGet, url, nil) + if err != nil { + return 0, err + } + + req.Header.Set("Authorization", "Bearer "+accessToken) + + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return 0, err + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + return 0, err + } + + var user struct { + ID int `json:"id"` + } + + err = json.Unmarshal(body, &user) + if err != nil { + return 0, err + } + + return user.ID, nil +} + +const hello = ` + _ _ _ + __ _ _____ ___ _| |_ __ ___| |__ ___ ___| | __ + / _` + "`" + ` |/ _ \ \ / / | | | | '_ \ / __| '_ \ / _ \/ __| |/ / +| (_| | (_) \ V /| |_| | | | | | (__| | | | __/ (__| < + \__, |\___/ \_/ \__,_|_|_| |_|\___|_| |_|\___|\___|_|\_\ + |___/ +` diff --git a/configuration/README.md b/configuration/README.md index 57eca85f..7f81724c 100644 --- a/configuration/README.md +++ b/configuration/README.md @@ -70,5 +70,5 @@ The way `cluster` vs `single` is now handled is as following: | Mode | /cluster.json content | |-----------|-------------------| -| Single| `cluster` attribute is not empty| -| Cluster| `cluster` attribute is empty | +| Single| `cluster` attribute is empty| +| Cluster| `cluster` attribute is not empty | diff --git a/configuration/bool.go b/configuration/bool.go index 6b89a089..6edd20bd 100644 --- a/configuration/bool.go +++ b/configuration/bool.go @@ -42,7 +42,7 @@ func (s *AtomicBool) String() string { return "false" } -func (s *AtomicBool) UnmarshalYAML(unmarshal func(interface{}) error) error { +func (s *AtomicBool) UnmarshalYAML(unmarshal func(any) error) error { var buf bool err := unmarshal(&buf) if err != nil { @@ -53,6 +53,6 @@ func (s *AtomicBool) UnmarshalYAML(unmarshal func(interface{}) error) error { return nil } -func (s AtomicBool) MarshalYAML() (interface{}, error) { +func (s AtomicBool) MarshalYAML() (any, error) { return s.Load(), nil } diff --git a/configuration/configuration.go b/configuration/configuration.go index 62634fdc..ad0d4f51 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -49,6 +49,8 @@ type HAProxyConfiguration struct { ReloadStrategy string `long:"reload-strategy" description:"Either systemd, s6 or custom" default:"custom" group:"reload"` TransactionDir string `short:"t" long:"transaction-dir" description:"Path to the transaction directory" default:"/tmp/haproxy" group:"transaction"` ValidateCmd string `long:"validate-cmd" description:"Executes a custom command to perform the HAProxy configuration check" group:"reload"` + ValidateFilesBefore []string `long:"validate-files-before" description:"A list of configuration files to be loaded before the main file for validation" group:"reload"` + ValidateFilesAfter []string `long:"validate-files-after" description:"A list of configuration files to be loaded after the main file for validation" group:"reload"` BackupsDir string `long:"backups-dir" description:"Path to directory in which to place backup files" group:"transaction"` MapsDir string `short:"p" long:"maps-dir" description:"Path to directory of map files managed by dataplane" default:"/etc/haproxy/maps" group:"resources"` SpoeTransactionDir string `long:"spoe-transaction-dir" description:"Path to the SPOE transaction directory" default:"/tmp/spoe-haproxy" group:"resources"` @@ -324,7 +326,7 @@ func (c *Configuration) LoadDataplaneStorageConfig() ([]string, error) { } func (c *Configuration) LoadRuntimeVars(swaggerJSON json.RawMessage, host string, port int) error { - var m map[string]interface{} + var m map[string]any json := jsoniter.ConfigCompatibleWithStandardLibrary err := json.Unmarshal(swaggerJSON, &m) if err != nil { diff --git a/configuration/configuration_deprecated.go b/configuration/configuration_deprecated.go index 88d80634..c0120245 100644 --- a/configuration/configuration_deprecated.go +++ b/configuration/configuration_deprecated.go @@ -73,40 +73,42 @@ func (c *Configuration) migrateUsers() ([]string, error) { clusterModeStoragePath := path.Join(c.HAProxy.DataplaneStorageDir, storage.ClusterModeDataFileName) usersToMigrate := make([]storagetype.User, 0) - for _, singleModeUser := range dapiCfgStorage.Dataplaneapi.Users { - found := false - // Only migrate cluster users - if !singleModeUser.IsClusterUser() { - continue - } + if dapiCfgStorage.Dataplaneapi != nil { + for _, singleModeUser := range dapiCfgStorage.Dataplaneapi.Users { + found := false + // Only migrate cluster users + if !singleModeUser.IsClusterUser() { + continue + } - var muser storagetype.User - for _, muser = range dapiStorageUsers { - if muser.Name == singleModeUser.Name { - found = true - break + var muser storagetype.User + for _, muser = range dapiStorageUsers { + if muser.Name == singleModeUser.Name { + found = true + break + } } - } - // Already migrated - if found { - msg := fmt.Sprintf("[CFG DEPRECATED] [SKIP] [User] [%s]: already migrated. Old location [%s] New location [%s]. Use only new location", - singleModeUser.Name, - c.HAProxy.DataplaneConfig, - clusterModeStoragePath) - // Logging is not done here as at startup, the logger is not yet initialized - // so it's done later on - deprecationInfoMsg = append(deprecationInfoMsg, msg) - } else { - // If not already migrated, then migrate it - msg := fmt.Sprintf("[CFG DEPRECATED] [MIGRATE] [User] [%s]: migrating. Old location [%s] New location [%s]. Use only new location", - singleModeUser.Name, - c.HAProxy.DataplaneConfig, - clusterModeStoragePath) - // Logging is not done here as at startup, the logger is not yet initialized - // so it's done later on - deprecationInfoMsg = append(deprecationInfoMsg, msg) - usersToMigrate = append(usersToMigrate, singleModeUser) + // Already migrated + if found { + msg := fmt.Sprintf("[CFG DEPRECATED] [SKIP] [User] [%s]: already migrated. Old location [%s] New location [%s]. Use only new location", + singleModeUser.Name, + c.HAProxy.DataplaneConfig, + clusterModeStoragePath) + // Logging is not done here as at startup, the logger is not yet initialized + // so it's done later on + deprecationInfoMsg = append(deprecationInfoMsg, msg) + } else { + // If not already migrated, then migrate it + msg := fmt.Sprintf("[CFG DEPRECATED] [MIGRATE] [User] [%s]: migrating. Old location [%s] New location [%s]. Use only new location", + singleModeUser.Name, + c.HAProxy.DataplaneConfig, + clusterModeStoragePath) + // Logging is not done here as at startup, the logger is not yet initialized + // so it's done later on + deprecationInfoMsg = append(deprecationInfoMsg, msg) + usersToMigrate = append(usersToMigrate, singleModeUser) + } } } if err := c.clusterModeStorage.AddUsersAndStore(usersToMigrate); err != nil { diff --git a/configuration/configuration_storage.go b/configuration/configuration_storage.go index b7437a46..16deb61f 100644 --- a/configuration/configuration_storage.go +++ b/configuration/configuration_storage.go @@ -81,14 +81,16 @@ type configTypeUserlist struct { } type configTypeReload struct { - ReloadDelay *int `yaml:"reload_delay,omitempty"` - ReloadCmd *string `yaml:"reload_cmd,omitempty"` - RestartCmd *string `yaml:"restart_cmd,omitempty"` - StatusCmd *string `yaml:"status_cmd,omitempty"` - ServiceName *string `yaml:"service_name,omitempty"` - ReloadRetention *int `yaml:"reload_retention,omitempty"` - ReloadStrategy *string `yaml:"reload_strategy,omitempty"` - ValidateCmd *string `yaml:"validate_cmd,omitempty"` + ReloadDelay *int `yaml:"reload_delay,omitempty"` + ReloadCmd *string `yaml:"reload_cmd,omitempty"` + RestartCmd *string `yaml:"restart_cmd,omitempty"` + StatusCmd *string `yaml:"status_cmd,omitempty"` + ServiceName *string `yaml:"service_name,omitempty"` + ReloadRetention *int `yaml:"reload_retention,omitempty"` + ReloadStrategy *string `yaml:"reload_strategy,omitempty"` + ValidateCmd *string `yaml:"validate_cmd,omitempty"` + ValidateFilesBefore *[]string `yaml:"validate_files_before,omitempty"` + ValidateFilesAfter *[]string `yaml:"validate_files_after,omitempty"` } type configTypeTransaction struct { @@ -252,6 +254,12 @@ func copyToConfiguration(cfg *Configuration) { //nolint:cyclop,maintidx if cfgStorage.Haproxy != nil && cfgStorage.Haproxy.Reload != nil && cfgStorage.Haproxy.Reload.ValidateCmd != nil && !misc.HasOSArg("", "validate-cmd", "") { cfg.HAProxy.ValidateCmd = *cfgStorage.Haproxy.Reload.ValidateCmd } + if cfgStorage.Haproxy != nil && cfgStorage.Haproxy.Reload != nil && cfgStorage.Haproxy.Reload.ValidateFilesBefore != nil && !misc.HasOSArg("", "validate-files-before", "") { + cfg.HAProxy.ValidateFilesBefore = *cfgStorage.Haproxy.Reload.ValidateFilesBefore + } + if cfgStorage.Haproxy != nil && cfgStorage.Haproxy.Reload != nil && cfgStorage.Haproxy.Reload.ValidateFilesAfter != nil && !misc.HasOSArg("", "validate-files-after", "") { + cfg.HAProxy.ValidateFilesAfter = *cfgStorage.Haproxy.Reload.ValidateFilesAfter + } if cfgStorage.Dataplaneapi != nil && cfgStorage.Dataplaneapi.Transaction != nil && cfgStorage.Dataplaneapi.Transaction.TransactionDir != nil && !misc.HasOSArg("t", "transaction-dir", "") { cfg.HAProxy.TransactionDir = *cfgStorage.Dataplaneapi.Transaction.TransactionDir } @@ -355,22 +363,19 @@ func copyConfigurationToStorage(cfg *Configuration) { cfgStorage.Dataplaneapi.Advertised = &configTypeAdvertised{} } cfgStorage.Dataplaneapi.Advertised.APIAddress = &cfg.APIOptions.APIAddress + cfgStorage.Dataplaneapi.Advertised.APIPort = &cfg.APIOptions.APIPort - if cfgStorage.Dataplaneapi == nil { - cfgStorage.Dataplaneapi = &configTypeDataplaneapi{} + if cfgStorage.Dataplaneapi.Userlist == nil { + cfgStorage.Dataplaneapi.Userlist = &configTypeUserlist{} } - if cfgStorage.Dataplaneapi.Advertised == nil { - cfgStorage.Dataplaneapi.Advertised = &configTypeAdvertised{} - } - cfgStorage.Dataplaneapi.Advertised.APIPort = &cfg.APIOptions.APIPort - cfgStorage.Dataplaneapi.Advertised.APIPort = &cfg.APIOptions.APIPort + cfgStorage.Dataplaneapi.Userlist.Userlist = &cfg.HAProxy.Userlist + cfgStorage.Dataplaneapi.Userlist.UserListFile = &cfg.HAProxy.UserListFile if cfgStorage.Haproxy == nil { cfgStorage.Haproxy = &configTypeHaproxy{ Reload: &configTypeReload{}, } } - cfgStorage.Haproxy.Reload.ReloadStrategy = &cfg.HAProxy.ReloadStrategy if cfgStorage.LogTargets == nil { @@ -382,14 +387,16 @@ func copyConfigurationToStorage(cfg *Configuration) { func (cfgStorage *StorageDataplaneAPIConfiguration) emptyDeprecatedSections() { cfgStorage.DeprecatedBootstrapKey = nil // Remove Cluster Users from dapi configuration file - for i := 0; i < len(cfgStorage.Dataplaneapi.Users); { - if cfgStorage.Dataplaneapi.Users[i].IsClusterUser() { - if len(cfgStorage.Dataplaneapi.Users) > i { - cfgStorage.Dataplaneapi.Users = append(cfgStorage.Dataplaneapi.Users[:i], cfgStorage.Dataplaneapi.Users[i+1:]...) - continue + if cfgStorage.Dataplaneapi != nil { + for i := 0; i < len(cfgStorage.Dataplaneapi.Users); { + if cfgStorage.Dataplaneapi.Users[i].IsClusterUser() { + if len(cfgStorage.Dataplaneapi.Users) > i { + cfgStorage.Dataplaneapi.Users = append(cfgStorage.Dataplaneapi.Users[:i], cfgStorage.Dataplaneapi.Users[i+1:]...) + continue + } } + i++ } - i++ } // Remove Cluster cfgStorage.DeprecatedCluster = nil diff --git a/configuration/dataplane_storage.go b/configuration/dataplane_storage.go index 756725ab..028221c9 100644 --- a/configuration/dataplane_storage.go +++ b/configuration/dataplane_storage.go @@ -51,22 +51,22 @@ func (c *Configuration) SaveClusterModeData() error { cfgCertificateFetched := cfgCluster.CertificateFetched.Load() dapiStorageCluster := storagetype.Cluster{ - APINodesPath: misc.StringP(cfgCluster.APINodesPath.Load()), - Token: misc.StringP(cfgCluster.Token.Load()), + APINodesPath: new(cfgCluster.APINodesPath.Load()), + Token: new(cfgCluster.Token.Load()), ClusterTLSCertDir: &c.HAProxy.ClusterTLSCertDir, - ActiveBootstrapKey: misc.StringP(cfgCluster.ActiveBootstrapKey.Load()), - APIRegisterPath: misc.StringP(cfgCluster.APIRegisterPath.Load()), - URL: misc.StringP(cfgCluster.URL.Load()), + ActiveBootstrapKey: new(cfgCluster.ActiveBootstrapKey.Load()), + APIRegisterPath: new(cfgCluster.APIRegisterPath.Load()), + URL: new(cfgCluster.URL.Load()), Port: &dPort, - StorageDir: misc.StringP(cfgCluster.StorageDir.Load()), - BootstrapKey: misc.StringP(cfgCluster.BootstrapKey.Load()), - ID: misc.StringP(cfgCluster.ID.Load()), - APIBasePath: misc.StringP(cfgCluster.APIBasePath.Load()), - CertificateDir: misc.StringP(cfgCluster.CertificateDir.Load()), + StorageDir: new(cfgCluster.StorageDir.Load()), + BootstrapKey: new(cfgCluster.BootstrapKey.Load()), + ID: new(cfgCluster.ID.Load()), + APIBasePath: new(cfgCluster.APIBasePath.Load()), + CertificateDir: new(cfgCluster.CertificateDir.Load()), CertificateFetched: &cfgCertificateFetched, - Name: misc.StringP(cfgCluster.Name.Load()), - Description: misc.StringP(cfgCluster.Description.Load()), - ClusterID: misc.StringP(cfgCluster.ClusterID.Load()), + Name: new(cfgCluster.Name.Load()), + Description: new(cfgCluster.Description.Load()), + ClusterID: new(cfgCluster.ClusterID.Load()), ClusterLogTargets: cfgCluster.ClusterLogTargets, } cfgStatus := c.Status.Load() @@ -130,7 +130,7 @@ func (c *Configuration) copyClusterToConfiguration(dapiStorageCluster *storagety if dapiStorageCluster.ClusterID != nil && !misc.HasOSArg("", "", "") { c.Cluster.ClusterID.Store(*dapiStorageCluster.ClusterID) } - if dapiStorageCluster.ClusterLogTargets != nil && len(dapiStorageCluster.ClusterLogTargets) > 0 { + if len(dapiStorageCluster.ClusterLogTargets) > 0 { c.Cluster.ClusterLogTargets = dapiStorageCluster.ClusterLogTargets } } diff --git a/configuration/examples/example-full.yaml b/configuration/examples/example-full.yaml index 1a083184..cb89591b 100644 --- a/configuration/examples/example-full.yaml +++ b/configuration/examples/example-full.yaml @@ -71,6 +71,9 @@ haproxy: reload_retention: 1 # int 2 reload_strategy: custom validate_cmd: null # string 2 + validate_files_before: + - "/etc/haproxy/global.def" + validate_files_after: [] # []string cluster: # Deprecated starting 3.0, see ./README.md for more information cluster_tls_dir: null # string id: null # string diff --git a/configuration/int.go b/configuration/int.go index afa08907..0abedc62 100644 --- a/configuration/int.go +++ b/configuration/int.go @@ -40,7 +40,7 @@ func (s *AtomicInt) String() string { return strconv.Itoa(s.Load()) } -func (s *AtomicInt) UnmarshalYAML(unmarshal func(interface{}) error) error { +func (s *AtomicInt) UnmarshalYAML(unmarshal func(any) error) error { var buf int err := unmarshal(&buf) if err != nil { @@ -51,6 +51,6 @@ func (s *AtomicInt) UnmarshalYAML(unmarshal func(interface{}) error) error { return nil } -func (s AtomicInt) MarshalYAML() (interface{}, error) { +func (s AtomicInt) MarshalYAML() (any, error) { return s.Load(), nil } diff --git a/configuration/map_sync.go b/configuration/map_sync.go index edc9a9f1..601f43b2 100644 --- a/configuration/map_sync.go +++ b/configuration/map_sync.go @@ -124,7 +124,7 @@ func equalSomeEntries(fEntries, rEntries models.MapEntries, index ...int) bool { return false } - max := 0 + var maximum int switch l := len(rEntries); { case l > 19: for i := l - 20; i < l; i++ { @@ -132,21 +132,18 @@ func equalSomeEntries(fEntries, rEntries models.MapEntries, index ...int) bool { return false } } - max = l - 19 + maximum = l - 19 case l == 0: return true default: - max = l + maximum = l } - maxRandom := 10 - if max < 10 { - maxRandom = max - } + maxRandom := min(maximum, 10) for range maxRandom { // There's no need for strong number generation, here, just need for performance - r := rand.Intn(max) + r := rand.Intn(maximum) if len(index) > 0 { r = index[0] } diff --git a/configuration/reload-strategy.go b/configuration/reload-strategy.go index 6e1d3377..aee52635 100644 --- a/configuration/reload-strategy.go +++ b/configuration/reload-strategy.go @@ -35,7 +35,7 @@ const ( s6ReloadCmd = "s6-svc -2" s6RestartCmd = "s6-svc -r" s6StatusCmd = "s6-svstat -u" - s6DefaultService = "/etc/service.d/haproxy" + s6DefaultService = "/var/run/service/haproxy" ) // Set a default value to a string. diff --git a/configuration/string.go b/configuration/string.go index be7cdecd..ae166525 100644 --- a/configuration/string.go +++ b/configuration/string.go @@ -39,7 +39,7 @@ func (s *AtomicString) String() string { return s.Load() } -func (s *AtomicString) UnmarshalYAML(unmarshal func(interface{}) error) error { +func (s *AtomicString) UnmarshalYAML(unmarshal func(any) error) error { var buf string err := unmarshal(&buf) if err != nil { @@ -50,6 +50,6 @@ func (s *AtomicString) UnmarshalYAML(unmarshal func(interface{}) error) error { return nil } -func (s AtomicString) MarshalYAML() (interface{}, error) { +func (s AtomicString) MarshalYAML() (any, error) { return s.Load(), nil } diff --git a/configuration/user.go b/configuration/user.go index d7c9423e..6a710b4b 100644 --- a/configuration/user.go +++ b/configuration/user.go @@ -80,13 +80,18 @@ func (u *Users) Init() error { mode := configuration.Mode.Load() allUsers := configuration.GetUsers() // single + cluster mode if len(allUsers) > 0 { - for _, user := range allUsers { - if mode != ModeCluster || strings.HasPrefix(user.Name, storagetype.DapiClusterUserPrefix) { - u.users = append(u.users, types.User{ - Name: user.Name, - IsInsecure: *user.Insecure, - Password: *user.Password, - }) + for _, storageUser := range allUsers { + if mode != ModeCluster || strings.HasPrefix(storageUser.Name, storagetype.DapiClusterUserPrefix) { + user := types.User{ + Name: storageUser.Name, + } + if storageUser.Password != nil { + user.Password = *storageUser.Password + } + if storageUser.Insecure != nil { + user.IsInsecure = *storageUser.Insecure + } + u.users = append(u.users, user) } } return nil @@ -161,7 +166,7 @@ func findUser(userName string, users []types.User) (*types.User, error) { return nil, api_errors.New(401, "no configured users") } -func AuthenticateUser(user string, pass string) (interface{}, error) { +func AuthenticateUser(user string, pass string) (any, error) { users := GetUsersStore().GetUsers() if len(users) == 0 { return nil, api_errors.New(401, "no configured users") @@ -176,7 +181,7 @@ func AuthenticateUser(user string, pass string) (interface{}, error) { if strings.HasPrefix(u.Password, "\"${") && strings.HasSuffix(u.Password, "}\"") { userPass = os.Getenv(misc.ExtractEnvVar(userPass)) if userPass == "" { - return nil, api_errors.New(401, fmt.Sprintf("%s %s", "can not read password from env variable:", u.Password)) + return nil, api_errors.New(401, "%s %s", "can not read password from env variable:", u.Password) } } @@ -184,12 +189,12 @@ func AuthenticateUser(user string, pass string) (interface{}, error) { if pass == userPass { return user, nil } - return nil, api_errors.New(401, fmt.Sprintf("%s %s", "invalid password:", pass)) + return nil, api_errors.New(401, "%s %s", "invalid password:", pass) } if checkPassword(pass, userPass) { return user, nil } - return nil, api_errors.New(401, fmt.Sprintf("%s %s", "invalid password:", pass)) + return nil, api_errors.New(401, "%s %s", "invalid password:", pass) } func checkPassword(pass, storedPass string) bool { diff --git a/configure_data_plane.go b/configure_data_plane.go index 9c2c1ec3..f9d1f6ad 100644 --- a/configure_data_plane.go +++ b/configure_data_plane.go @@ -20,6 +20,7 @@ package dataplaneapi import ( "context" "crypto/tls" + "encoding/json" "io" "net/http" "os" @@ -35,7 +36,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/cmdutils" client_native "github.com/haproxytech/client-native/v6" "github.com/haproxytech/client-native/v6/models" "github.com/haproxytech/client-native/v6/options" @@ -87,25 +88,25 @@ func SetServerStartedCallback(callFunc func()) { func configureFlags(api *operations.DataPlaneAPI) { cfg := dataplaneapi_config.Get() - haproxyOptionsGroup := swag.CommandLineOptionsGroup{ + haproxyOptionsGroup := cmdutils.CommandLineOptionsGroup{ ShortDescription: "HAProxy options", LongDescription: "Options for configuring haproxy locations.", Options: &cfg.HAProxy, } - loggingOptionsGroup := swag.CommandLineOptionsGroup{ + loggingOptionsGroup := cmdutils.CommandLineOptionsGroup{ ShortDescription: "Logging options", LongDescription: "Options for configuring logging.", Options: &cfg.Logging, } - syslogOptionsGroup := swag.CommandLineOptionsGroup{ + syslogOptionsGroup := cmdutils.CommandLineOptionsGroup{ ShortDescription: "Syslog options", LongDescription: "Options for configuring syslog logging.", Options: &cfg.Syslog, } - api.CommandLineOptionsGroups = make([]swag.CommandLineOptionsGroup, 0, 1) + api.CommandLineOptionsGroups = make([]cmdutils.CommandLineOptionsGroup, 0, 1) api.CommandLineOptionsGroups = append(api.CommandLineOptionsGroups, haproxyOptionsGroup) api.CommandLineOptionsGroups = append(api.CommandLineOptionsGroups, loggingOptionsGroup) api.CommandLineOptionsGroups = append(api.CommandLineOptionsGroups, syslogOptionsGroup) @@ -133,7 +134,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m m["userlist"] = false } - for _, f := range strings.Split(cfgFiles, ";") { + for f := range strings.SplitSeq(cfgFiles, ";") { var conf bool var user bool @@ -161,12 +162,12 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m api.ServeError = errors.ServeError // Set your custom logger if needed. Default one is log.Printf - // Expected interface func(string, ...interface{}) + // Expected interface func(string, ...any) // // Example: api.Logger = log.Printf - api.JSONConsumer = runtime.ConsumerFunc(func(reader io.Reader, data interface{}) error { + api.JSONConsumer = runtime.ConsumerFunc(func(reader io.Reader, data any) error { json := jsoniter.ConfigCompatibleWithStandardLibrary dec := json.NewDecoder(reader) dec.UseNumber() // preserve number formats @@ -175,7 +176,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m api.TxtConsumer = runtime.TextConsumer() - api.JSONProducer = runtime.ProducerFunc(func(writer io.Writer, data interface{}) error { + api.JSONProducer = runtime.ProducerFunc(func(writer io.Writer, data any) error { json := jsoniter.ConfigCompatibleWithStandardLibrary enc := json.NewEncoder(writer) enc.SetEscapeHTML(false) @@ -220,7 +221,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m } // setup discovery handlers - api.DiscoveryGetAPIEndpointsHandler = discovery.GetAPIEndpointsHandlerFunc(func(params discovery.GetAPIEndpointsParams, principal interface{}) middleware.Responder { + api.DiscoveryGetAPIEndpointsHandler = discovery.GetAPIEndpointsHandlerFunc(func(params discovery.GetAPIEndpointsParams, principal any) middleware.Responder { ends, err := misc.DiscoverChildPaths("", SwaggerJSON) if err != nil { e := misc.HandleError(err) @@ -228,7 +229,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m } return discovery.NewGetAPIEndpointsOK().WithPayload(ends) }) - api.DiscoveryGetServicesEndpointsHandler = discovery.GetServicesEndpointsHandlerFunc(func(params discovery.GetServicesEndpointsParams, principal interface{}) middleware.Responder { + api.DiscoveryGetServicesEndpointsHandler = discovery.GetServicesEndpointsHandlerFunc(func(params discovery.GetServicesEndpointsParams, principal any) middleware.Responder { rURI := "/" + strings.SplitN(params.HTTPRequest.RequestURI[1:], "/", 2)[1] ends, err := misc.DiscoverChildPaths(rURI, SwaggerJSON) if err != nil { @@ -237,7 +238,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m } return discovery.NewGetServicesEndpointsOK().WithPayload(ends) }) - api.DiscoveryGetConfigurationEndpointsHandler = discovery.GetConfigurationEndpointsHandlerFunc(func(params discovery.GetConfigurationEndpointsParams, principal interface{}) middleware.Responder { + api.DiscoveryGetConfigurationEndpointsHandler = discovery.GetConfigurationEndpointsHandlerFunc(func(params discovery.GetConfigurationEndpointsParams, principal any) middleware.Responder { rURI := "/" + strings.SplitN(params.HTTPRequest.RequestURI[1:], "/", 2)[1] ends, err := misc.DiscoverChildPaths(rURI, SwaggerJSON) if err != nil { @@ -246,7 +247,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m } return discovery.NewGetConfigurationEndpointsOK().WithPayload(ends) }) - api.DiscoveryGetRuntimeEndpointsHandler = discovery.GetRuntimeEndpointsHandlerFunc(func(params discovery.GetRuntimeEndpointsParams, principal interface{}) middleware.Responder { + api.DiscoveryGetRuntimeEndpointsHandler = discovery.GetRuntimeEndpointsHandlerFunc(func(params discovery.GetRuntimeEndpointsParams, principal any) middleware.Responder { rURI := "/" + strings.SplitN(params.HTTPRequest.RequestURI[1:], "/", 2)[1] ends, err := misc.DiscoverChildPaths(rURI, SwaggerJSON) if err != nil { @@ -255,7 +256,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m } return discovery.NewGetRuntimeEndpointsOK().WithPayload(ends) }) - api.DiscoveryGetHaproxyEndpointsHandler = discovery.GetHaproxyEndpointsHandlerFunc(func(params discovery.GetHaproxyEndpointsParams, principal interface{}) middleware.Responder { + api.DiscoveryGetHaproxyEndpointsHandler = discovery.GetHaproxyEndpointsHandlerFunc(func(params discovery.GetHaproxyEndpointsParams, principal any) middleware.Responder { rURI := "/" + strings.SplitN(params.HTTPRequest.RequestURI[1:], "/", 2)[1] ends, err := misc.DiscoverChildPaths(rURI, SwaggerJSON) if err != nil { @@ -264,7 +265,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m } return discovery.NewGetHaproxyEndpointsOK().WithPayload(ends) }) - api.DiscoveryGetStatsEndpointsHandler = discovery.GetStatsEndpointsHandlerFunc(func(params discovery.GetStatsEndpointsParams, principal interface{}) middleware.Responder { + api.DiscoveryGetStatsEndpointsHandler = discovery.GetStatsEndpointsHandlerFunc(func(params discovery.GetStatsEndpointsParams, principal any) middleware.Responder { rURI := "/" + strings.SplitN(params.HTTPRequest.RequestURI[1:], "/", 2)[1] ends, err := misc.DiscoverChildPaths(rURI, SwaggerJSON) if err != nil { @@ -273,7 +274,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m } return discovery.NewGetStatsEndpointsOK().WithPayload(ends) }) - api.DiscoveryGetSpoeEndpointsHandler = discovery.GetSpoeEndpointsHandlerFunc(func(params discovery.GetSpoeEndpointsParams, principal interface{}) middleware.Responder { + api.DiscoveryGetSpoeEndpointsHandler = discovery.GetSpoeEndpointsHandlerFunc(func(params discovery.GetSpoeEndpointsParams, principal any) middleware.Responder { rURI := "/" + strings.SplitN(params.HTTPRequest.RequestURI[1:], "/", 2)[1] ends, err := misc.DiscoverChildPaths(rURI, SwaggerJSON) if err != nil { @@ -282,7 +283,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m } return discovery.NewGetSpoeEndpointsOK().WithPayload(ends) }) - api.DiscoveryGetStorageEndpointsHandler = discovery.GetStorageEndpointsHandlerFunc(func(params discovery.GetStorageEndpointsParams, principal interface{}) middleware.Responder { + api.DiscoveryGetStorageEndpointsHandler = discovery.GetStorageEndpointsHandlerFunc(func(params discovery.GetStorageEndpointsParams, principal any) middleware.Responder { rURI := "/" + strings.SplitN(params.HTTPRequest.RequestURI[1:], "/", 2)[1] ends, err := misc.DiscoverChildPaths(rURI, SwaggerJSON) if err != nil { @@ -829,8 +830,8 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m go clusterSync.Monitor(cfg, client) // setup specification handler - api.SpecificationGetSpecificationHandler = specification.GetSpecificationHandlerFunc(func(params specification.GetSpecificationParams, principal interface{}) middleware.Responder { - var m map[string]interface{} + api.SpecificationGetSpecificationHandler = specification.GetSpecificationHandlerFunc(func(params specification.GetSpecificationParams, principal any) middleware.Responder { + var m map[string]any json := jsoniter.ConfigCompatibleWithStandardLibrary if err := json.Unmarshal(SwaggerJSON, &m); err != nil { e := misc.HandleError(err) @@ -868,7 +869,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m data.ID = service_discovery.NewServiceDiscoveryUUID() } if errSD = service_discovery.ValidateConsulData(data, true); errSD != nil { - log.Fatalf("Error validating Consul instance: " + errSD.Error()) + log.Fatal("Error validating Consul instance: " + errSD.Error()) } if errSD = discovery.AddNode("consul", *data.ID, data); errSD != nil { log.Warning("Error creating consul instance: " + errSD.Error()) @@ -884,7 +885,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m data.ID = service_discovery.NewServiceDiscoveryUUID() } if errSD = service_discovery.ValidateAWSData(data, true); errSD != nil { - log.Fatalf("Error validating AWS instance: " + errSD.Error()) + log.Fatal("Error validating AWS instance: " + errSD.Error()) } if errSD = discovery.AddNode("aws", *data.ID, data); errSD != nil { log.Warning("Error creating AWS instance: " + errSD.Error()) @@ -917,9 +918,13 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m api.StorageReplaceStorageGeneralFileHandler = &handlers.StorageReplaceStorageGeneralFileHandlerImpl{Client: client, ReloadAgent: ra} // setup OpenAPI v3 specification handler - api.SpecificationOpenapiv3GetOpenapiv3SpecificationHandler = specification_openapiv3.GetOpenapiv3SpecificationHandlerFunc(func(params specification_openapiv3.GetOpenapiv3SpecificationParams, principal interface{}) middleware.Responder { + api.SpecificationOpenapiv3GetOpenapiv3SpecificationHandler = specification_openapiv3.GetOpenapiv3SpecificationHandlerFunc(func(params specification_openapiv3.GetOpenapiv3SpecificationParams, principal any) middleware.Responder { v2 := openapi2.T{} - err = v2.UnmarshalJSON(SwaggerJSON) + v2JSONString := string(SwaggerJSON) + v2JSONString = strings.ReplaceAll(v2JSONString, "#/definitions", "#/components/schemas") + curatedV2 := json.RawMessage([]byte(v2JSONString)) + + err = v2.UnmarshalJSON(curatedV2) if err != nil { e := misc.HandleError(err) return specification_openapiv3.NewGetOpenapiv3SpecificationDefault(int(*e.Code)).WithPayload(e) @@ -1193,7 +1198,8 @@ func handleSignals(ctx context.Context, cancel context.CancelFunc, sigs chan os. for { select { case sig := <-sigs: - if sig == syscall.SIGUSR1 { + switch sig { + case syscall.SIGUSR1: var clientCtx context.Context cancel() clientCtx, cancel = context.WithCancel(ctx) @@ -1204,7 +1210,7 @@ func handleSignals(ctx context.Context, cancel context.CancelFunc, sigs chan os. client.ReplaceRuntime(cn.ConfigureRuntimeClient(clientCtx, configuration, haproxyOptions)) log.Info("Reloaded Data Plane API") } - } else if sig == syscall.SIGUSR2 { + case syscall.SIGUSR2: reloadConfigurationFile(client, haproxyOptions, users) } case <-ctx.Done(): @@ -1217,10 +1223,10 @@ func handleSignals(ctx context.Context, cancel context.CancelFunc, sigs chan os. func reloadConfigurationFile(client client_native.HAProxyClient, haproxyOptions dataplaneapi_config.HAProxyConfiguration, users *dataplaneapi_config.Users) { confClient, err := cn.ConfigureConfigurationClient(haproxyOptions, mWorker) if err != nil { - log.Fatalf(err.Error()) + log.Fatal(err.Error()) } if err := users.Init(); err != nil { - log.Fatalf(err.Error()) + log.Fatal(err.Error()) } log.Info("Rereading Configuration Files") clientMutex.Lock() diff --git a/configure_data_plane_test.go b/configure_data_plane_test.go index eb99d7db..862f7e6a 100644 --- a/configure_data_plane_test.go +++ b/configure_data_plane_test.go @@ -18,6 +18,8 @@ package dataplaneapi import ( + "encoding/json" + "strings" "testing" "github.com/getkin/kin-openapi/openapi2" @@ -25,12 +27,17 @@ import ( ) func TestConvOpenAPIV2ToV3(t *testing.T) { + v2JSONString := string(SwaggerJSON) + v2JSONString = strings.ReplaceAll(v2JSONString, "#/definitions", "#/components/schemas") + curatedV2 := json.RawMessage([]byte(v2JSONString)) + var v2 openapi2.T - err := v2.UnmarshalJSON(SwaggerJSON) + err := v2.UnmarshalJSON(curatedV2) if err != nil { t.Error(err) return } + _, err = openapi2conv.ToV3(&v2) if err != nil { t.Error(err) diff --git a/discovery/aws_service_discovery.go b/discovery/aws_service_discovery.go index 6f0e713a..d9ed3789 100644 --- a/discovery/aws_service_discovery.go +++ b/discovery/aws_service_discovery.go @@ -50,23 +50,23 @@ func (a awsServiceDiscovery) AddNode(id string, params ServiceDiscoveryParams) ( var instance *awsInstance instance, err = newAWSRegionInstance(a.context, aParams, a.client, a.reloadAgent) if err != nil { - return + return err } if err = a.services.Create(id, instance); err != nil { - return + return err } if *aParams.Enabled { instance.start() } - return + return err } func (a awsServiceDiscovery) GetNode(id string) (params ServiceDiscoveryParams, err error) { - var i interface{} + var i any if i, err = a.services.Read(id); err != nil { - return + return params, err } return i.(*awsInstance).params, nil } @@ -88,7 +88,7 @@ func (a awsServiceDiscovery) UpdateNode(id string, params ServiceDiscoveryParams if !ok { return errors.New("expected *models.AwsRegion") } - return a.services.Update(id, func(item interface{}) (err error) { + return a.services.Update(id, func(item any) (err error) { ai := item.(*awsInstance) if err = ai.updateTimeout(*newParams.RetryTimeout); err != nil { @@ -112,6 +112,6 @@ func (a awsServiceDiscovery) UpdateNode(id string, params ServiceDiscoveryParams ai.update <- struct{}{} } - return + return err }) } diff --git a/discovery/aws_service_discovery_instance.go b/discovery/aws_service_discovery_instance.go index 14d07922..51b8bea0 100644 --- a/discovery/aws_service_discovery_instance.go +++ b/discovery/aws_service_discovery_instance.go @@ -45,7 +45,7 @@ type awsInstance struct { update chan struct{} state map[string]map[string]time.Time discoveryConfig *ServiceDiscoveryInstance - logFields map[string]interface{} + logFields map[string]any timeout time.Duration } @@ -95,7 +95,7 @@ func (a awsService) GetServers() (servers []configuration.ServiceServer) { Port: port, }) } - return + return servers } func newAWSRegionInstance(ctx context.Context, params *models.AwsRegion, client configuration.Configuration, reloadAgent haproxy.IReloadAgent) (*awsInstance, error) { @@ -104,7 +104,7 @@ func newAWSRegionInstance(ctx context.Context, params *models.AwsRegion, client return nil, err } - logFields := map[string]interface{}{"ServiceDiscovery": "AWS", "ID": *params.ID} + logFields := map[string]any{"ServiceDiscovery": "AWS", "ID": *params.ID} ai := &awsInstance{ params: params, @@ -136,7 +136,7 @@ func (a *awsInstance) filterConverter(in []*models.AwsFilters) (out []types.Filt Values: []string{aws.ToString(l.Value)}, } } - return + return out } func (a *awsInstance) updateTimeout(timeoutSeconds int64) error { @@ -148,6 +148,37 @@ func (a *awsInstance) updateTimeout(timeoutSeconds int64) error { return nil } +func (a *awsInstance) updateServicesFn() { + a.logDebug("discovery job update triggered") + + var api *ec2.Client + var err error + + if api, err = a.setAPIClient(); err != nil { + a.logErrorf("error while setting up the API client: %s", err.Error()) + return + } + + if err = a.updateServices(api); err != nil { + switch t := err.(type) { + case *configuration.ConfError: + switch t.Err() { + case configuration.ErrObjectAlreadyExists: + a.logDebug("object already exists, ignoring error") + return + default: + a.logErrorf("a configuration error occurred while updating service: %s", err.Error()) + return + } + default: + a.logErrorf("an error occurred while updating service: %s", err.Error()) + return + } + } + + a.logDebug("discovery job reconciliation completed") +} + func (a *awsInstance) start() { a.update = make(chan struct{}) @@ -163,7 +194,9 @@ func (a *awsInstance) start() { if !ok { return } + a.logDebug("discovery job update triggered") + err := a.discoveryConfig.UpdateParams(discoveryInstanceParams{ Allowlist: []string{}, Denylist: []string{}, @@ -173,34 +206,13 @@ func (a *awsInstance) start() { SlotsIncrement: int(a.params.ServerSlotsGrowthIncrement), }) if err != nil { - a.stop() - } - case <-discoveryTimer.C: - a.logDebug("discovery job update triggered") - - var api *ec2.Client - var err error - - if api, err = a.setAPIClient(); err != nil { - a.logErrorf("error while setting up the API client: %s", err.Error()) - a.stop() - } - if err = a.updateServices(api); err != nil { - switch t := err.(type) { - case *configuration.ConfError: - switch t.Err() { - case configuration.ErrObjectAlreadyExists: - continue - default: - a.stop() - a.logErrorf("error while updating service: %s", err.Error()) - } - default: - a.stop() - } + a.logErrorf("error while updating discovery settings: %s", err.Error()) + break } - a.logDebug("discovery job reconciliation completed") + a.logDebug("discovery job update completed") + case <-discoveryTimer.C: + a.updateServicesFn() discoveryTimer.Reset(a.timeout) case <-a.ctx.Done(): a.stop() @@ -210,6 +222,9 @@ func (a *awsInstance) start() { } func (a *awsInstance) setAPIClient() (*ec2.Client, error) { + ctx, cancelFn := context.WithTimeout(a.ctx, a.timeout) + defer cancelFn() + opts := []func(options *config.LoadOptions) error{ config.WithRegion(*a.params.Region), } @@ -221,7 +236,7 @@ func (a *awsInstance) setAPIClient() (*ec2.Client, error) { }, })) } - cfg, err := config.LoadDefaultConfig(context.Background(), opts...) + cfg, err := config.LoadDefaultConfig(ctx, opts...) if err != nil { return nil, fmt.Errorf("cannot generate the AWS instance due to a configuration setup error: %w", err) } @@ -230,9 +245,12 @@ func (a *awsInstance) setAPIClient() (*ec2.Client, error) { } func (a *awsInstance) updateServices(api *ec2.Client) (err error) { + ctx, cancel := context.WithTimeout(a.ctx, a.timeout) + defer cancel() + var io *ec2.DescribeInstancesOutput - io, err = api.DescribeInstances(a.ctx, &ec2.DescribeInstancesInput{ + io, err = api.DescribeInstances(ctx, &ec2.DescribeInstancesInput{ Filters: append([]types.Filter{ { Name: aws.String("tag-key"), @@ -245,7 +263,7 @@ func (a *awsInstance) updateServices(api *ec2.Client) (err error) { }, a.filterConverter(a.params.Allowlist)...), }) if err != nil { - return + return err } mapService := make(map[string]*awsService) @@ -283,7 +301,7 @@ func (a *awsInstance) updateServices(api *ec2.Client) (err error) { if len(a.params.Denylist) > 0 { // AWS API doesn't provide negative filter search, so doing on our own - io, err = api.DescribeInstances(a.ctx, &ec2.DescribeInstancesInput{ + io, err = api.DescribeInstances(ctx, &ec2.DescribeInstancesInput{ Filters: a.filterConverter(a.params.Denylist), }) if err == nil { @@ -339,7 +357,7 @@ func (a *awsInstance) updateServices(api *ec2.Client) (err error) { id := aws.ToString(instance.InstanceId) hash[id] = aws.ToTime(instance.LaunchTime) } - return + return hash }(s.instances) } @@ -353,14 +371,14 @@ func (a *awsInstance) stop() { func (a *awsService) instancePortFromEC2(instance types.Instance) (port int, err error) { for _, t := range instance.Tags { - switch { - case *t.Key == HAProxyServicePortTag: + switch *t.Key { + case HAProxyServicePortTag: port, err = strconv.Atoi(*t.Value) - case *t.Key == HAProxyInstancePortTag: + case HAProxyInstancePortTag: return strconv.Atoi(*t.Value) } } - return + return port, err } func (a *awsInstance) serviceNameFromEC2(instance types.Instance) (string, error) { @@ -388,6 +406,6 @@ func (a *awsInstance) logDebug(message string) { log.WithFields(a.logFields, log.DebugLevel, message) } -func (a *awsInstance) logErrorf(format string, args ...interface{}) { +func (a *awsInstance) logErrorf(format string, args ...any) { log.WithFieldsf(a.logFields, log.ErrorLevel, format, args...) } diff --git a/discovery/consul_service_discovery.go b/discovery/consul_service_discovery.go index e99e043b..6b9f0796 100644 --- a/discovery/consul_service_discovery.go +++ b/discovery/consul_service_discovery.go @@ -55,7 +55,7 @@ func (c *consulServiceDiscovery) AddNode(id string, params ServiceDiscoveryParam return err } - logFields := map[string]interface{}{"ServiceDiscovery": "Consul", "ID": *cParams.ID} + logFields := map[string]any{"ServiceDiscovery": "Consul", "ID": *cParams.ID} instance := &consulInstance{ params: cParams, @@ -74,7 +74,7 @@ func (c *consulServiceDiscovery) AddNode(id string, params ServiceDiscoveryParam } if err = c.consulServices.Create(id, instance); err != nil { - return + return err } instance.prevEnabled = *cParams.Enabled @@ -86,12 +86,12 @@ func (c *consulServiceDiscovery) AddNode(id string, params ServiceDiscoveryParam } func (c *consulServiceDiscovery) GetNode(id string) (p ServiceDiscoveryParams, err error) { - var i interface{} + var i any if i, err = c.consulServices.Read(id); err != nil { - return + return p, err } p = i.(*consulInstance).params - return + return p, err } func (c *consulServiceDiscovery) GetNodes() (ServiceDiscoveryParams, error) { @@ -111,7 +111,7 @@ func (c *consulServiceDiscovery) UpdateNode(id string, params ServiceDiscoveryPa if !ok { return errors.New("expected models.Consuls") } - return c.consulServices.Update(id, func(item interface{}) error { + return c.consulServices.Update(id, func(item any) error { ci := item.(*consulInstance) ci.params = cParams if err = ci.updateTimeout(int(*cParams.RetryTimeout)); err != nil { diff --git a/discovery/consul_service_discovery_instance.go b/discovery/consul_service_discovery_instance.go index d28a5ccf..2bc168d5 100644 --- a/discovery/consul_service_discovery_instance.go +++ b/discovery/consul_service_discovery_instance.go @@ -65,7 +65,7 @@ type consulInstance struct { discoveryConfig *ServiceDiscoveryInstance prevIndexes map[string]uint64 update chan struct{} - logFields map[string]interface{} + logFields map[string]any timeout time.Duration prevEnabled bool } @@ -211,7 +211,7 @@ func (c *consulInstance) validateHealthChecks(node *serviceEntry) bool { } func (c *consulInstance) validateHealthChecksAny(node *serviceEntry) bool { - if node.Checks == nil || len(node.Checks) == 0 { + if len(node.Checks) == 0 { return false } @@ -224,7 +224,7 @@ func (c *consulInstance) validateHealthChecksAny(node *serviceEntry) bool { } func (c *consulInstance) validateHealthChecksAll(node *serviceEntry) bool { - if node.Checks == nil || len(node.Checks) == 0 { + if len(node.Checks) == 0 { return false } @@ -237,7 +237,7 @@ func (c *consulInstance) validateHealthChecksAll(node *serviceEntry) bool { } func (c *consulInstance) validateHealthChecksMin(node *serviceEntry) bool { - if node.Checks == nil || len(node.Checks) == 0 { + if len(node.Checks) == 0 { return false } @@ -298,7 +298,7 @@ func (c *consulInstance) logDebug(message string) { log.WithFields(c.logFields, log.DebugLevel, message) } -func (c *consulInstance) logErrorf(format string, args ...interface{}) { +func (c *consulInstance) logErrorf(format string, args ...any) { log.WithFieldsf(c.logFields, log.ErrorLevel, format, args...) } @@ -324,7 +324,7 @@ func (c *consulInstance) queryHealthService(se string, params *queryParams) ([]* return services, meta, nil } -func (c *consulInstance) doConsulQuery(method string, path string, params *queryParams, resp interface{}) (*queryMetadata, error) { +func (c *consulInstance) doConsulQuery(method string, path string, params *queryParams, resp any) (*queryMetadata, error) { mode := "http://" if c.params.Mode != nil { mode = *c.params.Mode + "://" diff --git a/discovery/service_discovery.go b/discovery/service_discovery.go index f26602d8..8951768b 100644 --- a/discovery/service_discovery.go +++ b/discovery/service_discovery.go @@ -24,7 +24,7 @@ import ( ) // ServiceDiscoveryParams configuration for a specific service discovery -type ServiceDiscoveryParams interface{} +type ServiceDiscoveryParams any // ServiceDiscovery represents the required methods for a service discovery type ServiceDiscovery interface { diff --git a/discovery/service_discovery_instance.go b/discovery/service_discovery_instance.go index ead9c516..b031398b 100644 --- a/discovery/service_discovery_instance.go +++ b/discovery/service_discovery_instance.go @@ -16,6 +16,7 @@ package discovery import ( + "slices" "sync" "github.com/haproxytech/client-native/v6/configuration" @@ -43,7 +44,7 @@ type confService struct { } type discoveryInstanceParams struct { - LogFields map[string]interface{} + LogFields map[string]any SlotsGrowthType string Allowlist []string Denylist []string @@ -155,19 +156,9 @@ func (s *ServiceDiscoveryInstance) markForCleanUp() { func (s *ServiceDiscoveryInstance) serviceNotTracked(service string) bool { if len(s.params.Allowlist) > 0 { - for _, se := range s.params.Allowlist { - if se == service { - return false - } - } - return true - } - for _, se := range s.params.Denylist { - if se == service { - return true - } + return !slices.Contains(s.params.Allowlist, service) } - return false + return slices.Contains(s.params.Denylist, service) } func (s *ServiceDiscoveryInstance) initService(service ServiceInstance) (bool, error) { @@ -229,10 +220,10 @@ func (s *ServiceDiscoveryInstance) commitTransaction() error { return err } -func (s *ServiceDiscoveryInstance) logWarningf(format string, args ...interface{}) { +func (s *ServiceDiscoveryInstance) logWarningf(format string, args ...any) { log.WithFieldsf(s.params.LogFields, log.WarnLevel, format, args...) } -func (s *ServiceDiscoveryInstance) logErrorf(format string, args ...interface{}) { +func (s *ServiceDiscoveryInstance) logErrorf(format string, args ...any) { log.WithFieldsf(s.params.LogFields, log.ErrorLevel, format, args...) } diff --git a/discovery/service_discovery_instance_test.go b/discovery/service_discovery_instance_test.go index 07b64baa..e5d30202 100644 --- a/discovery/service_discovery_instance_test.go +++ b/discovery/service_discovery_instance_test.go @@ -191,7 +191,7 @@ func createLaunchConfiguration(name *string, client *autoscaling.Client) (err er ImageId: aws.String(ami), InstanceType: aws.String("t2.micro"), }) - return + return err } func createAutoScalingGroup(instanceId *string, client *autoscaling.Client) (err error) { @@ -220,7 +220,7 @@ func createAutoScalingGroup(instanceId *string, client *autoscaling.Client) (err }, }, }) - return + return err } func checkBackendServers(asgName *string, backendName string, asg *autoscaling.Client, ec2Client *ec2.Client, confClient *configuration.Client) (ok bool) { @@ -280,7 +280,7 @@ func scaleAutoScalingGroup(asgName *string, desiredCapacity int32, asg *autoscal AutoScalingGroupName: asgName, DesiredCapacity: aws.Int32(desiredCapacity), }) - return + return err } func checkAutoScalingGroupCapacity(asgName *string, desiredCapacity int32, asg *autoscaling.Client) (err error) { @@ -301,7 +301,7 @@ func checkAutoScalingGroupCapacity(asgName *string, desiredCapacity int32, asg * if len(out.AutoScalingGroups[0].Instances) != int(desiredCapacity) { continue } - return + return err } } } diff --git a/discovery/store.go b/discovery/store.go index 9d052b3d..db96c767 100644 --- a/discovery/store.go +++ b/discovery/store.go @@ -22,23 +22,23 @@ import ( ) type Store interface { - Create(name string, service interface{}) error - Read(name string) (interface{}, error) - Update(name string, mutateFn func(obj interface{}) error) (err error) + Create(name string, service any) error + Read(name string) (any, error) + Update(name string, mutateFn func(obj any) error) (err error) Delete(name string) error - List() []interface{} + List() []any } type instanceStore struct { - store map[string]interface{} + store map[string]any mu sync.RWMutex } -func (s *instanceStore) Update(name string, mutateFn func(obj interface{}) error) (err error) { +func (s *instanceStore) Update(name string, mutateFn func(obj any) error) (err error) { s.mu.Lock() defer s.mu.Unlock() - var o interface{} + var o any if o, err = s.get(name); err != nil { return fmt.Errorf("cannot update resource: %w", err) } @@ -48,27 +48,27 @@ func (s *instanceStore) Update(name string, mutateFn func(obj interface{}) error } s.store[name] = o - return + return err } -func (s *instanceStore) List() (list []interface{}) { +func (s *instanceStore) List() (list []any) { s.mu.RLock() defer s.mu.RUnlock() for _, i := range s.store { list = append(list, i) } - return + return list } func NewInstanceStore() Store { return &instanceStore{ - store: map[string]interface{}{}, + store: map[string]any{}, mu: sync.RWMutex{}, } } -func (s *instanceStore) Create(name string, service interface{}) error { +func (s *instanceStore) Create(name string, service any) error { s.mu.Lock() defer s.mu.Unlock() @@ -85,25 +85,25 @@ func (s *instanceStore) Delete(name string) (err error) { defer s.mu.Unlock() if _, err = s.get(name); err != nil { - return + return err } delete(s.store, name) return nil } -func (s *instanceStore) Read(name string) (sd interface{}, err error) { +func (s *instanceStore) Read(name string) (sd any, err error) { s.mu.RLock() defer s.mu.RUnlock() return s.get(name) } -func (s *instanceStore) get(name string) (sd interface{}, err error) { +func (s *instanceStore) get(name string) (sd any, err error) { var ok bool sd, ok = s.store[name] if !ok { return nil, errors.New("instance not found") } - return + return sd, err } diff --git a/discovery/utils.go b/discovery/utils.go index 40dcacec..5a7dbde1 100644 --- a/discovery/utils.go +++ b/discovery/utils.go @@ -21,7 +21,6 @@ import ( "github.com/go-openapi/strfmt" "github.com/google/uuid" "github.com/haproxytech/client-native/v6/models" - "github.com/haproxytech/dataplaneapi/misc" ) const ( @@ -42,10 +41,10 @@ func ValidateAWSData(data *models.AwsRegion, useValidation bool) error { return err } if data.ServerSlotsBase == nil || *data.ServerSlotsBase < minimumServerSlotsBase { - data.ServerSlotsBase = misc.Int64P(10) + data.ServerSlotsBase = new(int64(10)) } if data.ServerSlotsGrowthType == nil { - data.ServerSlotsGrowthType = misc.StringP(models.AwsRegionServerSlotsGrowthTypeExponential) + data.ServerSlotsGrowthType = new(models.AwsRegionServerSlotsGrowthTypeExponential) } if *data.ServerSlotsGrowthType == models.AwsRegionServerSlotsGrowthTypeLinear && (data.ServerSlotsGrowthIncrement == 0 || data.ServerSlotsGrowthIncrement < minimumServerSlotsBase) { data.ServerSlotsGrowthIncrement = minimumServerSlotsBase @@ -67,10 +66,10 @@ func ValidateConsulData(data *models.Consul, useValidation bool) error { return err } if data.ServerSlotsBase == nil || *data.ServerSlotsBase < minimumServerSlotsBase { - data.ServerSlotsBase = misc.Int64P(minimumServerSlotsBase) + data.ServerSlotsBase = new(int64(minimumServerSlotsBase)) } if data.ServerSlotsGrowthType == nil { - data.ServerSlotsGrowthType = misc.StringP(models.ConsulServerSlotsGrowthTypeLinear) + data.ServerSlotsGrowthType = new(models.ConsulServerSlotsGrowthTypeLinear) } if *data.ServerSlotsGrowthType == models.ConsulServerSlotsGrowthTypeLinear && (data.ServerSlotsGrowthIncrement == 0 || data.ServerSlotsGrowthIncrement < minimumServerSlotsBase) { data.ServerSlotsGrowthIncrement = minimumServerSlotsBase diff --git a/doc.go b/doc.go index fb34ce22..93389a7b 100644 --- a/doc.go +++ b/doc.go @@ -35,6 +35,7 @@ // Produces: // - application/octet-stream // - application/json +// - text/plain // // swagger:meta package dataplaneapi diff --git a/e2e/run.bash b/e2e/run.bash index 72620d5b..43b95c29 100755 --- a/e2e/run.bash +++ b/e2e/run.bash @@ -18,7 +18,7 @@ set -eo pipefail export BASE_PATH="/v3" -HAPROXY_VERSION=${HAPROXY_VERSION:-2.9} +HAPROXY_VERSION=${HAPROXY_VERSION:-3.0} DOCKER_BASE_IMAGE="${DOCKER_BASE_IMAGE:-haproxytech/haproxy-debian}:${HAPROXY_VERSION}" DOCKER_CONTAINER_NAME="dataplaneapi-e2e" export DOCKER_CONTAINER_NAME diff --git a/e2e/tests/binds/data/haproxy.cfg b/e2e/tests/binds/data/haproxy.cfg index 9e602e11..39ecdecd 100644 --- a/e2e/tests/binds/data/haproxy.cfg +++ b/e2e/tests/binds/data/haproxy.cfg @@ -27,6 +27,6 @@ defaults mydefaults mode http frontend test_frontend mode tcp maxconn 1000 - bind localhost:9000 name fixture ca-verify-file + bind localhost:9000 name fixture ca-verify-file /certs/ca-verify.pem bind localhost:9090 name loopback option httpclose diff --git a/e2e/tests/defaults/data/haproxy.cfg b/e2e/tests/defaults/data/haproxy.cfg index dbd54a46..5430760b 100644 --- a/e2e/tests/defaults/data/haproxy.cfg +++ b/e2e/tests/defaults/data/haproxy.cfg @@ -1,4 +1,23 @@ -defaults unnamed_defaults_1 - mode http - balance roundrobin - timeout client 30000 +# _version=42 + +global + log 127.0.0.1 local2 + chroot /var/lib/haproxy + pidfile /var/run/haproxy.pid + maxconn 4000 + user haproxy + group haproxy + stats socket /var/lib/haproxy/stats level admin + +defaults + mode http + log global + option httplog + option dontlognull + option forwardfor except 127.0.0.0/8 + option redispatch + retries 3 + timeout connect 10s + timeout client 300s + timeout server 300s + maxconn 5000 diff --git a/e2e/tests/defaults/get.bats b/e2e/tests/defaults/get.bats index e07575c4..c380817c 100644 --- a/e2e/tests/defaults/get.bats +++ b/e2e/tests/defaults/get.bats @@ -27,13 +27,24 @@ load 'utils/_helpers' @test "defaults: Return a list of defaults configurations" { resource_get "$_DEFAULTS_BASE_PATH" assert_equal "$SC" 200 - assert_equal "$(get_json_path "$BODY" '.[0].name')" "unnamed_defaults_1" } @test "defaults: Return a defaults configuration" { resource_get "$_DEFAULTS_BASE_PATH/unnamed_defaults_1" assert_equal "$SC" 200 assert_equal "$(get_json_path "$BODY" '.name')" "unnamed_defaults_1" + + # log_target_list is a child resource, it should not be filled when full_section=false + assert_equal "$(get_json_path "$BODY" ".log_target_list.[0].global")" "null" +} + +@test "defaults: Return a defaults configuration with full section" { + resource_get "$_DEFAULTS_BASE_PATH/unnamed_defaults_1" "full_section=true" + assert_equal "$SC" 200 + assert_equal "$(get_json_path "$BODY" '.name')" "unnamed_defaults_1" + + # log_target_list is a child resource, it should be filled when full_section=true + assert_equal "$(get_json_path "$BODY" ".log_target_list.[0].global")" "true" } @test "defaults: Return a named defaults configuration that does not exist" { diff --git a/e2e/tests/raw/get.bats b/e2e/tests/raw/get.bats index 4f8410ce..3483f792 100644 --- a/e2e/tests/raw/get.bats +++ b/e2e/tests/raw/get.bats @@ -25,6 +25,6 @@ load 'utils/_helpers' @test "raw: Download configuration" { resource_get "$_RAW_BASE_PATH" assert_equal "$SC" 200 - test -n "$(get_json_path "$BODY" .)" || + test -n "$BODY" || fail "failed to download raw config. BODY: '$BODY'" } diff --git a/e2e/tests/raw_multi/data/container/usr/local/etc/haproxy/default b/e2e/tests/raw_multi/data/container/usr/local/etc/haproxy/default new file mode 100644 index 00000000..37c977d4 --- /dev/null +++ b/e2e/tests/raw_multi/data/container/usr/local/etc/haproxy/default @@ -0,0 +1,51 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDciXjkAHqi+B+X +jgFTEDlGrz6OAISOZTY7vA1eqTW2wnUHyHiaj73xnGegxp9rgZ05lqg/ZU4fO0lt +9XWh1h8+pjwG3KoClS9yr2AK6+tpc7cjN6ZwkQo/3I+ulh9SfbIwW4TSay1yFp9v +aDX2MIicRzh308Z0fw92jBEcMAfewXXEIr/+PSwHLj2WLS3Adme3GNCJwzAbcU/C +OWKlSWrgbOEsYcCGI7Fv8GFeJp7sLAeN/G/ichXEQfJIn3Enb30zBr+B3VxgyYQV +tiOxiT+LTKX/zG16chOJQzKLYfT+E7m4o6fQbfEjScEx0/4JHAfn6OydMMrw3g+f +M10NhkRHAgMBAAECggEAUMFOMT8zqQVunBJ1zbK9JnL5Vwo9f97z8v+zbZxMfPXL +4OO5te84wIZjM+5HZhh6OCJAzaYM60bMZqVhQ7eijVBV3rVi07tJOpeZdaZZ961V +vGGeYs3ZkPT08BsssQox+58njd2NMJ+0Fhl02QeAnqk9tjMoEnSMdv5nLYkw+JH0 +Uw3cYD7ZjBzA/VYoD9nuZDhN/xiqhLksnOOYnucSleQI0feVbG/QSYfzQeGo42Om +MjlVJr0LeJMebOcT34o3fQHoz6pQZt0WP4xNwRrk72ZqBl8HSkLGfrqzg2hlaldQ +JfB7DuWkYRrUF0GKs7CbFo4yRsABVtp8DF6xiCL5AQKBgQD/dLPG8Garlc9liJG9 +ovCE2/kAkeni/Qjc14CFX4qkgcnBIaTTl79xeRmN5dp/WnTinNNMQTamaCJaKEgN +5A28axTsE9Ec/9sGrv/Dt3fXtS+rBPYS9Hc1k5LQrnBlD6lEe5+Oqhc4Mzw5sglo +sfiChEzojV9Vnyj/Y0m5q8t9hwKBgQDdAbqiHMJoAP7IEnsOw1xjA6zFaeY2jYDS +F5ZvSN0IlWXX2Aqc941ws1qKZiGjC9pqaRcjlh1OvhaEIpY7ksTShM8453mstWGl +GV3iYiI9E+KijwqFhWyuiXxi0m0l0u2vXPgj0u6txX9suQQab9+f2oSEXG34wXDu +R9+s/rqzQQKBgFID9OgtLLlwGqsdgrUgyBnPyg0Ny8qttJe6tK+dchTI+q6AD7xD +XxqeZ77wCguTTi2nbgtwcIxSqJzLi/6xtltFAe2dmyi1WGu36bO7hsWBjXFZ4WtK +g6921s8bAkjgE1dCXYLfRx8rC+32JCEx6nh044BSS0ZhGDeOeBAdgPKnAoGBAIIa +w3kt/xBlDZhQsNr3DUtI3Yv2FM2mreCAfFIVDfJAqQzRJSZU4ZIoM7Pn/gNTNgiQ +x0tu0uAJLY4qIlD9zRq1jpxMQKf4u3wLG+bqqIdWToQuOx5xdpKlY3F1uUWcD8q9 +q2LDiTkJXENwA8dgdsBPTtXw59iaYFYWP8pCxzxBAoGANmDkR5qJBJMeQgD8pVKu +xLwV7gInuVMLqfF67aBTCsQKAk+b+zWKUbPLpaldCXREj0YLsTEmp2srIP4KKSMH +N/yjXtYxY4fmCsrHAzqqzpZiYWRYScXHwCSudvV0w7PFNwKndS68lqDj7JKyGkBe +rAMB+WGlOTcNKJrsrq7mnPc= +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIUSUdc/Tj4WL90KtoPif0wGpgEGlowDQYJKoZIhvcNAQEL +BQAwfjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcM +DU1vdW50YWluIFZpZXcxGjAYBgNVBAoMEVlvdXIgT3JnYW5pemF0aW9uMRIwEAYD +VQQLDAlZb3VyIFVuaXQxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0yMzA1MjQxMDIy +MjJaFw0zMzA1MjExMDIyMjJaMH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxp +Zm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRowGAYDVQQKDBFZb3VyIE9y +Z2FuaXphdGlvbjESMBAGA1UECwwJWW91ciBVbml0MRIwEAYDVQQDDAlsb2NhbGhv +c3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDciXjkAHqi+B+XjgFT +EDlGrz6OAISOZTY7vA1eqTW2wnUHyHiaj73xnGegxp9rgZ05lqg/ZU4fO0lt9XWh +1h8+pjwG3KoClS9yr2AK6+tpc7cjN6ZwkQo/3I+ulh9SfbIwW4TSay1yFp9vaDX2 +MIicRzh308Z0fw92jBEcMAfewXXEIr/+PSwHLj2WLS3Adme3GNCJwzAbcU/COWKl +SWrgbOEsYcCGI7Fv8GFeJp7sLAeN/G/ichXEQfJIn3Enb30zBr+B3VxgyYQVtiOx +iT+LTKX/zG16chOJQzKLYfT+E7m4o6fQbfEjScEx0/4JHAfn6OydMMrw3g+fM10N +hkRHAgMBAAGjUzBRMB0GA1UdDgQWBBQyAsLJnbNGf7ME+DokcSeSMYMN5jAfBgNV +HSMEGDAWgBQyAsLJnbNGf7ME+DokcSeSMYMN5jAPBgNVHRMBAf8EBTADAQH/MA0G +CSqGSIb3DQEBCwUAA4IBAQB62/lsOhVrIwUx07C4r3eGu6EmughelFJgqwijnOSS +JmICWvLtfu+X8DQkl0ls5esnK8FZk2i5zBMqhdkD0vb9qa0iI++M6jcjbDrW/bZ/ +oLa/zvEvUeEQS3FqS8p3OUczm4T88cBze3MX4iDDo/QgK6B/46t2UeXByuIZEXsK +6OzBfoX31qrZ+DvvKBSLQG1f13vkp9WDL2u60IQ4XaIgyr+O1R/x157ic0WPaWoV +EwPYP7ds1d8Zz9z8u6LFNi+as33zkRhIBQble277U8vT7AOicXHxnf7y2rToO41h +mi+hA0kvDDgbr4r/K/Lq909m8OUKWBZ5U+c9c7FdMqT+ +-----END CERTIFICATE----- diff --git a/e2e/tests/raw_multi/data/container/usr/local/etc/haproxy/global.def b/e2e/tests/raw_multi/data/container/usr/local/etc/haproxy/global.def new file mode 100644 index 00000000..4a67f955 --- /dev/null +++ b/e2e/tests/raw_multi/data/container/usr/local/etc/haproxy/global.def @@ -0,0 +1,10 @@ +global + chroot /var/lib/haproxy + user haproxy + group haproxy + maxconn 4000 + pidfile /var/run/haproxy.pid + stats socket /var/lib/haproxy/stats level admin + log 127.0.0.1 local2 + crt-base /etc/haproxy + ca-base /etc/haproxy diff --git a/e2e/tests/raw_multi/data/haproxy.cfg b/e2e/tests/raw_multi/data/haproxy.cfg new file mode 100644 index 00000000..a2d60ac7 --- /dev/null +++ b/e2e/tests/raw_multi/data/haproxy.cfg @@ -0,0 +1,31 @@ +# global is defined in global.def + +defaults mydefaults + mode http + maxconn 3000 + log global + option httplog + option redispatch + option dontlognull + option http-server-close + option forwardfor except 127.0.0.0/8 + timeout http-request 10s + timeout check 10s + timeout connect 10s + timeout client 1m + timeout queue 1m + timeout server 1m + timeout http-keep-alive 10s + retries 3 + +backend test_backend + mode http + balance roundrobin + option forwardfor + server server_01 10.1.1.1:8080 check weight 80 + server server_02 10.1.1.2:8080 check weight 80 + server server_03 10.1.1.2:8080 check weight 80 + +frontend test_frontend + bind :1443 ssl crt default + use_backend test_backend diff --git a/e2e/tests/raw_multi/data/haproxy.cfg.json b/e2e/tests/raw_multi/data/haproxy.cfg.json new file mode 100644 index 00000000..a42efeb0 --- /dev/null +++ b/e2e/tests/raw_multi/data/haproxy.cfg.json @@ -0,0 +1 @@ +"# global is defined in global.def\n\ndefaults mydefaults\n mode http\n maxconn 3000\n log global\n option httplog\n option redispatch\n option dontlognull\n option http-server-close\n option forwardfor except 127.0.0.0/8\n timeout http-request 10s\n timeout check 10s\n timeout connect 10s\n timeout client 1m\n timeout queue 1m\n timeout server 1m\n timeout http-keep-alive 10s\n retries 3\n\nbackend test_backend\n mode http\n balance roundrobin\n option forwardfor\n server server_01 10.1.1.1:8080 check weight 80\n server server_02 10.1.1.2:8080 check weight 80\n server server_03 10.1.1.2:8080 check weight 80\n\nfrontend test_frontend\n bind :1443 ssl crt default\n use_backend test_backend\n" diff --git a/e2e/tests/raw_multi/dataplaneapi.yaml b/e2e/tests/raw_multi/dataplaneapi.yaml new file mode 100644 index 00000000..0580cb26 --- /dev/null +++ b/e2e/tests/raw_multi/dataplaneapi.yaml @@ -0,0 +1,29 @@ +# Same config as dataplaneapi-master-socket.yaml +# but with an extra "validate_files_before". + +name: famous_condor +dataplaneapi: + host: 0.0.0.0 + port: 8080 + userlist: + userlist_file: /etc/haproxy/userlist.cfg + resources: + maps_dir: /etc/haproxy/maps + ssl_certs_dir: /etc/haproxy/ssl + general_storage_dir: /etc/haproxy/general + dataplane_storage_dir: /etc/haproxy/dataplane + spoe_dir: /etc/haproxy/spoe +haproxy: + config_file: /etc/haproxy/haproxy.cfg + haproxy_bin: /usr/local/sbin/haproxy + master_runtime: /var/lib/haproxy/master + master_worker_mode: true + reload: + reload_cmd: kill -s 12 1 + restart_cmd: kill -s 12 1 + validate_files_before: + - /etc/haproxy/global.def +log: + log_to: file + log_file: /var/log/dataplaneapi.log + log_level: debug diff --git a/e2e/tests/raw_multi/validate.bats b/e2e/tests/raw_multi/validate.bats new file mode 100644 index 00000000..a408925a --- /dev/null +++ b/e2e/tests/raw_multi/validate.bats @@ -0,0 +1,30 @@ +#!/usr/bin/env bats +# +# Copyright 2025 HAProxy Technologies +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http:#www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +load '../../libs/dataplaneapi' +load '../../libs/debug' +load "../../libs/get_json_path" +load '../../libs/haproxy_config_setup' +load '../../libs/resource_client' +load '../../libs/version' + +_RAW_BASE_PATH="/services/haproxy/configuration/raw" + +@test "raw_multi: Validate a new configuration which depends on global.def" { + resource_post "$_RAW_BASE_PATH" 'data/haproxy.cfg.json' 'only_validate=1' + assert_equal "$SC" 202 +} diff --git a/e2e/tests/set_uid/test.bats b/e2e/tests/set_uid/test.bats index 51f523db..91ffd753 100644 --- a/e2e/tests/set_uid/test.bats +++ b/e2e/tests/set_uid/test.bats @@ -24,8 +24,8 @@ setup() { run dpa_docker_exec 'pkill -9 dataplaneapi' assert_success - run dpa_docker_exec 'adduser -u 1500 testuiduser' - #assert_success ignore error since we do not plan to insert password, user will be created + run dpa_docker_exec 'useradd -m -p test -s /bin/bash -u 1500 testuiduser' + assert_success run docker cp "${BATS_TEST_DIRNAME}/dataplaneapi.yaml" "${DOCKER_CONTAINER_NAME}:/home/testuiduser/dataplaneapi.yaml" assert_success diff --git a/e2e/tests/storage_ssl_certificates/test.bats b/e2e/tests/storage_ssl_certificates/test.bats index 4355d338..64363538 100644 --- a/e2e/tests/storage_ssl_certificates/test.bats +++ b/e2e/tests/storage_ssl_certificates/test.bats @@ -44,6 +44,8 @@ setup() { assert_equal $(get_json_path "$BODY" '.storage_name') "1.pem" + sleep 3 + assert dpa_docker_exec 'ls /etc/haproxy/ssl/1.pem' post_logs_count=$(docker logs dataplaneapi-e2e 2>&1 | wc -l) @@ -89,6 +91,7 @@ setup() { dpa_curl_status_body '$output' assert_equal "$SC" 202 + sleep 3 assert dpa_diff_docker_file '/etc/haproxy/ssl/1.pem' "data/2.pem" } @@ -102,6 +105,7 @@ setup() { dpa_curl_status_body '$output' assert_equal "$SC" 200 + sleep 3 # confirm haproxy wasn't reloaded or restarted post_logs_count=$(docker logs dataplaneapi-e2e 2>&1 | wc -l) new_logs_count=$(( $pre_logs_count - $post_logs_count )) @@ -112,6 +116,7 @@ setup() { resource_delete "$_STORAGE_SSL_CERTS_BASE_PATH/1.pem" assert_equal "$SC" 202 + sleep 3 refute dpa_docker_exec 'ls /etc/haproxy/ssl/1.pem' } @@ -140,6 +145,7 @@ setup() { resource_delete "$_STORAGE_SSL_CERTS_BASE_PATH/1.pem" "skip_reload=true" assert_equal "$SC" 204 + sleep 3 refute dpa_docker_exec 'ls /etc/haproxy/ssl/1.pem' } @@ -159,6 +165,8 @@ setup() { assert_equal $(get_json_path "$BODY" '.storage_name') "1.pem" + sleep 3 + assert dpa_docker_exec 'ls /etc/haproxy/ssl/1.pem' post_logs_count=$(docker logs dataplaneapi-e2e 2>&1 | wc -l) diff --git a/e2e/tests/tcp_request_rules/add_2.8.bats b/e2e/tests/tcp_request_rules/add_2.8.bats index ce0d89e0..655ef6ef 100644 --- a/e2e/tests/tcp_request_rules/add_2.8.bats +++ b/e2e/tests/tcp_request_rules/add_2.8.bats @@ -46,26 +46,6 @@ load 'utils/_helpers' fi } -@test "tcp_request_rules: Add a new TCP Request Rule track-sc-x to backend" { - if haproxy_version_ge "2.8" - then - # Using old track-sc(0|1|2) - PARENT_NAME="test_sticksc" - resource_post "$_BACKEND_BASE_PATH/$PARENT_NAME/tcp_request_rules/0" "data/post-track-sc-x.json" "force_reload=true" - assert_equal "$SC" 201 - - resource_get "$_BACKEND_BASE_PATH/$PARENT_NAME/tcp_request_rules/0" - assert_equal "$SC" 200 - assert_equal "$(get_json_path "$BODY" ".action")" "track-sc" - assert_equal "$(get_json_path "$BODY" ".type")" "content" - assert_equal "$(get_json_path "$BODY" ".cond")" "if" - assert_equal "$(get_json_path "$BODY" ".cond_test")" "TRUE" - assert_equal "$(get_json_path "$BODY" ".track_key")" "src" - assert_equal "$(get_json_path "$BODY" ".track_table")" "test_sticksc" - assert_equal "$(get_json_path "$BODY" ".track_stick_counter")" 0 - fi -} - @test "tcp_request_rules: Fail - Add a new TCP Request Rule track-sc to backend - when track_sc_stick_counter is missing" { if haproxy_version_ge "2.8" then diff --git a/e2e/tests/tcp_request_rules/data/post-track-sc-x.json b/e2e/tests/tcp_request_rules/data/post-track-sc-x.json deleted file mode 100644 index 4702acbc..00000000 --- a/e2e/tests/tcp_request_rules/data/post-track-sc-x.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "content", - "action": "track-sc0", - "cond": "if", - "cond_test": "TRUE", - "track_table": "test_sticksc", - "track_key": "src" -} diff --git a/e2e/tests/x_issue_132/data/haproxy.cfg b/e2e/tests/x_issue_132/data/haproxy.cfg index eed983e2..5f228126 100644 --- a/e2e/tests/x_issue_132/data/haproxy.cfg +++ b/e2e/tests/x_issue_132/data/haproxy.cfg @@ -5,4 +5,4 @@ frontend bug_132 default_backend bug_132 backend bug_132 - server app1 127.0.0.1:8080 check + server app1 127.0.0.1:8080 diff --git a/embedded_spec.go b/embedded_spec.go index 56ca03b2..07788b3f 100644 --- a/embedded_spec.go +++ b/embedded_spec.go @@ -16655,7 +16655,7 @@ func init() { "get": { "description": "Returns HAProxy configuration file in plain text", "produces": [ - "application/json" + "text/plain" ], "tags": [ "Configuration" @@ -16674,15 +16674,7 @@ func init() { "200": { "description": "Operation successful", "schema": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "string" - } - } + "type": "string" }, "headers": { "Cluster-Version": { @@ -16700,7 +16692,16 @@ func init() { } }, "default": { - "$ref": "#/responses/DefaultError" + "description": "General Error", + "schema": { + "type": "string" + }, + "headers": { + "Configuration-Version": { + "type": "string", + "description": "Configuration file version" + } + } } } }, @@ -16710,7 +16711,7 @@ func init() { "text/plain" ], "produces": [ - "application/json" + "text/plain" ], "tags": [ "Configuration" @@ -16806,10 +16807,28 @@ func init() { } }, "400": { - "$ref": "#/responses/BadRequest" + "description": "Bad request", + "schema": { + "type": "string" + }, + "headers": { + "Configuration-Version": { + "type": "string", + "description": "Configuration file version" + } + } }, "default": { - "$ref": "#/responses/DefaultError" + "description": "General Error", + "schema": { + "type": "string" + }, + "headers": { + "Configuration-Version": { + "type": "string", + "description": "Configuration file version" + } + } } } } @@ -18170,6 +18189,7 @@ func init() { "summary": "Return an ACL file", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "ACL file entry ID", "name": "id", @@ -18317,6 +18337,7 @@ func init() { "$ref": "#/parameters/parent_name" }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "File entry ID", "name": "id", @@ -18356,6 +18377,7 @@ func init() { "$ref": "#/parameters/parent_name" }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "File entry ID", "name": "id", @@ -18456,6 +18478,7 @@ func init() { "operationId": "getRuntimeServer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Server name", "name": "name", @@ -18490,6 +18513,7 @@ func init() { "operationId": "replaceRuntimeServer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Server name", "name": "name", @@ -18535,6 +18559,7 @@ func init() { "operationId": "deleteRuntimeServer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Server name", "name": "name", @@ -18628,6 +18653,7 @@ func init() { "operationId": "getOneRuntimeMap", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map file name", "name": "name", @@ -18659,6 +18685,7 @@ func init() { "operationId": "addPayloadRuntimeMap", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map file name", "name": "name", @@ -18705,6 +18732,7 @@ func init() { "operationId": "clearRuntimeMap", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map file name", "name": "name", @@ -18822,6 +18850,7 @@ func init() { "operationId": "getRuntimeMapEntry", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map id", "name": "id", @@ -18856,6 +18885,7 @@ func init() { "operationId": "replaceRuntimeMapEntry", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map id", "name": "id", @@ -18917,6 +18947,7 @@ func init() { "operationId": "deleteRuntimeMapEntry", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map id", "name": "id", @@ -18978,6 +19009,7 @@ func init() { "operationId": "getStickTable", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Stick table name", "name": "name", @@ -19014,12 +19046,14 @@ func init() { "$ref": "#/parameters/parent_name" }, { + "pattern": "^[^\\r\\n;#]+$", "type": "string", "description": "A list of filters in format data.\u003ctype\u003e \u003coperator\u003e \u003cvalue\u003e separated by comma", "name": "filter", "in": "query" }, { + "pattern": "^[^\\r\\n;#]+$", "type": "string", "description": "Key which we want the entries for", "name": "key", @@ -19076,7 +19110,8 @@ func init() { "$ref": "#/definitions/stick_table_entry" }, "key": { - "type": "string" + "type": "string", + "pattern": "^[^\\r\\n;#]+$" } } } @@ -20774,7 +20809,7 @@ func init() { "parameters": [ { "type": "file", - "x-mimetype": "text/plain", + "x-mimetype": "application/octet-stream", "description": "General use file content", "name": "file_upload", "in": "formData" @@ -20837,7 +20872,7 @@ func init() { "put": { "description": "Replaces the contents of a managed general use file on disk", "consumes": [ - "text/plain" + "multipart/form-data" ], "produces": [ "application/json" @@ -20856,12 +20891,11 @@ func init() { "required": true }, { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "string" - } + "type": "file", + "x-mimetype": "application/octet-stream", + "description": "General use file content", + "name": "file_upload", + "in": "formData" }, { "$ref": "#/parameters/skip_reload" @@ -21149,6 +21183,9 @@ func init() { "name": "file_upload", "in": "formData" }, + { + "$ref": "#/parameters/skip_reload" + }, { "$ref": "#/parameters/force_reload" } @@ -21979,9 +22016,7 @@ func init() { "pattern": "^[^\\s]+$", "x-dependency": { "cookie": { - "dynamic": { - "value": true - } + "dynamic.value": true } } }, @@ -22649,7 +22684,7 @@ func init() { "additionalProperties": false, "example": { "cond": "if", - "cond_test": "{ req_ssl_sni -i www.example.com }", + "cond_test": "{ req.ssl_sni -i www.example.com }", "index": 0, "name": "test_backend" } @@ -26083,6 +26118,9 @@ func init() { "pattern": "^[^\\s]+$", "x-display-name": "Group" }, + "h1_accept_payload_with_any_method": { + "type": "boolean" + }, "h1_case_adjust": { "type": "array", "items": { @@ -26107,6 +26145,9 @@ func init() { "h1_case_adjust_file": { "type": "string" }, + "h1_do_not_close_on_insecure_transfer_encoding": { + "type": "boolean" + }, "h2_workaround_bogus_websocket_clients": { "type": "boolean" }, @@ -26330,6 +26371,9 @@ func init() { "ssl_options": { "$ref": "#/definitions/ssl_options" }, + "stats_file": { + "type": "string" + }, "stats_maxconn": { "type": "integer", "x-display-name": "Stats maxconn", @@ -26534,7 +26578,7 @@ func init() { }, "capture_sample": { "type": "string", - "pattern": "^[^\\s]+$", + "pattern": "^(?:[A-Za-z]+\\(\"([A-Za-z\\s]+)\"\\)|[A-Za-z]+)", "x-dependency": { "type": { "value": "capture" @@ -27574,7 +27618,7 @@ func init() { }, "capture_sample": { "type": "string", - "pattern": "^[^\\s]+$", + "pattern": "^(?:[A-Za-z]+\\(\"([A-Za-z\\s]+)\"\\)|[A-Za-z]+)", "x-dependency": { "type": { "value": "capture" @@ -28067,6 +28111,18 @@ func init() { "x-display-name": "Return Error Code", "x-nullable": true }, + "rst_ttl": { + "type": "integer", + "x-dependency": { + "type": { + "required": true, + "value": [ + "silent-drop" + ] + } + }, + "x-display-name": "RST TTL" + }, "sc_expr": { "type": "string", "x-dependency": { @@ -28288,12 +28344,10 @@ func init() { "set-tos", "set-uri", "set-var", + "set-var-fmt", "silent-drop", "strict-mode", "tarpit", - "track-sc0", - "track-sc1", - "track-sc2", "track-sc", "unset-var", "use-service", @@ -28842,6 +28896,18 @@ func init() { "x-display-name": "Return Error Code", "x-nullable": true }, + "rst_ttl": { + "type": "integer", + "x-dependency": { + "type": { + "required": true, + "value": [ + "silent-drop" + ] + } + }, + "x-display-name": "RST TTL" + }, "sc_expr": { "type": "string", "x-dependency": { @@ -29054,9 +29120,6 @@ func init() { "set-var-fmt", "silent-drop", "strict-mode", - "track-sc0", - "track-sc1", - "track-sc2", "track-sc", "unset-var", "wait-for-body", @@ -30640,6 +30703,11 @@ func init() { "additionalProperties": { "$ref": "#/definitions/server" } + }, + "tables": { + "additionalProperties": { + "$ref": "#/definitions/table" + } } } } @@ -30692,6 +30760,10 @@ func init() { "busy_polling": { "type": "boolean" }, + "fd_hard_limit": { + "type": "integer", + "x-nullable": true + }, "max_spread_checks": { "type": "integer", "x-default-unit": "ms", @@ -31158,7 +31230,7 @@ func init() { }, "interval": { "type": "integer", - "x-nullable": false + "x-nullable": true } } }, @@ -31987,6 +32059,11 @@ func init() { "type": "integer", "x-nullable": true }, + "metadata": { + "additionalProperties": { + "type": "object" + } + }, "name": { "type": "string", "pattern": "^[^\\s]+$", @@ -32665,7 +32742,7 @@ func init() { "additionalProperties": false, "example": { "cond": "if", - "cond_test": "{ req_ssl_sni -i www.example.com }", + "cond_test": "{ req.ssl_sni -i www.example.com }", "target_server": "www" } }, @@ -33752,20 +33829,39 @@ func init() { "conn_cnt", "conn_cur", "conn_rate", + "glitch_cnt", + "glitch_rate", + "gpc", + "gpc_rate", "gpc0", "gpc0_rate", "gpc1", "gpc1_rate", "gpt0", + "gpt", "http_req_cnt", "http_req_rate", "http_err_cnt", "http_err_rate", + "http_fail_cnt", + "http_fail_rate", "server_id", "sess_cnt", "sess_rate" ] }, + "idx": { + "type": "integer", + "x-dependency": { + "field": { + "value": [ + "gpc", + "gpc_rate", + "gpt" + ] + } + } + }, "period": { "type": "integer", "x-dependency": { @@ -33854,6 +33950,26 @@ func init() { "type": "integer", "x-nullable": true }, + "glitch_cnt": { + "type": "integer", + "x-nullable": true + }, + "glitch_rate": { + "type": "integer", + "x-nullable": true + }, + "gpc": { + "type": "object", + "properties": { + "idx": { + "type": "integer" + }, + "value": { + "type": "integer", + "x-nullable": true + } + } + }, "gpc0": { "type": "integer", "x-nullable": true @@ -33870,6 +33986,30 @@ func init() { "type": "integer", "x-nullable": true }, + "gpc_rate": { + "type": "object", + "properties": { + "idx": { + "type": "integer" + }, + "value": { + "type": "integer", + "x-nullable": true + } + } + }, + "gpt": { + "type": "object", + "properties": { + "idx": { + "type": "integer" + }, + "value": { + "type": "integer", + "x-nullable": true + } + } + }, "gpt0": { "type": "integer", "x-nullable": true @@ -33882,6 +34022,14 @@ func init() { "type": "integer", "x-nullable": true }, + "http_fail_cnt": { + "type": "integer", + "x-nullable": true + }, + "http_fail_rate": { + "type": "integer", + "x-nullable": true + }, "http_req_cnt": { "type": "integer", "x-nullable": true @@ -34365,9 +34513,6 @@ func init() { "set-var-fmt", "silent-drop", "switch-mode", - "track-sc0", - "track-sc1", - "track-sc2", "track-sc", "unset-var", "use-service" @@ -34439,7 +34584,7 @@ func init() { }, "capture_sample": { "type": "string", - "pattern": "^[^\\s]+$", + "pattern": "^(?:[A-Za-z]+\\(\"([A-Za-z\\s]+)\"\\)|[A-Za-z]+)", "x-dependency": { "action": { "required": true, @@ -34682,6 +34827,18 @@ func init() { }, "x-display-name": "Variable name" }, + "rst_ttl": { + "type": "integer", + "x-dependency": { + "type": { + "required": true, + "value": [ + "silent-drop" + ] + } + }, + "x-display-name": "RST TTL" + }, "sc_idx": { "type": "string", "x-dependency": { @@ -34847,9 +35004,6 @@ func init() { "action": { "required": true, "value": [ - "track-sc0", - "track-sc1", - "track-sc2", "track-sc" ] }, @@ -34869,9 +35023,6 @@ func init() { "action": { "required": false, "value": [ - "track-sc0", - "track-sc1", - "track-sc2", "track-sc" ] }, @@ -34892,9 +35043,6 @@ func init() { "action": { "required": false, "value": [ - "track-sc0", - "track-sc1", - "track-sc2", "track-sc" ] }, @@ -35201,6 +35349,18 @@ func init() { "x-display-name": "Nice Value", "x-nullable": false }, + "rst_ttl": { + "type": "integer", + "x-dependency": { + "type": { + "required": true, + "value": [ + "silent-drop" + ] + } + }, + "x-display-name": "RST TTL" + }, "sc_expr": { "type": "string", "x-dependency": { @@ -35943,6 +36103,7 @@ func init() { }, "user": { "description": "HAProxy userlist user", + "type": "object", "title": "User", "required": [ "username", @@ -36066,6 +36227,7 @@ func init() { "in": "query" }, "parent_name": { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -37748,6 +37910,7 @@ func init() { "operationId": "getAllAclBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -37804,6 +37967,7 @@ func init() { "operationId": "replaceAllAclBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -37903,6 +38067,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -37972,6 +38137,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -38081,6 +38247,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -38190,6 +38357,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -38268,6 +38436,7 @@ func init() { "operationId": "getAllFilterBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -38318,6 +38487,7 @@ func init() { "operationId": "replaceAllFilterBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -38417,6 +38587,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -38486,6 +38657,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -38595,6 +38767,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -38704,6 +38877,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -38782,6 +38956,7 @@ func init() { "operationId": "getAllHTTPAfterResponseRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -38832,6 +39007,7 @@ func init() { "operationId": "replaceAllHTTPAfterResponseRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -38931,6 +39107,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39000,6 +39177,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39109,6 +39287,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39218,6 +39397,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39296,6 +39476,7 @@ func init() { "operationId": "getAllHTTPCheckBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39346,6 +39527,7 @@ func init() { "operationId": "replaceAllHTTPCheckBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39445,6 +39627,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39514,6 +39697,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39623,6 +39807,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39732,6 +39917,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39810,6 +39996,7 @@ func init() { "operationId": "getAllHTTPErrorRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39860,6 +40047,7 @@ func init() { "operationId": "replaceAllHTTPErrorRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -39959,6 +40147,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40028,6 +40217,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40137,6 +40327,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40246,6 +40437,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40324,6 +40516,7 @@ func init() { "operationId": "getAllHTTPRequestRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40374,6 +40567,7 @@ func init() { "operationId": "replaceAllHTTPRequestRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40473,6 +40667,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40542,6 +40737,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40651,6 +40847,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40760,6 +40957,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40838,6 +41036,7 @@ func init() { "operationId": "getAllHTTPResponseRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40888,6 +41087,7 @@ func init() { "operationId": "replaceAllHTTPResponseRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -40987,6 +41187,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -41056,6 +41257,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -41165,6 +41367,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -41274,6 +41477,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -41352,6 +41556,7 @@ func init() { "operationId": "getAllLogTargetBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -41402,6 +41607,7 @@ func init() { "operationId": "replaceAllLogTargetBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -41501,6 +41707,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -41570,6 +41777,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -41679,6 +41887,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -41788,6 +41997,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -41866,6 +42076,7 @@ func init() { "operationId": "getServerSwitchingRules", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -41916,6 +42127,7 @@ func init() { "operationId": "replaceServerSwitchingRules", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42015,6 +42227,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42084,6 +42297,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42193,6 +42407,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42302,6 +42517,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42380,6 +42596,7 @@ func init() { "operationId": "getServerTemplates", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42430,6 +42647,7 @@ func init() { "operationId": "createServerTemplate", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42541,6 +42759,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42610,6 +42829,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42719,6 +42939,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42797,6 +43018,7 @@ func init() { "operationId": "getAllServerBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42847,6 +43069,7 @@ func init() { "operationId": "createServerBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -42958,6 +43181,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43027,6 +43251,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43136,6 +43361,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43214,6 +43440,7 @@ func init() { "operationId": "getStickRules", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43264,6 +43491,7 @@ func init() { "operationId": "replaceStickRules", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43363,6 +43591,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43432,6 +43661,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43541,6 +43771,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43650,6 +43881,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43728,6 +43960,7 @@ func init() { "operationId": "getAllTCPCheckBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43778,6 +44011,7 @@ func init() { "operationId": "replaceAllTCPCheckBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43877,6 +44111,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -43946,6 +44181,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44055,6 +44291,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44164,6 +44401,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44242,6 +44480,7 @@ func init() { "operationId": "getAllTCPRequestRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44292,6 +44531,7 @@ func init() { "operationId": "replaceAllTCPRequestRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44391,6 +44631,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44460,6 +44701,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44569,6 +44811,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44678,6 +44921,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44756,6 +45000,7 @@ func init() { "operationId": "getAllTCPResponseRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44806,6 +45051,7 @@ func init() { "operationId": "replaceAllTCPResponseRuleBackend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44905,6 +45151,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -44974,6 +45221,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -45083,6 +45331,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -45192,6 +45441,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -46868,6 +47118,7 @@ func init() { "operationId": "getAllHTTPCheckDefaults", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -46918,6 +47169,7 @@ func init() { "operationId": "replaceAllHTTPCheckDefaults", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47017,6 +47269,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47086,6 +47339,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47195,6 +47449,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47304,6 +47559,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47382,6 +47638,7 @@ func init() { "operationId": "getAllHTTPErrorRuleDefaults", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47432,6 +47689,7 @@ func init() { "operationId": "replaceAllHTTPErrorRuleDefaults", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47531,6 +47789,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47600,6 +47859,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47709,6 +47969,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47818,6 +48079,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47896,6 +48158,7 @@ func init() { "operationId": "getAllLogTargetDefaults", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -47946,6 +48209,7 @@ func init() { "operationId": "replaceAllLogTargetDefaults", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -48045,6 +48309,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -48114,6 +48379,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -48223,6 +48489,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -48332,6 +48599,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -48410,6 +48678,7 @@ func init() { "operationId": "getAllTCPCheckDefaults", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -48460,6 +48729,7 @@ func init() { "operationId": "replaceAllTCPCheckDefaults", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -48559,6 +48829,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -48628,6 +48899,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -48737,6 +49009,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -48846,6 +49119,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -49334,6 +49608,7 @@ func init() { "operationId": "getAllAclFCGIApp", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -49390,6 +49665,7 @@ func init() { "operationId": "replaceAllAclFCGIApp", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -49489,6 +49765,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -49558,6 +49835,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -49667,6 +49945,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -49776,6 +50055,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -50264,6 +50544,7 @@ func init() { "operationId": "getAllAclFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -50320,6 +50601,7 @@ func init() { "operationId": "replaceAllAclFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -50419,6 +50701,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -50488,6 +50771,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -50597,6 +50881,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -50706,6 +50991,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -50784,6 +51070,7 @@ func init() { "operationId": "getBackendSwitchingRules", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -50834,6 +51121,7 @@ func init() { "operationId": "replaceBackendSwitchingRules", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -50933,6 +51221,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51002,6 +51291,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51111,6 +51401,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51220,6 +51511,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51298,6 +51590,7 @@ func init() { "operationId": "getAllBindFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51348,6 +51641,7 @@ func init() { "operationId": "createBindFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51459,6 +51753,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51528,6 +51823,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51637,6 +51933,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51715,6 +52012,7 @@ func init() { "operationId": "getDeclareCaptures", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51765,6 +52063,7 @@ func init() { "operationId": "replaceDeclareCaptures", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51864,6 +52163,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -51933,6 +52233,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52042,6 +52343,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52151,6 +52453,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52229,6 +52532,7 @@ func init() { "operationId": "getAllFilterFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52279,6 +52583,7 @@ func init() { "operationId": "replaceAllFilterFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52378,6 +52683,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52447,6 +52753,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52556,6 +52863,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52665,6 +52973,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52743,6 +53052,7 @@ func init() { "operationId": "getAllHTTPAfterResponseRuleFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52793,6 +53103,7 @@ func init() { "operationId": "replaceAllHTTPAfterResponseRuleFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52892,6 +53203,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -52961,6 +53273,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53070,6 +53383,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53179,6 +53493,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53257,6 +53572,7 @@ func init() { "operationId": "getAllHTTPErrorRuleFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53307,6 +53623,7 @@ func init() { "operationId": "replaceAllHTTPErrorRuleFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53406,6 +53723,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53475,6 +53793,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53584,6 +53903,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53693,6 +54013,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53771,6 +54092,7 @@ func init() { "operationId": "getAllHTTPRequestRuleFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53821,6 +54143,7 @@ func init() { "operationId": "replaceAllHTTPRequestRuleFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53920,6 +54243,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -53989,6 +54313,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -54098,6 +54423,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -54207,6 +54533,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -54285,6 +54612,7 @@ func init() { "operationId": "getAllHTTPResponseRuleFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -54335,6 +54663,7 @@ func init() { "operationId": "replaceAllHTTPResponseRuleFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -54434,6 +54763,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -54503,6 +54833,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -54612,6 +54943,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -54721,6 +55053,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -54799,6 +55132,7 @@ func init() { "operationId": "getAllLogTargetFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -54849,6 +55183,7 @@ func init() { "operationId": "replaceAllLogTargetFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -54948,6 +55283,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -55017,6 +55353,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -55126,6 +55463,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -55235,6 +55573,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -55313,6 +55652,7 @@ func init() { "operationId": "getAllTCPRequestRuleFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -55363,6 +55703,7 @@ func init() { "operationId": "replaceAllTCPRequestRuleFrontend", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -55462,6 +55803,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -55531,6 +55873,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -55640,6 +55983,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -55749,6 +56093,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -57645,6 +57990,7 @@ func init() { "operationId": "getAllBindLogForward", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -57695,6 +58041,7 @@ func init() { "operationId": "createBindLogForward", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -57806,6 +58153,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -57875,6 +58223,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -57984,6 +58333,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -58062,6 +58412,7 @@ func init() { "operationId": "getDgramBinds", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -58112,6 +58463,7 @@ func init() { "operationId": "createDgramBind", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -58223,6 +58575,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -58292,6 +58645,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -58401,6 +58755,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -58479,6 +58834,7 @@ func init() { "operationId": "getAllLogTargetLogForward", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -58529,6 +58885,7 @@ func init() { "operationId": "replaceAllLogTargetLogForward", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -58628,6 +58985,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -58697,6 +59055,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -58806,6 +59165,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -58915,6 +59275,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -60955,6 +61316,7 @@ func init() { "operationId": "getAllBindPeer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61005,6 +61367,7 @@ func init() { "operationId": "createBindPeer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61116,6 +61479,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61185,6 +61549,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61294,6 +61659,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61372,6 +61738,7 @@ func init() { "operationId": "getAllLogTargetPeer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61422,6 +61789,7 @@ func init() { "operationId": "replaceAllLogTargetPeer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61521,6 +61889,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61590,6 +61959,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61699,6 +62069,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61808,6 +62179,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61886,6 +62258,7 @@ func init() { "operationId": "getAllServerPeer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -61936,6 +62309,7 @@ func init() { "operationId": "createServerPeer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -62047,6 +62421,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -62116,6 +62491,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -62225,6 +62601,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -62303,6 +62680,7 @@ func init() { "operationId": "getTables", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -62353,6 +62731,7 @@ func init() { "operationId": "createTable", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -62464,6 +62843,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -62533,6 +62913,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -62642,6 +63023,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -63096,7 +63478,7 @@ func init() { "get": { "description": "Returns HAProxy configuration file in plain text", "produces": [ - "application/json" + "text/plain" ], "tags": [ "Configuration" @@ -63123,15 +63505,7 @@ func init() { "200": { "description": "Operation successful", "schema": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "string" - } - } + "type": "string" }, "headers": { "Cluster-Version": { @@ -63151,7 +63525,7 @@ func init() { "default": { "description": "General Error", "schema": { - "$ref": "#/definitions/error" + "type": "string" }, "headers": { "Configuration-Version": { @@ -63168,7 +63542,7 @@ func init() { "text/plain" ], "produces": [ - "application/json" + "text/plain" ], "tags": [ "Configuration" @@ -63274,7 +63648,7 @@ func init() { "400": { "description": "Bad request", "schema": { - "$ref": "#/definitions/error" + "type": "string" }, "headers": { "Configuration-Version": { @@ -63286,7 +63660,7 @@ func init() { "default": { "description": "General Error", "schema": { - "$ref": "#/definitions/error" + "type": "string" }, "headers": { "Configuration-Version": { @@ -64128,6 +64502,7 @@ func init() { "operationId": "getAllServerRing", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -64178,6 +64553,7 @@ func init() { "operationId": "createServerRing", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -64289,6 +64665,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -64358,6 +64735,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -64467,6 +64845,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -65461,6 +65840,7 @@ func init() { "summary": "Return an ACL file", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "ACL file entry ID", "name": "id", @@ -65514,6 +65894,7 @@ func init() { "summary": "Return an ACL entries", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -65575,6 +65956,7 @@ func init() { "operationId": "addPayloadRuntimeACL", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -65634,6 +66016,7 @@ func init() { "summary": "Add entry to an ACL file", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -65707,6 +66090,7 @@ func init() { "summary": "Return an ACL entry", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -65714,6 +66098,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "File entry ID", "name": "id", @@ -65777,6 +66162,7 @@ func init() { "summary": "Delete an ACL entry", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -65784,6 +66170,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "File entry ID", "name": "id", @@ -65844,6 +66231,7 @@ func init() { "operationId": "getAllRuntimeServer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -65881,6 +66269,7 @@ func init() { "operationId": "addRuntimeServer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -65964,6 +66353,7 @@ func init() { "operationId": "getRuntimeServer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Server name", "name": "name", @@ -65971,6 +66361,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -66020,6 +66411,7 @@ func init() { "operationId": "replaceRuntimeServer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Server name", "name": "name", @@ -66027,6 +66419,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -66096,6 +66489,7 @@ func init() { "operationId": "deleteRuntimeServer", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Server name", "name": "name", @@ -66103,6 +66497,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -66247,6 +66642,7 @@ func init() { "operationId": "getOneRuntimeMap", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map file name", "name": "name", @@ -66296,6 +66692,7 @@ func init() { "operationId": "addPayloadRuntimeMap", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map file name", "name": "name", @@ -66360,6 +66757,7 @@ func init() { "operationId": "clearRuntimeMap", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map file name", "name": "name", @@ -66421,6 +66819,7 @@ func init() { "operationId": "showRuntimeMap", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -66470,6 +66869,7 @@ func init() { "operationId": "addMapEntry", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -66548,6 +66948,7 @@ func init() { "operationId": "getRuntimeMapEntry", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map id", "name": "id", @@ -66555,6 +66956,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -66604,6 +67006,7 @@ func init() { "operationId": "replaceRuntimeMapEntry", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map id", "name": "id", @@ -66611,6 +67014,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -66696,6 +67100,7 @@ func init() { "operationId": "deleteRuntimeMapEntry", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Map id", "name": "id", @@ -66703,6 +67108,7 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -66788,6 +67194,7 @@ func init() { "operationId": "getStickTable", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Stick table name", "name": "name", @@ -66839,6 +67246,7 @@ func init() { "operationId": "getStickTableEntries", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -66846,12 +67254,14 @@ func init() { "required": true }, { + "pattern": "^[^\\r\\n;#]+$", "type": "string", "description": "A list of filters in format data.\u003ctype\u003e \u003coperator\u003e \u003cvalue\u003e separated by comma", "name": "filter", "in": "query" }, { + "pattern": "^[^\\r\\n;#]+$", "type": "string", "description": "Key which we want the entries for", "name": "key", @@ -66900,6 +67310,7 @@ func init() { "operationId": "setStickTableEntries", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -66921,7 +67332,8 @@ func init() { "$ref": "#/definitions/stick_table_entry" }, "key": { - "type": "string" + "type": "string", + "pattern": "^[^\\r\\n;#]+$" } } } @@ -67585,6 +67997,7 @@ func init() { "operationId": "getAllSpoeScope", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -67635,6 +68048,7 @@ func init() { "operationId": "createSpoeScope", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -67720,6 +68134,7 @@ func init() { "operationId": "getSpoeScope", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -67789,6 +68204,7 @@ func init() { "operationId": "deleteSpoeScope", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -67858,6 +68274,7 @@ func init() { "operationId": "getAllSpoeAgent", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -67915,6 +68332,7 @@ func init() { "operationId": "createSpoeAgent", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68007,6 +68425,7 @@ func init() { "operationId": "getSpoeAgent", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68083,6 +68502,7 @@ func init() { "operationId": "replaceSpoeAgent", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68180,6 +68600,7 @@ func init() { "operationId": "deleteSpoeAgent", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68256,6 +68677,7 @@ func init() { "operationId": "getAllSpoeGroup", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68313,6 +68735,7 @@ func init() { "operationId": "createSpoeGroup", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68405,6 +68828,7 @@ func init() { "operationId": "getSpoeGroup", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68481,6 +68905,7 @@ func init() { "operationId": "replaceSpoeGroup", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68578,6 +69003,7 @@ func init() { "operationId": "deleteSpoeGroup", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68654,6 +69080,7 @@ func init() { "operationId": "getAllSpoeMessage", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68711,6 +69138,7 @@ func init() { "operationId": "createSpoeMessage", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68803,6 +69231,7 @@ func init() { "operationId": "getSpoeMessage", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68879,6 +69308,7 @@ func init() { "operationId": "replaceSpoeMessage", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -68976,6 +69406,7 @@ func init() { "operationId": "deleteSpoeMessage", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -69055,6 +69486,7 @@ func init() { "operationId": "getAllSpoeTransaction", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -69105,6 +69537,7 @@ func init() { "operationId": "startSpoeTransaction", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -69169,6 +69602,7 @@ func init() { "operationId": "getSpoeTransaction", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -69225,6 +69659,7 @@ func init() { "operationId": "commitSpoeTransaction", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -69312,6 +69747,7 @@ func init() { "operationId": "deleteSpoeTransaction", "parameters": [ { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -69374,6 +69810,7 @@ func init() { "in": "query" }, { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", @@ -69602,7 +70039,7 @@ func init() { "parameters": [ { "type": "file", - "x-mimetype": "text/plain", + "x-mimetype": "application/octet-stream", "description": "General use file content", "name": "file_upload", "in": "formData" @@ -69710,7 +70147,7 @@ func init() { "put": { "description": "Replaces the contents of a managed general use file on disk", "consumes": [ - "text/plain" + "multipart/form-data" ], "produces": [ "application/json" @@ -69729,12 +70166,11 @@ func init() { "required": true }, { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "string" - } + "type": "file", + "x-mimetype": "application/octet-stream", + "description": "General use file content", + "name": "file_upload", + "in": "formData" }, { "type": "boolean", @@ -70209,6 +70645,13 @@ func init() { "name": "file_upload", "in": "formData" }, + { + "type": "boolean", + "default": false, + "description": "If set, no reload will be initiated after update", + "name": "skip_reload", + "in": "query" + }, { "type": "boolean", "default": false, @@ -71655,6 +72098,42 @@ func init() { }, "x-go-name": "SslEngine" }, + "StickTableEntryGpc": { + "type": "object", + "properties": { + "idx": { + "type": "integer" + }, + "value": { + "type": "integer", + "x-nullable": true + } + } + }, + "StickTableEntryGpcRate": { + "type": "object", + "properties": { + "idx": { + "type": "integer" + }, + "value": { + "type": "integer", + "x-nullable": true + } + } + }, + "StickTableEntryGpt": { + "type": "object", + "properties": { + "idx": { + "type": "integer" + }, + "value": { + "type": "integer", + "x-nullable": true + } + } + }, "StickTableFieldsItems0": { "type": "object", "properties": { @@ -71668,20 +72147,39 @@ func init() { "conn_cnt", "conn_cur", "conn_rate", + "glitch_cnt", + "glitch_rate", + "gpc", + "gpc_rate", "gpc0", "gpc0_rate", "gpc1", "gpc1_rate", "gpt0", + "gpt", "http_req_cnt", "http_req_rate", "http_err_cnt", "http_err_rate", + "http_fail_cnt", + "http_fail_rate", "server_id", "sess_cnt", "sess_rate" ] }, + "idx": { + "type": "integer", + "x-dependency": { + "field": { + "value": [ + "gpc", + "gpc_rate", + "gpt" + ] + } + } + }, "period": { "type": "integer", "x-dependency": { @@ -72084,9 +72582,7 @@ func init() { "pattern": "^[^\\s]+$", "x-dependency": { "cookie": { - "dynamic": { - "value": true - } + "dynamic.value": true } } }, @@ -72713,7 +73209,7 @@ func init() { "additionalProperties": false, "example": { "cond": "if", - "cond_test": "{ req_ssl_sni -i www.example.com }", + "cond_test": "{ req.ssl_sni -i www.example.com }", "index": 0, "name": "test_backend" } @@ -76082,6 +76578,9 @@ func init() { "pattern": "^[^\\s]+$", "x-display-name": "Group" }, + "h1_accept_payload_with_any_method": { + "type": "boolean" + }, "h1_case_adjust": { "type": "array", "items": { @@ -76093,6 +76592,9 @@ func init() { "h1_case_adjust_file": { "type": "string" }, + "h1_do_not_close_on_insecure_transfer_encoding": { + "type": "boolean" + }, "h2_workaround_bogus_websocket_clients": { "type": "boolean" }, @@ -76271,6 +76773,9 @@ func init() { "ssl_options": { "$ref": "#/definitions/ssl_options" }, + "stats_file": { + "type": "string" + }, "stats_maxconn": { "type": "integer", "x-display-name": "Stats maxconn", @@ -76461,7 +76966,7 @@ func init() { }, "capture_sample": { "type": "string", - "pattern": "^[^\\s]+$", + "pattern": "^(?:[A-Za-z]+\\(\"([A-Za-z\\s]+)\"\\)|[A-Za-z]+)", "x-dependency": { "type": { "value": "capture" @@ -77502,7 +78007,7 @@ func init() { }, "capture_sample": { "type": "string", - "pattern": "^[^\\s]+$", + "pattern": "^(?:[A-Za-z]+\\(\"([A-Za-z\\s]+)\"\\)|[A-Za-z]+)", "x-dependency": { "type": { "value": "capture" @@ -77995,6 +78500,18 @@ func init() { "x-display-name": "Return Error Code", "x-nullable": true }, + "rst_ttl": { + "type": "integer", + "x-dependency": { + "type": { + "required": true, + "value": [ + "silent-drop" + ] + } + }, + "x-display-name": "RST TTL" + }, "sc_expr": { "type": "string", "x-dependency": { @@ -78216,12 +78733,10 @@ func init() { "set-tos", "set-uri", "set-var", + "set-var-fmt", "silent-drop", "strict-mode", "tarpit", - "track-sc0", - "track-sc1", - "track-sc2", "track-sc", "unset-var", "use-service", @@ -78771,6 +79286,18 @@ func init() { "x-display-name": "Return Error Code", "x-nullable": true }, + "rst_ttl": { + "type": "integer", + "x-dependency": { + "type": { + "required": true, + "value": [ + "silent-drop" + ] + } + }, + "x-display-name": "RST TTL" + }, "sc_expr": { "type": "string", "x-dependency": { @@ -78983,9 +79510,6 @@ func init() { "set-var-fmt", "silent-drop", "strict-mode", - "track-sc0", - "track-sc1", - "track-sc2", "track-sc", "unset-var", "wait-for-body", @@ -80545,6 +81069,11 @@ func init() { "additionalProperties": { "$ref": "#/definitions/server" } + }, + "tables": { + "additionalProperties": { + "$ref": "#/definitions/table" + } } } } @@ -80597,6 +81126,10 @@ func init() { "busy_polling": { "type": "boolean" }, + "fd_hard_limit": { + "type": "integer", + "x-nullable": true + }, "max_spread_checks": { "type": "integer", "minimum": 0, @@ -81064,7 +81597,7 @@ func init() { }, "interval": { "type": "integer", - "x-nullable": false + "x-nullable": true } } }, @@ -81910,6 +82443,11 @@ func init() { "type": "integer", "x-nullable": true }, + "metadata": { + "additionalProperties": { + "type": "object" + } + }, "name": { "type": "string", "pattern": "^[^\\s]+$", @@ -82595,7 +83133,7 @@ func init() { "additionalProperties": false, "example": { "cond": "if", - "cond_test": "{ req_ssl_sni -i www.example.com }", + "cond_test": "{ req.ssl_sni -i www.example.com }", "target_server": "www" } }, @@ -83665,6 +84203,26 @@ func init() { "type": "integer", "x-nullable": true }, + "glitch_cnt": { + "type": "integer", + "x-nullable": true + }, + "glitch_rate": { + "type": "integer", + "x-nullable": true + }, + "gpc": { + "type": "object", + "properties": { + "idx": { + "type": "integer" + }, + "value": { + "type": "integer", + "x-nullable": true + } + } + }, "gpc0": { "type": "integer", "x-nullable": true @@ -83681,6 +84239,30 @@ func init() { "type": "integer", "x-nullable": true }, + "gpc_rate": { + "type": "object", + "properties": { + "idx": { + "type": "integer" + }, + "value": { + "type": "integer", + "x-nullable": true + } + } + }, + "gpt": { + "type": "object", + "properties": { + "idx": { + "type": "integer" + }, + "value": { + "type": "integer", + "x-nullable": true + } + } + }, "gpt0": { "type": "integer", "x-nullable": true @@ -83693,6 +84275,14 @@ func init() { "type": "integer", "x-nullable": true }, + "http_fail_cnt": { + "type": "integer", + "x-nullable": true + }, + "http_fail_rate": { + "type": "integer", + "x-nullable": true + }, "http_req_cnt": { "type": "integer", "x-nullable": true @@ -84176,9 +84766,6 @@ func init() { "set-var-fmt", "silent-drop", "switch-mode", - "track-sc0", - "track-sc1", - "track-sc2", "track-sc", "unset-var", "use-service" @@ -84250,7 +84837,7 @@ func init() { }, "capture_sample": { "type": "string", - "pattern": "^[^\\s]+$", + "pattern": "^(?:[A-Za-z]+\\(\"([A-Za-z\\s]+)\"\\)|[A-Za-z]+)", "x-dependency": { "action": { "required": true, @@ -84493,6 +85080,18 @@ func init() { }, "x-display-name": "Variable name" }, + "rst_ttl": { + "type": "integer", + "x-dependency": { + "type": { + "required": true, + "value": [ + "silent-drop" + ] + } + }, + "x-display-name": "RST TTL" + }, "sc_idx": { "type": "string", "x-dependency": { @@ -84658,9 +85257,6 @@ func init() { "action": { "required": true, "value": [ - "track-sc0", - "track-sc1", - "track-sc2", "track-sc" ] }, @@ -84680,9 +85276,6 @@ func init() { "action": { "required": false, "value": [ - "track-sc0", - "track-sc1", - "track-sc2", "track-sc" ] }, @@ -84703,9 +85296,6 @@ func init() { "action": { "required": false, "value": [ - "track-sc0", - "track-sc1", - "track-sc2", "track-sc" ] }, @@ -85012,6 +85602,18 @@ func init() { "x-display-name": "Nice Value", "x-nullable": false }, + "rst_ttl": { + "type": "integer", + "x-dependency": { + "type": { + "required": true, + "value": [ + "silent-drop" + ] + } + }, + "x-display-name": "RST TTL" + }, "sc_expr": { "type": "string", "x-dependency": { @@ -85762,6 +86364,7 @@ func init() { }, "user": { "description": "HAProxy userlist user", + "type": "object", "title": "User", "required": [ "username", @@ -85885,6 +86488,7 @@ func init() { "in": "query" }, "parent_name": { + "pattern": "^[^\\r\\n\u003c\u003e*;$#\u0026{}\"]+$", "type": "string", "description": "Parent name", "name": "parent_name", diff --git a/generate/go-generate.go b/generate/go-generate.go index d068f3c4..0f505466 100644 --- a/generate/go-generate.go +++ b/generate/go-generate.go @@ -63,7 +63,7 @@ var groupParents = map[string]string{ "log_targets": "log", } -var itemDefaults = map[string]interface{}{ +var itemDefaults = map[string]any{ "port": 80, "listen_limit": 1024, "tls_host": "null", @@ -116,7 +116,7 @@ type ParseData struct { func readServerData(filePath string, pd *ParseData, structName string, attName string, groupName string, isList bool) { typeStruct := fmt.Sprintf("type %s struct {", structName) - dat, err := os.ReadFile(filePath) + dat, err := os.ReadFile(filePath) //nolint:gosec // paths from trusted build tool arguments if err != nil { log.Panic(err) } @@ -208,8 +208,8 @@ func stripAtomic(str string) string { if len(str) == 0 { return "" } - if strings.HasPrefix(str, "Atomic") { - return strings.ToLower(strings.TrimPrefix(str, "Atomic")) + if after, ok := strings.CutPrefix(str, "Atomic"); ok { + return strings.ToLower(after) } return str } @@ -345,7 +345,7 @@ func main() { } tmpl = tmpl.Funcs(funcMap) filePath = path.Join(dir, "configuration", "configuration_generated.go") - f, err := os.Create(filePath) + f, err := os.Create(filePath) //nolint:gosec // paths from trusted build tool arguments if err != nil { log.Panic(err) } @@ -363,7 +363,7 @@ func main() { } tmpl = tmpl.Funcs(funcMap) filePath = path.Join(dir, "dataplaneapi_generated.go") - f, err = os.Create(filePath) + f, err = os.Create(filePath) //nolint:gosec // paths from trusted build tool arguments if err != nil { log.Panic(err) } @@ -381,7 +381,7 @@ func main() { } tmpl = tmpl.Funcs(funcMap) filePath = path.Join(dir, "configuration/examples/example-full.yaml") - f, err = os.Create(filePath) + f, err = os.Create(filePath) //nolint:gosec // paths from trusted build tool arguments if err != nil { log.Panic(err) } @@ -471,7 +471,7 @@ func processLine(line string) (Attribute, error) { } func fmtFile(filename string) { - cmd := exec.Command("gofmt", "-s", "-w", filename) + cmd := exec.Command("gofmt", "-s", "-w", filename) //nolint:gosec // paths from trusted build tool arguments err := cmd.Run() if err != nil { log.Fatalf("cmd.Run() failed with %s\n", err) diff --git a/generate/parents/main.go b/generate/parents/main.go index 0474281b..d7afa51c 100644 --- a/generate/parents/main.go +++ b/generate/parents/main.go @@ -20,7 +20,7 @@ import ( "strings" "text/template" - "github.com/go-openapi/swag" + "github.com/go-openapi/swag/mangling" cnparents "github.com/haproxytech/client-native/v6/configuration/parents" ) @@ -81,10 +81,10 @@ func generateAlias(childType string) bytes.Buffer { } parents := cnparents.Parents(childType) fmt.Printf("Generating for child %s / parents: %v\n", childType, parents) - + mangler := mangling.NewNameMangler(mangling.WithAdditionalInitialisms("QUIC")) tmplData := TmplData{ ChildType: childType, - GoChildType: swag.ToGoName(childType), + GoChildType: mangler.ToGoName(childType), Operations: operations(childType), OperationPackage: childType, } diff --git a/generate/parents/parent_generated.tmpl b/generate/parents/parent_generated.tmpl index b59c5398..036b4d20 100644 --- a/generate/parents/parent_generated.tmpl +++ b/generate/parents/parent_generated.tmpl @@ -36,7 +36,7 @@ type ( {{ range $i, $op := $out.Operations -}} {{ range parents $out.ChildType -}} -func (h *{{ $op }}{{ $out.GoChildType }}{{ .ParentType }}HandlerImpl) Handle(params {{ $out.OperationPackage }}.{{ $op }}{{ $out.GoChildType }}{{ .ParentType }}Params, principal interface{}) middleware.Responder { +func (h *{{ $op }}{{ $out.GoChildType }}{{ .ParentType }}HandlerImpl) Handle(params {{ $out.OperationPackage }}.{{ $op }}{{ $out.GoChildType }}{{ .ParentType }}Params, principal any) middleware.Responder { g := {{ $op }}{{ $out.GoChildType }}HandlerImpl(*h) {{ if not .IsGenericParent -}} pg := {{ $out.OperationPackage }}.{{ $op }}{{ $out.GoChildType }}{{ .GenericParentType }}Params(params) diff --git a/generate/swagger/Dockerfile b/generate/swagger/Dockerfile index 7e7df7dc..d470c5ee 100644 --- a/generate/swagger/Dockerfile +++ b/generate/swagger/Dockerfile @@ -1,5 +1,11 @@ ARG SWAGGER_VERSION -FROM quay.io/goswagger/swagger:$SWAGGER_VERSION + +FROM golang:1.26 AS golang + +FROM quay.io/goswagger/swagger:0.32.3 +COPY --from=golang /usr/local/go /usr/local/go + +ENV PATH="$PATH:/usr/local/go/bin" WORKDIR /data ARG UID diff --git a/generate/swagger/script.sh b/generate/swagger/script.sh index 815120d3..4e16948a 100755 --- a/generate/swagger/script.sh +++ b/generate/swagger/script.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +GO_VERSION=$(go version) +echo " ---> go version: $GO_VERSION" SPEC_DIR=$(mktemp -d) echo " ---> source folder: $SPEC_DIR" DST_DIR=$(mktemp -d) diff --git a/go.mod b/go.mod index da284b7b..fb553fbf 100644 --- a/go.mod +++ b/go.mod @@ -1,98 +1,104 @@ module github.com/haproxytech/dataplaneapi -go 1.22 +go 1.26 require ( github.com/GehirnInc/crypt v0.0.0-20230320061759-8cc1b52080c5 - github.com/KimMachineGun/automemlimit v0.6.1 - github.com/aws/aws-sdk-go-v2 v1.30.1 - github.com/aws/aws-sdk-go-v2/config v1.27.24 - github.com/aws/aws-sdk-go-v2/credentials v1.17.24 - github.com/aws/aws-sdk-go-v2/service/autoscaling v1.43.1 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.168.0 + github.com/KimMachineGun/automemlimit v0.7.4 + github.com/aws/aws-sdk-go-v2 v1.39.2 + github.com/aws/aws-sdk-go-v2/config v1.31.12 + github.com/aws/aws-sdk-go-v2/credentials v1.18.16 + github.com/aws/aws-sdk-go-v2/service/autoscaling v1.56.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.254.1 github.com/docker/go-units v0.5.0 github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0 - github.com/fsnotify/fsnotify v1.7.0 - github.com/getkin/kin-openapi v0.124.0 - github.com/go-openapi/errors v0.22.0 - github.com/go-openapi/loads v0.22.0 - github.com/go-openapi/runtime v0.28.0 - github.com/go-openapi/spec v0.21.0 - github.com/go-openapi/strfmt v0.23.0 - github.com/go-openapi/swag v0.23.0 - github.com/go-openapi/validate v0.24.0 - github.com/google/go-cmp v0.6.0 + github.com/fsnotify/fsnotify v1.9.0 + github.com/getkin/kin-openapi v0.133.0 + github.com/go-openapi/errors v0.22.7 + github.com/go-openapi/loads v0.23.3 + github.com/go-openapi/runtime v0.29.0 + github.com/go-openapi/spec v0.22.4 + github.com/go-openapi/strfmt v0.26.1 + github.com/go-openapi/swag v0.25.5 + github.com/go-openapi/swag/cmdutils v0.25.5 + github.com/go-openapi/swag/mangling v0.25.5 + github.com/go-openapi/validate v0.25.2 + github.com/google/go-cmp v0.7.0 github.com/google/renameio v1.0.1 github.com/google/uuid v1.6.0 - github.com/haproxytech/client-native/v6 v6.0.0 - github.com/jessevdk/go-flags v1.5.0 + github.com/haproxytech/client-native/v6 v6.0.22 + github.com/jessevdk/go-flags v1.6.1 github.com/joho/godotenv v1.5.1 github.com/json-iterator/go v1.1.12 github.com/kr/pretty v0.3.1 github.com/lestrrat-go/apache-logformat v0.0.0-20210106032603-24d066f940f8 - github.com/maruel/panicparse/v2 v2.3.1 + github.com/maruel/panicparse/v2 v2.5.0 github.com/nathanaelle/syslog5424/v2 v2.0.5 - github.com/rs/cors v1.11.0 + github.com/rs/cors v1.11.1 github.com/rubyist/circuitbreaker v2.2.1+incompatible github.com/shirou/gopsutil v3.21.11+incompatible github.com/sirupsen/logrus v1.9.3 - github.com/stretchr/testify v1.9.0 - go.uber.org/automaxprocs v1.5.3 - golang.org/x/net v0.27.0 - golang.org/x/sys v0.24.0 + github.com/stretchr/testify v1.11.1 + go.uber.org/automaxprocs v1.6.0 + golang.org/x/net v0.52.0 + golang.org/x/sys v0.42.0 gopkg.in/yaml.v2 v2.4.0 ) require ( - github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.22.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.2 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.30.1 // indirect - github.com/aws/smithy-go v1.20.3 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.9 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.9 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.9 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.29.6 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.38.6 // indirect + github.com/aws/smithy-go v1.23.0 // indirect github.com/cenk/backoff v2.2.1+incompatible // indirect - github.com/cilium/ebpf v0.15.0 // indirect - github.com/containerd/cgroups/v3 v3.0.3 // indirect - github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect github.com/go-ole/go-ole v1.3.0 // indirect - github.com/go-openapi/analysis v0.23.0 // indirect - github.com/go-openapi/jsonpointer v0.21.0 // indirect - github.com/go-openapi/jsonreference v0.21.0 // indirect - github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/gofrs/flock v0.12.1 // indirect + github.com/go-openapi/analysis v0.25.0 // indirect + github.com/go-openapi/jsonpointer v0.22.5 // indirect + github.com/go-openapi/jsonreference v0.21.5 // indirect + github.com/go-openapi/swag/conv v0.25.5 // indirect + github.com/go-openapi/swag/fileutils v0.25.5 // indirect + github.com/go-openapi/swag/jsonname v0.25.5 // indirect + github.com/go-openapi/swag/jsonutils v0.25.5 // indirect + github.com/go-openapi/swag/loading v0.25.5 // indirect + github.com/go-openapi/swag/netutils v0.25.5 // indirect + github.com/go-openapi/swag/stringutils v0.25.5 // indirect + github.com/go-openapi/swag/typeutils v0.25.5 // indirect + github.com/go-openapi/swag/yamlutils v0.25.5 // indirect + github.com/go-viper/mapstructure/v2 v2.5.0 // indirect + github.com/gofrs/flock v0.13.0 // indirect github.com/haproxytech/go-logger v1.1.0 // indirect - github.com/invopop/yaml v0.3.1 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lestrrat-go/strftime v1.0.6 // indirect - github.com/mailru/easyjson v0.7.7 // indirect + github.com/lestrrat-go/strftime v1.1.1 // indirect + github.com/mailru/easyjson v0.9.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect - github.com/oklog/ulid v1.3.1 // indirect - github.com/opencontainers/runtime-spec v1.2.0 // indirect + github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect + github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect + github.com/oklog/ulid/v2 v2.1.1 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/tklauser/go-sysconf v0.3.14 // indirect - github.com/tklauser/numcpus v0.8.0 // indirect + github.com/rogpeppe/go-internal v1.14.1 // indirect + github.com/tklauser/go-sysconf v0.3.15 // indirect + github.com/tklauser/numcpus v0.10.0 // indirect + github.com/woodsbury/decimal128 v1.4.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.mongodb.org/mongo-driver v1.16.1 // indirect - golang.org/x/exp v0.0.0-20240707233637-46b078467d37 // indirect - golang.org/x/sync v0.8.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/text v0.35.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index df2bebb5..6c9a3a9f 100644 --- a/go.sum +++ b/go.sum @@ -1,47 +1,39 @@ github.com/GehirnInc/crypt v0.0.0-20230320061759-8cc1b52080c5 h1:IEjq88XO4PuBDcvmjQJcQGg+w+UaafSy8G5Kcb5tBhI= github.com/GehirnInc/crypt v0.0.0-20230320061759-8cc1b52080c5/go.mod h1:exZ0C/1emQJAw5tHOaUDyY1ycttqBAPcxuzf7QbY6ec= -github.com/KimMachineGun/automemlimit v0.6.1 h1:ILa9j1onAAMadBsyyUJv5cack8Y1WT26yLj/V+ulKp8= -github.com/KimMachineGun/automemlimit v0.6.1/go.mod h1:T7xYht7B8r6AG/AqFcUdc7fzd2bIdBKmepfP2S1svPY= -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/aws/aws-sdk-go-v2 v1.30.1 h1:4y/5Dvfrhd1MxRDD77SrfsDaj8kUkkljU7XE83NPV+o= -github.com/aws/aws-sdk-go-v2 v1.30.1/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= -github.com/aws/aws-sdk-go-v2/config v1.27.24 h1:NM9XicZ5o1CBU/MZaHwFtimRpWx9ohAUAqkG6AqSqPo= -github.com/aws/aws-sdk-go-v2/config v1.27.24/go.mod h1:aXzi6QJTuQRVVusAO8/NxpdTeTyr/wRcybdDtfUwJSs= -github.com/aws/aws-sdk-go-v2/credentials v1.17.24 h1:YclAsrnb1/GTQNt2nzv+756Iw4mF8AOzcDfweWwwm/M= -github.com/aws/aws-sdk-go-v2/credentials v1.17.24/go.mod h1:Hld7tmnAkoBQdTMNYZGzztzKRdA4fCdn9L83LOoigac= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.9 h1:Aznqksmd6Rfv2HQN9cpqIV/lQRMaIpJkLLaJ1ZI76no= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.9/go.mod h1:WQr3MY7AxGNxaqAtsDWn+fBxmd4XvLkzeqQ8P1VM0/w= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13 h1:5SAoZ4jYpGH4721ZNoS1znQrhOfZinOhc4XuTXx/nVc= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13/go.mod h1:+rdA6ZLpaSeM7tSg/B0IEDinCIBJGmW8rKDFkYpP04g= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13 h1:WIijqeaAO7TYFLbhsZmi2rgLEAtWOC1LhxCAVTJlSKw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13/go.mod h1:i+kbfa76PQbWw/ULoWnp51EYVWH4ENln76fLQE3lXT8= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.43.1 h1:nV3iVzSwz69etCRlmifzbxueN9KnnCq0hQow9ezJSzU= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.43.1/go.mod h1:SR3acVqfWMo5J4hI3WHHP0+cgC5yvEVjG9PJXtbOqQg= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.168.0 h1:xOPq0agGC1WMZvFpSZCKEjDVAQnLPZJZGvjuPVF2t9M= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.168.0/go.mod h1:CtLD6CPq9z9dyMxV+H6/M5d9+/ea3dO80um029GXqV0= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15 h1:I9zMeF107l0rJrpnHpjEiiTSCKYAIw8mALiXcPsGBiA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15/go.mod h1:9xWJ3Q/S6Ojusz1UIkfycgD1mGirJfLLKqq3LPT7WN8= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.1 h1:p1GahKIjyMDZtiKoIn0/jAj/TkMzfzndDv5+zi2Mhgc= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.1/go.mod h1:/vWdhoIoYA5hYoPZ6fm7Sv4d8701PiG5VKe8/pPJL60= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.2 h1:ORnrOK0C4WmYV/uYt3koHEWBLYsRDwk2Np+eEoyV4Z0= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.2/go.mod h1:xyFHA4zGxgYkdD73VeezHt3vSKEG9EmFnGwoKlP00u4= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.1 h1:+woJ607dllHJQtsnJLi52ycuqHMwlW+Wqm2Ppsfp4nQ= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.1/go.mod h1:jiNR3JqT15Dm+QWq2SRgh0x0bCNSRP2L25+CqPNpJlQ= -github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= -github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= +github.com/KimMachineGun/automemlimit v0.7.4 h1:UY7QYOIfrr3wjjOAqahFmC3IaQCLWvur9nmfIn6LnWk= +github.com/KimMachineGun/automemlimit v0.7.4/go.mod h1:QZxpHaGOQoYvFhv/r4u3U0JTC2ZcOwbSr11UZF46UBM= +github.com/aws/aws-sdk-go-v2 v1.39.2 h1:EJLg8IdbzgeD7xgvZ+I8M1e0fL0ptn/M47lianzth0I= +github.com/aws/aws-sdk-go-v2 v1.39.2/go.mod h1:sDioUELIUO9Znk23YVmIk86/9DOpkbyyVb1i/gUNFXY= +github.com/aws/aws-sdk-go-v2/config v1.31.12 h1:pYM1Qgy0dKZLHX2cXslNacbcEFMkDMl+Bcj5ROuS6p8= +github.com/aws/aws-sdk-go-v2/config v1.31.12/go.mod h1:/MM0dyD7KSDPR+39p9ZNVKaHDLb9qnfDurvVS2KAhN8= +github.com/aws/aws-sdk-go-v2/credentials v1.18.16 h1:4JHirI4zp958zC026Sm+V4pSDwW4pwLefKrc0bF2lwI= +github.com/aws/aws-sdk-go-v2/credentials v1.18.16/go.mod h1:qQMtGx9OSw7ty1yLclzLxXCRbrkjWAM7JnObZjmCB7I= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.9 h1:Mv4Bc0mWmv6oDuSWTKnk+wgeqPL5DRFu5bQL9BGPQ8Y= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.9/go.mod h1:IKlKfRppK2a1y0gy1yH6zD+yX5uplJ6UuPlgd48dJiQ= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.9 h1:se2vOWGD3dWQUtfn4wEjRQJb1HK1XsNIt825gskZ970= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.9/go.mod h1:hijCGH2VfbZQxqCDN7bwz/4dzxV+hkyhjawAtdPWKZA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.9 h1:6RBnKZLkJM4hQ+kN6E7yWFveOTg8NLPHAkqrs4ZPlTU= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.9/go.mod h1:V9rQKRmK7AWuEsOMnHzKj8WyrIir1yUJbZxDuZLFvXI= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.56.0 h1:YO7rat493hVtpBExbcDPKdGzk9eYTtaUrwaFJSWAqLo= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.56.0/go.mod h1:6vrMqNnS2fpOfZ9tZmIGDWYGTio7+SJ18fql3IwoSBg= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.254.1 h1:7p9bJCZ/b3EJXXARW7JMEs2IhsnI4YFHpfXQfgMh0eg= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.254.1/go.mod h1:M8WWWIfXmxA4RgTXcI/5cSByxRqjgne32Sh0VIbrn0A= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 h1:oegbebPEMA/1Jny7kvwejowCaHz1FWZAQ94WXFNCyTM= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1/go.mod h1:kemo5Myr9ac0U9JfSjMo9yHLtw+pECEHsFtJ9tqCEI8= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 h1:5r34CgVOD4WZudeEKZ9/iKpiT6cM1JyEROpXjOcdWv8= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9/go.mod h1:dB12CEbNWPbzO2uC6QSWHteqOg4JfBVJOojbAoAUb5I= +github.com/aws/aws-sdk-go-v2/service/sso v1.29.6 h1:A1oRkiSQOWstGh61y4Wc/yQ04sqrQZr1Si/oAXj20/s= +github.com/aws/aws-sdk-go-v2/service/sso v1.29.6/go.mod h1:5PfYspyCU5Vw1wNPsxi15LZovOnULudOQuVxphSflQA= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.1 h1:5fm5RTONng73/QA73LhCNR7UT9RpFH3hR6HWL6bIgVY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.1/go.mod h1:xBEjWD13h+6nq+z4AkqSfSvqRKFgDIQeaMguAJndOWo= +github.com/aws/aws-sdk-go-v2/service/sts v1.38.6 h1:p3jIvqYwUZgu/XYeI48bJxOhvm47hZb5HUQ0tn6Q9kA= +github.com/aws/aws-sdk-go-v2/service/sts v1.38.6/go.mod h1:WtKK+ppze5yKPkZ0XwqIVWD4beCwv056ZbPQNoeHqM8= +github.com/aws/smithy-go v1.23.0 h1:8n6I3gXzWJB2DxBDnfxgBaSX6oe0d/t10qGz7OKqMCE= +github.com/aws/smithy-go v1.23.0/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI= github.com/cenk/backoff v2.2.1+incompatible h1:djdFT7f4gF2ttuzRKPbMOWgZajgesItGLwG5FTQKmmE= github.com/cenk/backoff v2.2.1+incompatible/go.mod h1:7FtoeaSnHoZnmZzz47cM35Y9nSW7tNyaidugnHTaFDE= -github.com/cilium/ebpf v0.15.0 h1:7NxJhNiBT3NG8pZJ3c+yfrVdHY8ScgKD27sScgjLMMk= -github.com/cilium/ebpf v0.15.0/go.mod h1:DHp1WyrLeiBh19Cf/tfiSMhqheEiK8fXFZ4No0P1Hso= -github.com/containerd/cgroups/v3 v3.0.3 h1:S5ByHZ/h9PMe5IOQoN7E+nMc2UcLEM/V48DGDJ9kip0= -github.com/containerd/cgroups/v3 v3.0.3/go.mod h1:8HBe7V3aWGLFPd/k03swSIsGjZhHI2WzJmticMgVuz0= -github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= 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= @@ -52,64 +44,84 @@ github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0 h1:a github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0/go.mod h1:8AuBTZBRSFqEYBPYULd+NN474/zZBLP+6WeT5S9xlAc= github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a h1:yDWHCSQ40h88yih2JAcL6Ls/kVkSE8GFACTGVnMPruw= github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a/go.mod h1:7Ga40egUymuWXxAe151lTNnCv97MddSOVsjpPPkityA= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/getkin/kin-openapi v0.124.0 h1:VSFNMB9C9rTKBnQ/fpyDU8ytMTr4dWI9QovSKj9kz/M= -github.com/getkin/kin-openapi v0.124.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= -github.com/go-faker/faker/v4 v4.4.2 h1:96WeU9QKEqRUVYdjHquY2/5bAqmVM0IfGKHV5mbfqmQ= -github.com/go-faker/faker/v4 v4.4.2/go.mod h1:4K3v4AbKXYNHMQNaREMc9/kRB9j5JJzpFo6KHRvrcIw= +github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= +github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/getkin/kin-openapi v0.133.0 h1:pJdmNohVIJ97r4AUFtEXRXwESr8b0bD721u/Tz6k8PQ= +github.com/getkin/kin-openapi v0.133.0/go.mod h1:boAciF6cXk5FhPqe/NQeBTeenbjqU4LhWBf09ILVvWE= +github.com/go-faker/faker/v4 v4.7.0 h1:VboC02cXHl/NuQh5lM2W8b87yp4iFXIu59x4w0RZi4E= +github.com/go-faker/faker/v4 v4.7.0/go.mod h1:u1dIRP5neLB6kTzgyVjdBOV5R1uP7BdxkcWk7tiKQXk= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= -github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU= -github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo= -github.com/go-openapi/errors v0.22.0 h1:c4xY/OLxUBSTiepAg3j/MHuAv5mJhnf53LLMWFB+u/w= -github.com/go-openapi/errors v0.22.0/go.mod h1:J3DmZScxCDufmIMsdOuDHxJbdOGC0xtUynjIx092vXE= -github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= -github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= -github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= -github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= -github.com/go-openapi/loads v0.22.0 h1:ECPGd4jX1U6NApCGG1We+uEozOAvXvJSF4nnwHZ8Aco= -github.com/go-openapi/loads v0.22.0/go.mod h1:yLsaTCS92mnSAZX5WWoxszLj0u+Ojl+Zs5Stn1oF+rs= -github.com/go-openapi/runtime v0.28.0 h1:gpPPmWSNGo214l6n8hzdXYhPuJcGtziTOgUpvsFWGIQ= -github.com/go-openapi/runtime v0.28.0/go.mod h1:QN7OzcS+XuYmkQLw05akXk0jRH/eZ3kb18+1KwW9gyc= -github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= -github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= -github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c= -github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4= -github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= -github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= -github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3BumrGD58= -github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ= -github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= -github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= +github.com/go-openapi/analysis v0.25.0 h1:EnjAq1yO8wEO9HbPmY8vLPEIkdZuuFhCAKBPvCB7bCs= +github.com/go-openapi/analysis v0.25.0/go.mod h1:5WFTRE43WLkPG9r9OtlMfqkkvUTYLVVCIxLlEpyF8kE= +github.com/go-openapi/errors v0.22.7 h1:JLFBGC0Apwdzw3484MmBqspjPbwa2SHvpDm0u5aGhUA= +github.com/go-openapi/errors v0.22.7/go.mod h1://QW6SD9OsWtH6gHllUCddOXDL0tk0ZGNYHwsw4sW3w= +github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA= +github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0= +github.com/go-openapi/jsonreference v0.21.5 h1:6uCGVXU/aNF13AQNggxfysJ+5ZcU4nEAe+pJyVWRdiE= +github.com/go-openapi/jsonreference v0.21.5/go.mod h1:u25Bw85sX4E2jzFodh1FOKMTZLcfifd1Q+iKKOUxExw= +github.com/go-openapi/loads v0.23.3 h1:g5Xap1JfwKkUnZdn+S0L3SzBDpcTIYzZ5Qaag0YDkKQ= +github.com/go-openapi/loads v0.23.3/go.mod h1:NOH07zLajXo8y55hom0omlHWDVVvCwBM/S+csCK8LqA= +github.com/go-openapi/runtime v0.29.0 h1:Y7iDTFarS9XaFQ+fA+lBLngMwH6nYfqig1G+pHxMRO0= +github.com/go-openapi/runtime v0.29.0/go.mod h1:52HOkEmLL/fE4Pg3Kf9nxc9fYQn0UsIWyGjGIJE9dkg= +github.com/go-openapi/spec v0.22.4 h1:4pxGjipMKu0FzFiu/DPwN3CTBRlVM2yLf/YTWorYfDQ= +github.com/go-openapi/spec v0.22.4/go.mod h1:WQ6Ai0VPWMZgMT4XySjlRIE6GP1bGQOtEThn3gcWLtQ= +github.com/go-openapi/strfmt v0.26.1 h1:7zGCHji7zSYDC2tCXIusoxYQz/48jAf2q+sF6wXTG+c= +github.com/go-openapi/strfmt v0.26.1/go.mod h1:Zslk5VZPOISLwmWTMBIS7oiVFem1o1EI6zULY8Uer7Y= +github.com/go-openapi/swag v0.25.5 h1:pNkwbUEeGwMtcgxDr+2GBPAk4kT+kJ+AaB+TMKAg+TU= +github.com/go-openapi/swag v0.25.5/go.mod h1:B3RT6l8q7X803JRxa2e59tHOiZlX1t8viplOcs9CwTA= +github.com/go-openapi/swag/cmdutils v0.25.5 h1:yh5hHrpgsw4NwM9KAEtaDTXILYzdXh/I8Whhx9hKj7c= +github.com/go-openapi/swag/cmdutils v0.25.5/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.5 h1:wAXBYEXJjoKwE5+vc9YHhpQOFj2JYBMF2DUi+tGu97g= +github.com/go-openapi/swag/conv v0.25.5/go.mod h1:CuJ1eWvh1c4ORKx7unQnFGyvBbNlRKbnRyAvDvzWA4k= +github.com/go-openapi/swag/fileutils v0.25.5 h1:B6JTdOcs2c0dBIs9HnkyTW+5gC+8NIhVBUwERkFhMWk= +github.com/go-openapi/swag/fileutils v0.25.5/go.mod h1:V3cT9UdMQIaH4WiTrUc9EPtVA4txS0TOmRURmhGF4kc= +github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo= +github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU= +github.com/go-openapi/swag/jsonutils v0.25.5 h1:XUZF8awQr75MXeC+/iaw5usY/iM7nXPDwdG3Jbl9vYo= +github.com/go-openapi/swag/jsonutils v0.25.5/go.mod h1:48FXUaz8YsDAA9s5AnaUvAmry1UcLcNVWUjY42XkrN4= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5 h1:SX6sE4FrGb4sEnnxbFL/25yZBb5Hcg1inLeErd86Y1U= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5/go.mod h1:/2KvOTrKWjVA5Xli3DZWdMCZDzz3uV/T7bXwrKWPquo= +github.com/go-openapi/swag/loading v0.25.5 h1:odQ/umlIZ1ZVRteI6ckSrvP6e2w9UTF5qgNdemJHjuU= +github.com/go-openapi/swag/loading v0.25.5/go.mod h1:I8A8RaaQ4DApxhPSWLNYWh9NvmX2YKMoB9nwvv6oW6g= +github.com/go-openapi/swag/mangling v0.25.5 h1:hyrnvbQRS7vKePQPHHDso+k6CGn5ZBs5232UqWZmJZw= +github.com/go-openapi/swag/mangling v0.25.5/go.mod h1:6hadXM/o312N/h98RwByLg088U61TPGiltQn71Iw0NY= +github.com/go-openapi/swag/netutils v0.25.5 h1:LZq2Xc2QI8+7838elRAaPCeqJnHODfSyOa7ZGfxDKlU= +github.com/go-openapi/swag/netutils v0.25.5/go.mod h1:lHbtmj4m57APG/8H7ZcMMSWzNqIQcu0RFiXrPUara14= +github.com/go-openapi/swag/stringutils v0.25.5 h1:NVkoDOA8YBgtAR/zvCx5rhJKtZF3IzXcDdwOsYzrB6M= +github.com/go-openapi/swag/stringutils v0.25.5/go.mod h1:PKK8EZdu4QJq8iezt17HM8RXnLAzY7gW0O1KKarrZII= +github.com/go-openapi/swag/typeutils v0.25.5 h1:EFJ+PCga2HfHGdo8s8VJXEVbeXRCYwzzr9u4rJk7L7E= +github.com/go-openapi/swag/typeutils v0.25.5/go.mod h1:itmFmScAYE1bSD8C4rS0W+0InZUBrB2xSPbWt6DLGuc= +github.com/go-openapi/swag/yamlutils v0.25.5 h1:kASCIS+oIeoc55j28T4o8KwlV2S4ZLPT6G0iq2SSbVQ= +github.com/go-openapi/swag/yamlutils v0.25.5/go.mod h1:Gek1/SjjfbYvM+Iq4QGwa/2lEXde9n2j4a3wI3pNuOQ= +github.com/go-openapi/testify/enable/yaml/v2 v2.4.1 h1:NZOrZmIb6PTv5LTFxr5/mKV/FjbUzGE7E6gLz7vFoOQ= +github.com/go-openapi/testify/enable/yaml/v2 v2.4.1/go.mod h1:r7dwsujEHawapMsxA69i+XMGZrQ5tRauhLAjV/sxg3Q= +github.com/go-openapi/testify/v2 v2.4.1 h1:zB34HDKj4tHwyUQHrUkpV0Q0iXQ6dUCOQtIqn8hE6Iw= +github.com/go-openapi/testify/v2 v2.4.1/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-openapi/validate v0.25.2 h1:12NsfLAwGegqbGWr2CnvT65X/Q2USJipmJ9b7xDJZz0= +github.com/go-openapi/validate v0.25.2/go.mod h1:Pgl1LpPPGFnZ+ys4/hTlDiRYQdI1ocKypgE+8Q8BLfY= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= -github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= -github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -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/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= +github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw= +github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/renameio v1.0.1 h1:Lh/jXZmvZxb0BBeSY5VKEfidcbcbenKjZFzM/q0fSeU= github.com/google/renameio v1.0.1/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/haproxytech/client-native/v6 v6.0.0 h1:hLU9UNGoPOmBFsXk9+5qKG3L3tUoQtKl9w5YhOehuow= -github.com/haproxytech/client-native/v6 v6.0.0/go.mod h1:RG/erRZ36Z5YT5li461ZiQgfxRgg4ohhqCQWt6QUjrU= +github.com/haproxytech/client-native/v5 v5.1.9 h1:D+JvMsRHCewn+r+FJpzf3QUu2yHwGuV+s6IuJlajxYE= +github.com/haproxytech/client-native/v5 v5.1.9/go.mod h1:rSJ7gT0vpZqNYdZQwzttLC4doOyoTL+B68F7cDjELNQ= +github.com/haproxytech/client-native/v6 v6.0.22 h1:B1rbropuBzFs/krOXPuEwm8begA1zZT45m5F8b5QElw= +github.com/haproxytech/client-native/v6 v6.0.22/go.mod h1:kn7HnkA39HxEajPPOCP3gG8thGZYSw1gO9oMEsxvjqU= github.com/haproxytech/go-logger v1.1.0 h1:HgGtYaI1ApkvbQdsm7f9AzQQoxTB7w37criTflh7IQE= github.com/haproxytech/go-logger v1.1.0/go.mod h1:OekUd8HCb7ubxMplzHUPBTHNxZmddOWfOjWclZsqIeM= -github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso= -github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA= -github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jessevdk/go-flags v1.6.1 h1:Cvu5U8UGrLay1rZfv/zP7iLpSHGUZ/Ou68T0iX1bBK4= +github.com/jessevdk/go-flags v1.6.1/go.mod h1:Mk8T1hIAWpOiJiHa9rJASDK2UGWji0EuPGBnNLMooyc= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -127,15 +139,12 @@ github.com/lestrrat-go/apache-logformat v0.0.0-20210106032603-24d066f940f8/go.mo github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= github.com/lestrrat-go/strftime v0.0.0-20180821113735-8b31f9c59b0f/go.mod h1:RMlXygAD3c48Psmr06d2G75L4E4xxzxkIe/+ppX9eAU= -github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ= -github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/maruel/panicparse/v2 v2.3.1 h1:NtJavmbMn0DyzmmSStE8yUsmPZrZmudPH7kplxBinOA= -github.com/maruel/panicparse/v2 v2.3.1/go.mod h1:s3UmQB9Fm/n7n/prcD2xBGDkwXD6y2LeZnhbEXvs9Dg= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/lestrrat-go/strftime v1.1.1 h1:zgf8QCsgj27GlKBy3SU9/8MMgegZ8UCzlCyHYrUF0QU= +github.com/lestrrat-go/strftime v1.1.1/go.mod h1:YDrzHJAODYQ+xxvrn5SG01uFIQAeDTzpxNVppCz7Nmw= +github.com/mailru/easyjson v0.9.1 h1:LbtsOm5WAswyWbvTEOqhypdPeZzHavpZx96/n553mR8= +github.com/mailru/easyjson v0.9.1/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= +github.com/maruel/panicparse/v2 v2.5.0 h1:yCtuS0FWjfd0RTYMXGpDvWcb0kINm8xJGu18/xMUh00= +github.com/maruel/panicparse/v2 v2.5.0/go.mod h1:DA2fDiBk63bKfBf4CVZP9gb4fuvzdPbLDsSI873hweQ= 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/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -147,12 +156,15 @@ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/nathanaelle/syslog5424/v2 v2.0.5 h1:oLVYQmKnv3nlnmvlbBWM+iWl9AONcU+tuxIL0fjko5A= github.com/nathanaelle/syslog5424/v2 v2.0.5/go.mod h1:f9MvsGkLOtYh2VzLT4Pjuwx3+Xv2EogxJNda+HLPDus= -github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= -github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 h1:G7ERwszslrBzRxj//JalHPu/3yz+De2J+4aLtSRlHiY= +github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037/go.mod h1:2bpvgLBZEtENV5scfDFEtB/5+1M4hkQhDQrccEJ/qGw= +github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 h1:bQx3WeLcUWy+RletIKwUIt4x3t8n2SxavmoclizMb8c= +github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= +github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s= +github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= +github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea h1:sKwxy1H95npauwu8vtF95vG/syrL0p8fSZo/XlDg5gk= @@ -166,10 +178,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= -github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rubyist/circuitbreaker v2.2.1+incompatible h1:KUKd/pV8Geg77+8LNDwdow6rVCAYOp8+kHUyFvL6Mhk= github.com/rubyist/circuitbreaker v2.2.1+incompatible/go.mod h1:Ycs3JgJADPuzJDwffe12k6BZT8hxVi6lFK+gWYJLN4A= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= @@ -179,46 +191,36 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= -github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= -github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY= -github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4= +github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4= +github.com/tklauser/numcpus v0.10.0 h1:18njr6LDBk1zuna922MgdjQuJFjrdppsZG60sHGfjso= +github.com/tklauser/numcpus v0.10.0/go.mod h1:BiTKazU708GQTYF4mB+cmlpT2Is1gLk7XVuEeem8LsQ= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/woodsbury/decimal128 v1.4.0 h1:xJATj7lLu4f2oObouMt2tgGiElE5gO6mSWUjQsBgUlc= +github.com/woodsbury/decimal128 v1.4.0/go.mod h1:BP46FUrVjVhdTbKT+XuQh2xfQaGki9LMIRJSFuh6THU= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.mongodb.org/mongo-driver v1.16.1 h1:rIVLL3q0IHM39dvE+z2ulZLp9ENZKThVfuvN/IiN4l8= -go.mongodb.org/mongo-driver v1.16.1/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw= -go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= -go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -golang.org/x/exp v0.0.0-20240707233637-46b078467d37 h1:uLDX+AfeFCct3a2C7uIWBKMJIR3CJMhcgfrUAqjRK6w= -golang.org/x/exp v0.0.0-20240707233637-46b078467d37/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= +go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= +golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= +golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/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= diff --git a/handlers/acl.go b/handlers/acl.go index 9db23e16..e20ef218 100644 --- a/handlers/acl.go +++ b/handlers/acl.go @@ -61,7 +61,7 @@ type ReplaceAllACLHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.CreateACLBackendParams, principal interface{}) middleware.Responder { +func (h *CreateACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.CreateACLBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -109,7 +109,7 @@ func (h *CreateACLHandlerImpl) Handle(parentType cnconstants.CnParentType, param } // Handle executing the request and returning a response -func (h *DeleteACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.DeleteACLBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.DeleteACLBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -155,7 +155,7 @@ func (h *DeleteACLHandlerImpl) Handle(parentType cnconstants.CnParentType, param } // Handle executing the request and returning a response -func (h *GetACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.GetACLBackendParams, principal interface{}) middleware.Responder { +func (h *GetACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.GetACLBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -177,7 +177,7 @@ func (h *GetACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params a } // Handle executing the request and returning a response -func (h *GetAllACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.GetAllACLBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.GetAllACLBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -205,7 +205,7 @@ func (h *GetAllACLHandlerImpl) Handle(parentType cnconstants.CnParentType, param } // Handle executing the request and returning a response -func (h *ReplaceACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.ReplaceACLBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.ReplaceACLBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -251,7 +251,7 @@ func (h *ReplaceACLHandlerImpl) Handle(parentType cnconstants.CnParentType, para } // Handle executing the request and returning a response -func (h *ReplaceAllACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.ReplaceAllACLBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllACLHandlerImpl) Handle(parentType cnconstants.CnParentType, params acl.ReplaceAllACLBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/acl_runtime.go b/handlers/acl_runtime.go index 96042161..4aba05c2 100644 --- a/handlers/acl_runtime.go +++ b/handlers/acl_runtime.go @@ -12,7 +12,7 @@ type GetACLSHandlerRuntimeImpl struct { Client client_native.HAProxyClient } -func (h GetACLSHandlerRuntimeImpl) Handle(params acl_runtime.GetServicesHaproxyRuntimeAclsParams, i interface{}) middleware.Responder { +func (h GetACLSHandlerRuntimeImpl) Handle(params acl_runtime.GetServicesHaproxyRuntimeAclsParams, i any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -32,7 +32,7 @@ type GetACLHandlerRuntimeImpl struct { Client client_native.HAProxyClient } -func (h GetACLHandlerRuntimeImpl) Handle(params acl_runtime.GetServicesHaproxyRuntimeAclsIDParams, i interface{}) middleware.Responder { +func (h GetACLHandlerRuntimeImpl) Handle(params acl_runtime.GetServicesHaproxyRuntimeAclsIDParams, i any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -52,7 +52,7 @@ type GetACLFileEntriesHandlerRuntimeImpl struct { Client client_native.HAProxyClient } -func (h GetACLFileEntriesHandlerRuntimeImpl) Handle(params acl_runtime.GetServicesHaproxyRuntimeAclsParentNameEntriesParams, i interface{}) middleware.Responder { +func (h GetACLFileEntriesHandlerRuntimeImpl) Handle(params acl_runtime.GetServicesHaproxyRuntimeAclsParentNameEntriesParams, i any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -71,7 +71,7 @@ type PostACLFileEntryHandlerRuntimeImpl struct { Client client_native.HAProxyClient } -func (h PostACLFileEntryHandlerRuntimeImpl) Handle(params acl_runtime.PostServicesHaproxyRuntimeAclsParentNameEntriesParams, i interface{}) middleware.Responder { +func (h PostACLFileEntryHandlerRuntimeImpl) Handle(params acl_runtime.PostServicesHaproxyRuntimeAclsParentNameEntriesParams, i any) middleware.Responder { var err error runtime, err := h.Client.Runtime() if err != nil { @@ -98,7 +98,7 @@ type GetACLFileEntryRuntimeImpl struct { Client client_native.HAProxyClient } -func (h GetACLFileEntryRuntimeImpl) Handle(params acl_runtime.GetServicesHaproxyRuntimeAclsParentNameEntriesIDParams, i interface{}) middleware.Responder { +func (h GetACLFileEntryRuntimeImpl) Handle(params acl_runtime.GetServicesHaproxyRuntimeAclsParentNameEntriesIDParams, i any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -118,7 +118,7 @@ type DeleteACLFileEntryHandlerRuntimeImpl struct { Client client_native.HAProxyClient } -func (h DeleteACLFileEntryHandlerRuntimeImpl) Handle(params acl_runtime.DeleteServicesHaproxyRuntimeAclsParentNameEntriesIDParams, i interface{}) middleware.Responder { +func (h DeleteACLFileEntryHandlerRuntimeImpl) Handle(params acl_runtime.DeleteServicesHaproxyRuntimeAclsParentNameEntriesIDParams, i any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -136,7 +136,7 @@ type ACLRuntimeAddPayloadRuntimeACLHandlerImpl struct { Client client_native.HAProxyClient } -func (h ACLRuntimeAddPayloadRuntimeACLHandlerImpl) Handle(params acl_runtime.AddPayloadRuntimeACLParams, i interface{}) middleware.Responder { +func (h ACLRuntimeAddPayloadRuntimeACLHandlerImpl) Handle(params acl_runtime.AddPayloadRuntimeACLParams, i any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) diff --git a/handlers/aws.go b/handlers/aws.go index 4f8604b0..3b12b567 100644 --- a/handlers/aws.go +++ b/handlers/aws.go @@ -33,7 +33,7 @@ type CreateAWSHandlerImpl struct { UseValidation bool } -func (c CreateAWSHandlerImpl) Handle(params service_discovery.CreateAWSRegionParams, i interface{}) middleware.Responder { +func (c CreateAWSHandlerImpl) Handle(params service_discovery.CreateAWSRegionParams, i any) middleware.Responder { var err error handleError := func(err error) *service_discovery.CreateAWSRegionDefault { e := misc.HandleError(err) @@ -73,7 +73,7 @@ type GetAWSRegionHandlerImpl struct { Discovery sc.ServiceDiscoveries } -func (g GetAWSRegionHandlerImpl) Handle(params service_discovery.GetAWSRegionParams, i interface{}) middleware.Responder { +func (g GetAWSRegionHandlerImpl) Handle(params service_discovery.GetAWSRegionParams, i any) middleware.Responder { handleError := func(err error) *service_discovery.GetAWSRegionDefault { e := misc.HandleError(err) return service_discovery.NewGetAWSRegionDefault(int(*e.Code)).WithPayload(e) @@ -94,7 +94,7 @@ type GetAWSRegionsHandlerImpl struct { Discovery sc.ServiceDiscoveries } -func (g GetAWSRegionsHandlerImpl) Handle(params service_discovery.GetAWSRegionsParams, i interface{}) middleware.Responder { +func (g GetAWSRegionsHandlerImpl) Handle(params service_discovery.GetAWSRegionsParams, i any) middleware.Responder { regions, err := getAWSRegions(g.Discovery) if err != nil { e := misc.HandleError(err) @@ -109,7 +109,7 @@ type ReplaceAWSRegionHandlerImpl struct { UseValidation bool } -func (r ReplaceAWSRegionHandlerImpl) Handle(params service_discovery.ReplaceAWSRegionParams, i interface{}) middleware.Responder { +func (r ReplaceAWSRegionHandlerImpl) Handle(params service_discovery.ReplaceAWSRegionParams, i any) middleware.Responder { handleError := func(err error) *service_discovery.ReplaceAWSRegionDefault { e := misc.HandleError(err) return service_discovery.NewReplaceAWSRegionDefault(int(*e.Code)).WithPayload(e) @@ -137,7 +137,7 @@ type DeleteAWSRegionHandlerImpl struct { PersistCallback func([]*models.AwsRegion) error } -func (d DeleteAWSRegionHandlerImpl) Handle(params service_discovery.DeleteAWSRegionParams, i interface{}) middleware.Responder { +func (d DeleteAWSRegionHandlerImpl) Handle(params service_discovery.DeleteAWSRegionParams, i any) middleware.Responder { handleError := func(err error) *service_discovery.DeleteAWSRegionDefault { e := misc.HandleError(err) return service_discovery.NewDeleteAWSRegionDefault(int(*e.Code)).WithPayload(e) diff --git a/handlers/backend.go b/handlers/backend.go index 7444220f..358cc113 100644 --- a/handlers/backend.go +++ b/handlers/backend.go @@ -158,7 +158,7 @@ func handleDeprecatedBackendFields(method string, payload *models.Backend, onDis } // Handle executing the request and returning a response -func (h *CreateBackendHandlerImpl) Handle(params backend.CreateBackendParams, principal interface{}) middleware.Responder { +func (h *CreateBackendHandlerImpl) Handle(params backend.CreateBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -215,7 +215,7 @@ func (h *CreateBackendHandlerImpl) createBackend(params backend.CreateBackendPar } // Handle executing the request and returning a response -func (h *DeleteBackendHandlerImpl) Handle(params backend.DeleteBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteBackendHandlerImpl) Handle(params backend.DeleteBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -262,7 +262,7 @@ func (h *DeleteBackendHandlerImpl) Handle(params backend.DeleteBackendParams, pr } // Handle executing the request and returning a response -func (h *GetBackendHandlerImpl) Handle(params backend.GetBackendParams, principal interface{}) middleware.Responder { +func (h *GetBackendHandlerImpl) Handle(params backend.GetBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -292,7 +292,7 @@ func (h *GetBackendHandlerImpl) getBackend(params backend.GetBackendParams, t st } // Handle executing the request and returning a response -func (h *GetBackendsHandlerImpl) Handle(params backend.GetBackendsParams, principal interface{}) middleware.Responder { +func (h *GetBackendsHandlerImpl) Handle(params backend.GetBackendsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -324,7 +324,7 @@ func (h *GetBackendsHandlerImpl) getBackends(params backend.GetBackendsParams, t } // Handle executing the request and returning a response -func (h *ReplaceBackendHandlerImpl) Handle(params backend.ReplaceBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceBackendHandlerImpl) Handle(params backend.ReplaceBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/backend_switching_rule.go b/handlers/backend_switching_rule.go index b4dd8f87..ee691d7f 100644 --- a/handlers/backend_switching_rule.go +++ b/handlers/backend_switching_rule.go @@ -60,7 +60,7 @@ type ReplaceBackendSwitchingRulesHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateBackendSwitchingRuleHandlerImpl) Handle(params backend_switching_rule.CreateBackendSwitchingRuleParams, principal interface{}) middleware.Responder { +func (h *CreateBackendSwitchingRuleHandlerImpl) Handle(params backend_switching_rule.CreateBackendSwitchingRuleParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -105,7 +105,7 @@ func (h *CreateBackendSwitchingRuleHandlerImpl) Handle(params backend_switching_ } // Handle executing the request and returning a response -func (h *DeleteBackendSwitchingRuleHandlerImpl) Handle(params backend_switching_rule.DeleteBackendSwitchingRuleParams, principal interface{}) middleware.Responder { +func (h *DeleteBackendSwitchingRuleHandlerImpl) Handle(params backend_switching_rule.DeleteBackendSwitchingRuleParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -153,7 +153,7 @@ func (h *DeleteBackendSwitchingRuleHandlerImpl) Handle(params backend_switching_ } // Handle executing the request and returning a response -func (h *GetBackendSwitchingRuleHandlerImpl) Handle(params backend_switching_rule.GetBackendSwitchingRuleParams, principal interface{}) middleware.Responder { +func (h *GetBackendSwitchingRuleHandlerImpl) Handle(params backend_switching_rule.GetBackendSwitchingRuleParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -174,7 +174,7 @@ func (h *GetBackendSwitchingRuleHandlerImpl) Handle(params backend_switching_rul } // Handle executing the request and returning a response -func (h *GetBackendSwitchingRulesHandlerImpl) Handle(params backend_switching_rule.GetBackendSwitchingRulesParams, principal interface{}) middleware.Responder { +func (h *GetBackendSwitchingRulesHandlerImpl) Handle(params backend_switching_rule.GetBackendSwitchingRulesParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -198,7 +198,7 @@ func (h *GetBackendSwitchingRulesHandlerImpl) Handle(params backend_switching_ru } // Handle executing the request and returning a response -func (h *ReplaceBackendSwitchingRuleHandlerImpl) Handle(params backend_switching_rule.ReplaceBackendSwitchingRuleParams, principal interface{}) middleware.Responder { +func (h *ReplaceBackendSwitchingRuleHandlerImpl) Handle(params backend_switching_rule.ReplaceBackendSwitchingRuleParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -245,7 +245,7 @@ func (h *ReplaceBackendSwitchingRuleHandlerImpl) Handle(params backend_switching } // Handle executing the request and returning a response -func (h *ReplaceBackendSwitchingRulesHandlerImpl) Handle(params backend_switching_rule.ReplaceBackendSwitchingRulesParams, principal interface{}) middleware.Responder { +func (h *ReplaceBackendSwitchingRulesHandlerImpl) Handle(params backend_switching_rule.ReplaceBackendSwitchingRulesParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/bind.go b/handlers/bind.go index c6abf765..d2798532 100644 --- a/handlers/bind.go +++ b/handlers/bind.go @@ -70,7 +70,7 @@ func bindTypeParams(frontend *string, parentType *string, parentName *string) (p } // Handle executing the request and returning a response -func (h *CreateBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params bind.CreateBindFrontendParams, principal interface{}) middleware.Responder { +func (h *CreateBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params bind.CreateBindFrontendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -96,7 +96,7 @@ func (h *CreateBindHandlerImpl) Handle(parentType cnconstants.CnParentType, para return bind.NewCreateBindFrontendDefault(int(*e.Code)).WithPayload(e) } - pType, pName, err := bindTypeParams(nil, misc.StringP(string(parentType)), ¶ms.ParentName) + pType, pName, err := bindTypeParams(nil, new(string(parentType)), ¶ms.ParentName) if err != nil { e := misc.HandleError(err) return bind.NewCreateBindFrontendDefault(int(*e.Code)).WithPayload(e) @@ -122,7 +122,7 @@ func (h *CreateBindHandlerImpl) Handle(parentType cnconstants.CnParentType, para } // Handle executing the request and returning a response -func (h *DeleteBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params bind.DeleteBindFrontendParams, principal interface{}) middleware.Responder { +func (h *DeleteBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params bind.DeleteBindFrontendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -148,7 +148,7 @@ func (h *DeleteBindHandlerImpl) Handle(parentType cnconstants.CnParentType, para return bind.NewDeleteBindFrontendDefault(int(*e.Code)).WithPayload(e) } - pType, pName, err := bindTypeParams(nil, misc.StringP(string(parentType)), ¶ms.ParentName) + pType, pName, err := bindTypeParams(nil, new(string(parentType)), ¶ms.ParentName) if err != nil { e := misc.HandleError(err) return bind.NewDeleteBindFrontendDefault(int(*e.Code)).WithPayload(e) @@ -174,7 +174,7 @@ func (h *DeleteBindHandlerImpl) Handle(parentType cnconstants.CnParentType, para } // Handle executing the request and returning a response -func (h *GetBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params bind.GetBindFrontendParams, principal interface{}) middleware.Responder { +func (h *GetBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params bind.GetBindFrontendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -186,7 +186,7 @@ func (h *GetBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params return bind.NewGetBindFrontendDefault(int(*e.Code)).WithPayload(e) } - pType, pName, err := bindTypeParams(nil, misc.StringP(string(parentType)), ¶ms.ParentName) + pType, pName, err := bindTypeParams(nil, new(string(parentType)), ¶ms.ParentName) if err != nil { e := misc.HandleError(err) return bind.NewGetBindFrontendDefault(int(*e.Code)).WithPayload(e) @@ -200,7 +200,7 @@ func (h *GetBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params } // Handle executing the request and returning a response -func (h *GetAllBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params bind.GetAllBindFrontendParams, principal interface{}) middleware.Responder { +func (h *GetAllBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params bind.GetAllBindFrontendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -212,7 +212,7 @@ func (h *GetAllBindHandlerImpl) Handle(parentType cnconstants.CnParentType, para return bind.NewGetAllBindFrontendDefault(int(*e.Code)).WithPayload(e) } - pType, pName, err := bindTypeParams(nil, misc.StringP(string(parentType)), ¶ms.ParentName) + pType, pName, err := bindTypeParams(nil, new(string(parentType)), ¶ms.ParentName) if err != nil { e := misc.HandleError(err) return bind.NewGetAllBindFrontendDefault(int(*e.Code)).WithPayload(e) @@ -229,7 +229,7 @@ func (h *GetAllBindHandlerImpl) Handle(parentType cnconstants.CnParentType, para } // Handle executing the request and returning a response -func (h *ReplaceBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params bind.ReplaceBindFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceBindHandlerImpl) Handle(parentType cnconstants.CnParentType, params bind.ReplaceBindFrontendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -255,7 +255,7 @@ func (h *ReplaceBindHandlerImpl) Handle(parentType cnconstants.CnParentType, par return bind.NewReplaceBindFrontendDefault(int(*e.Code)).WithPayload(e) } - pType, pName, err := bindTypeParams(nil, misc.StringP(string(parentType)), ¶ms.ParentName) + pType, pName, err := bindTypeParams(nil, new(string(parentType)), ¶ms.ParentName) if err != nil { e := misc.HandleError(err) return bind.NewReplaceBindFrontendDefault(int(*e.Code)).WithPayload(e) diff --git a/handlers/cache.go b/handlers/cache.go index 4e3d0e29..d5aa1afe 100644 --- a/handlers/cache.go +++ b/handlers/cache.go @@ -54,7 +54,7 @@ type ReplaceCacheHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateCacheHandlerImpl) Handle(params cache.CreateCacheParams, principal interface{}) middleware.Responder { +func (h *CreateCacheHandlerImpl) Handle(params cache.CreateCacheParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -102,7 +102,7 @@ func (h *CreateCacheHandlerImpl) Handle(params cache.CreateCacheParams, principa } // Handle executing the request and returning a response -func (h *DeleteCacheHandlerImpl) Handle(params cache.DeleteCacheParams, principal interface{}) middleware.Responder { +func (h *DeleteCacheHandlerImpl) Handle(params cache.DeleteCacheParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -149,7 +149,7 @@ func (h *DeleteCacheHandlerImpl) Handle(params cache.DeleteCacheParams, principa } // Handle executing the request and returning a response -func (h *GetCacheHandlerImpl) Handle(params cache.GetCacheParams, principal interface{}) middleware.Responder { +func (h *GetCacheHandlerImpl) Handle(params cache.GetCacheParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -170,7 +170,7 @@ func (h *GetCacheHandlerImpl) Handle(params cache.GetCacheParams, principal inte } // Handle executing the request and returning a response -func (h *GetCachesHandlerImpl) Handle(params cache.GetCachesParams, principal interface{}) middleware.Responder { +func (h *GetCachesHandlerImpl) Handle(params cache.GetCachesParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -191,7 +191,7 @@ func (h *GetCachesHandlerImpl) Handle(params cache.GetCachesParams, principal in } // Handle executing the request and returning a response -func (h *ReplaceCacheHandlerImpl) Handle(params cache.ReplaceCacheParams, principal interface{}) middleware.Responder { +func (h *ReplaceCacheHandlerImpl) Handle(params cache.ReplaceCacheParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/capture.go b/handlers/capture.go index 2fc4a4e7..d2f20f9f 100644 --- a/handlers/capture.go +++ b/handlers/capture.go @@ -53,7 +53,7 @@ type ReplaceDeclareCapturesHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h *CreateDeclareCaptureHandlerImpl) Handle(params capture.CreateDeclareCaptureParams, principal interface{}) middleware.Responder { +func (h *CreateDeclareCaptureHandlerImpl) Handle(params capture.CreateDeclareCaptureParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -104,7 +104,7 @@ func (h *CreateDeclareCaptureHandlerImpl) Handle(params capture.CreateDeclareCap return capture.NewCreateDeclareCaptureAccepted().WithPayload(params.Data) } -func (h *DeleteDeclareCaptureHandlerImpl) Handle(params capture.DeleteDeclareCaptureParams, principal interface{}) middleware.Responder { +func (h *DeleteDeclareCaptureHandlerImpl) Handle(params capture.DeleteDeclareCaptureParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -148,7 +148,7 @@ func (h *DeleteDeclareCaptureHandlerImpl) Handle(params capture.DeleteDeclareCap return capture.NewDeleteDeclareCaptureAccepted() } -func (h *GetDeclareCaptureHandlerImpl) Handle(params capture.GetDeclareCaptureParams, principal interface{}) middleware.Responder { +func (h *GetDeclareCaptureHandlerImpl) Handle(params capture.GetDeclareCaptureParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -175,7 +175,7 @@ func (h *GetDeclareCaptureHandlerImpl) Handle(params capture.GetDeclareCapturePa return capture.NewGetDeclareCaptureOK().WithPayload(data) } -func (h *GetDeclareCapturesHandlerImpl) Handle(params capture.GetDeclareCapturesParams, principal interface{}) middleware.Responder { +func (h *GetDeclareCapturesHandlerImpl) Handle(params capture.GetDeclareCapturesParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -205,7 +205,7 @@ func (h *GetDeclareCapturesHandlerImpl) Handle(params capture.GetDeclareCaptures return capture.NewGetDeclareCapturesOK().WithPayload(data) } -func (h *ReplaceDeclareCaptureHandlerImpl) Handle(params capture.ReplaceDeclareCaptureParams, principal interface{}) middleware.Responder { +func (h *ReplaceDeclareCaptureHandlerImpl) Handle(params capture.ReplaceDeclareCaptureParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -258,7 +258,7 @@ func (h *ReplaceDeclareCaptureHandlerImpl) Handle(params capture.ReplaceDeclareC } // Handle executing the request and returning a response -func (h *ReplaceDeclareCapturesHandlerImpl) Handle(params capture.ReplaceDeclareCapturesParams, principal interface{}) middleware.Responder { +func (h *ReplaceDeclareCapturesHandlerImpl) Handle(params capture.ReplaceDeclareCapturesParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/cluster.go b/handlers/cluster.go index df7a2778..9c49cca2 100644 --- a/handlers/cluster.go +++ b/handlers/cluster.go @@ -63,7 +63,7 @@ type EditClusterHandlerImpl struct { } // Handle executing the request and returning a response -func (h *ClusterInitiateCertificateRefreshHandlerImpl) Handle(params cluster.InitiateCertificateRefreshParams, principal interface{}) middleware.Responder { +func (h *ClusterInitiateCertificateRefreshHandlerImpl) Handle(params cluster.InitiateCertificateRefreshParams, principal any) middleware.Responder { if h.Config.Mode.Load() != configuration.ModeCluster { return cluster.NewInitiateCertificateRefreshForbidden() } @@ -118,7 +118,7 @@ func (h *CreateClusterHandlerImpl) err409(err error, transaction *models.Transac }) } -func (h *CreateClusterHandlerImpl) Handle(params cluster.PostClusterParams, principal interface{}) middleware.Responder { +func (h *CreateClusterHandlerImpl) Handle(params cluster.PostClusterParams, principal any) middleware.Responder { key := h.Config.Cluster.BootstrapKey.Load() if params.Data.BootstrapKey != "" && key != params.Data.BootstrapKey { // before we switch to cluster mode, check if folder for storage is compatible with dataplane @@ -159,11 +159,11 @@ func (h *CreateClusterHandlerImpl) Handle(params cluster.PostClusterParams, prin } // Handle executing the request and returning a response -func (h *GetClusterHandlerImpl) Handle(params cluster.GetClusterParams, principal interface{}) middleware.Responder { +func (h *GetClusterHandlerImpl) Handle(params cluster.GetClusterParams, principal any) middleware.Responder { return cluster.NewGetClusterOK().WithPayload(getClusterSettings(h.Config)) } -func (h *DeleteClusterHandlerImpl) Handle(params cluster.DeleteClusterParams, principal interface{}) middleware.Responder { +func (h *DeleteClusterHandlerImpl) Handle(params cluster.DeleteClusterParams, principal any) middleware.Responder { log.Warningf("received instructions from %s to switch to standalone mode", params.HTTPRequest.RemoteAddr) // Only do when dataplane is in cluster mode, if not, do nothing and return 204 if h.Config.Mode.Load() == configuration.ModeCluster { @@ -240,7 +240,7 @@ func (h *DeleteClusterHandlerImpl) err500(err error, transaction *models.Transac }) } -func (h *EditClusterHandlerImpl) Handle(params cluster.EditClusterParams, principal interface{}) middleware.Responder { +func (h *EditClusterHandlerImpl) Handle(params cluster.EditClusterParams, principal any) middleware.Responder { // Only do when dataplane is in cluster mode, if not, do nothing and return 204 if h.Config.Mode.Load() == configuration.ModeCluster { // for now change only cluster log targets in PUT method @@ -312,7 +312,7 @@ func clusterLogTargetsChanged(oldCLT []*models.ClusterLogTarget, newCLT []*model } } } - return !(eqCtr == len(oldCLT)) + return eqCtr != len(oldCLT) } return true } diff --git a/handlers/consul.go b/handlers/consul.go index 69bf15f9..87f00ce6 100644 --- a/handlers/consul.go +++ b/handlers/consul.go @@ -57,7 +57,7 @@ type ReplaceConsulHandlerImpl struct { } // Handle executing the request and returning a response -func (c *CreateConsulHandlerImpl) Handle(params service_discovery.CreateConsulParams, principal interface{}) middleware.Responder { +func (c *CreateConsulHandlerImpl) Handle(params service_discovery.CreateConsulParams, principal any) middleware.Responder { params.Data.ID = sc.NewServiceDiscoveryUUID() if err := sc.ValidateConsulData(params.Data, c.UseValidation); err != nil { e := misc.HandleError(err) @@ -65,8 +65,8 @@ func (c *CreateConsulHandlerImpl) Handle(params service_discovery.CreateConsulPa } if params.Data.HealthCheckPolicy != nil && *params.Data.HealthCheckPolicy == models.ConsulHealthCheckPolicyMin && params.Data.HealthCheckPolicyMin <= 0 { e := &models.Error{ - Message: misc.StringP("health_check_policy_min is required for 'min' health_check_policy"), - Code: misc.Int64P(int(misc.ErrHTTPBadRequest)), + Message: new("health_check_policy_min is required for 'min' health_check_policy"), + Code: new(misc.ErrHTTPBadRequest), } return service_discovery.NewCreateConsulDefault(int(*e.Code)).WithPayload(e) } @@ -89,7 +89,7 @@ func (c *CreateConsulHandlerImpl) Handle(params service_discovery.CreateConsulPa } // Handle executing the request and returning a response -func (c *DeleteConsulHandlerImpl) Handle(params service_discovery.DeleteConsulParams, principal interface{}) middleware.Responder { +func (c *DeleteConsulHandlerImpl) Handle(params service_discovery.DeleteConsulParams, principal any) middleware.Responder { err := c.Discovery.RemoveNode("consul", params.ID) if err != nil { e := misc.HandleError(err) @@ -109,7 +109,7 @@ func (c *DeleteConsulHandlerImpl) Handle(params service_discovery.DeleteConsulPa } // Handle executing the request and returning a response -func (c *GetConsulHandlerImpl) Handle(params service_discovery.GetConsulParams, principal interface{}) middleware.Responder { +func (c *GetConsulHandlerImpl) Handle(params service_discovery.GetConsulParams, principal any) middleware.Responder { nodes, err := c.Discovery.GetNode("consul", params.ID) if err != nil { e := misc.HandleError(err) @@ -124,7 +124,7 @@ func (c *GetConsulHandlerImpl) Handle(params service_discovery.GetConsulParams, } // Handle executing the request and returning a response -func (c *GetConsulsHandlerImpl) Handle(params service_discovery.GetConsulsParams, principal interface{}) middleware.Responder { +func (c *GetConsulsHandlerImpl) Handle(params service_discovery.GetConsulsParams, principal any) middleware.Responder { consuls, err := getConsuls(c.Discovery) if err != nil { e := misc.HandleError(err) @@ -134,15 +134,15 @@ func (c *GetConsulsHandlerImpl) Handle(params service_discovery.GetConsulsParams } // Handle executing the request and returning a response -func (c *ReplaceConsulHandlerImpl) Handle(params service_discovery.ReplaceConsulParams, principal interface{}) middleware.Responder { +func (c *ReplaceConsulHandlerImpl) Handle(params service_discovery.ReplaceConsulParams, principal any) middleware.Responder { if err := sc.ValidateConsulData(params.Data, c.UseValidation); err != nil { e := misc.HandleError(err) return service_discovery.NewReplaceConsulDefault(int(*e.Code)).WithPayload(e) } - if *params.Data.HealthCheckPolicy == models.ConsulHealthCheckPolicyMin && params.Data.HealthCheckPolicyMin <= 0 { + if params.Data.HealthCheckPolicy != nil && *params.Data.HealthCheckPolicy == models.ConsulHealthCheckPolicyMin && params.Data.HealthCheckPolicyMin <= 0 { e := &models.Error{ - Message: misc.StringP("health_check_policy_min is required for 'min' health_check_policy"), - Code: misc.Int64P(int(misc.ErrHTTPBadRequest)), + Message: new("health_check_policy_min is required for 'min' health_check_policy"), + Code: new(misc.ErrHTTPBadRequest), } return service_discovery.NewCreateConsulDefault(int(*e.Code)).WithPayload(e) } diff --git a/handlers/crt_load.go b/handlers/crt_load.go index c774fcd3..f52d303c 100644 --- a/handlers/crt_load.go +++ b/handlers/crt_load.go @@ -29,7 +29,7 @@ type GetCrtLoadsHandlerImpl struct { } // Get all loads from crt-stores -func (h *GetCrtLoadsHandlerImpl) Handle(params crt_load.GetCrtLoadsParams, principal interface{}) middleware.Responder { +func (h *GetCrtLoadsHandlerImpl) Handle(params crt_load.GetCrtLoadsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -55,7 +55,7 @@ type GetCrtLoadHandlerImpl struct { } // Get one load from a crt-store -func (h *GetCrtLoadHandlerImpl) Handle(params crt_load.GetCrtLoadParams, principal interface{}) middleware.Responder { +func (h *GetCrtLoadHandlerImpl) Handle(params crt_load.GetCrtLoadParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -81,7 +81,7 @@ type CreateCrtLoadHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h *CreateCrtLoadHandlerImpl) Handle(params crt_load.CreateCrtLoadParams, principal interface{}) middleware.Responder { +func (h *CreateCrtLoadHandlerImpl) Handle(params crt_load.CreateCrtLoadParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -133,7 +133,7 @@ type ReplaceCrtLoadHandler struct { ReloadAgent haproxy.IReloadAgent } -func (h *ReplaceCrtLoadHandler) Handle(params crt_load.ReplaceCrtLoadParams, principal interface{}) middleware.Responder { +func (h *ReplaceCrtLoadHandler) Handle(params crt_load.ReplaceCrtLoadParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -186,7 +186,7 @@ type DeleteCrtLoadHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h *DeleteCrtLoadHandlerImpl) Handle(params crt_load.DeleteCrtLoadParams, principal interface{}) middleware.Responder { +func (h *DeleteCrtLoadHandlerImpl) Handle(params crt_load.DeleteCrtLoadParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/crt_store.go b/handlers/crt_store.go index 34e0b465..d07e05cc 100644 --- a/handlers/crt_store.go +++ b/handlers/crt_store.go @@ -29,7 +29,7 @@ type GetCrtStoresHandlerImpl struct { } // Get all crt-stores -func (h *GetCrtStoresHandlerImpl) Handle(params crt_store.GetCrtStoresParams, principal interface{}) middleware.Responder { +func (h *GetCrtStoresHandlerImpl) Handle(params crt_store.GetCrtStoresParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -55,7 +55,7 @@ type GetCrtStoreHandlerImpl struct { } // Get one crt-store -func (h *GetCrtStoreHandlerImpl) Handle(params crt_store.GetCrtStoreParams, principal interface{}) middleware.Responder { +func (h *GetCrtStoreHandlerImpl) Handle(params crt_store.GetCrtStoreParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -81,7 +81,7 @@ type CreateCrtStoreHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h *CreateCrtStoreHandlerImpl) Handle(params crt_store.CreateCrtStoreParams, principal interface{}) middleware.Responder { +func (h *CreateCrtStoreHandlerImpl) Handle(params crt_store.CreateCrtStoreParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -133,7 +133,7 @@ type EditCrtStoreHandler struct { ReloadAgent haproxy.IReloadAgent } -func (h *EditCrtStoreHandler) Handle(params crt_store.EditCrtStoreParams, principal interface{}) middleware.Responder { +func (h *EditCrtStoreHandler) Handle(params crt_store.EditCrtStoreParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -173,7 +173,7 @@ type DeleteCrtStoreHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h *DeleteCrtStoreHandlerImpl) Handle(params crt_store.DeleteCrtStoreParams, principal interface{}) middleware.Responder { +func (h *DeleteCrtStoreHandlerImpl) Handle(params crt_store.DeleteCrtStoreParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/defaults.go b/handlers/defaults.go index 01fd01a9..3dcde352 100644 --- a/handlers/defaults.go +++ b/handlers/defaults.go @@ -37,7 +37,7 @@ type ReplaceDefaultsHandlerImpl struct { } // Handle executing the request and returning a response -func (h *GetDefaultsHandlerImpl) Handle(params defaults.GetDefaultsSectionParams, principal interface{}) middleware.Responder { +func (h *GetDefaultsHandlerImpl) Handle(params defaults.GetDefaultsSectionParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -63,7 +63,7 @@ func (h *GetDefaultsHandlerImpl) getDefaultsConfiguration(params defaults.GetDef } // Handle executing the request and returning a response -func (h *ReplaceDefaultsHandlerImpl) Handle(params defaults.ReplaceDefaultsSectionParams, principal interface{}) middleware.Responder { +func (h *ReplaceDefaultsHandlerImpl) Handle(params defaults.ReplaceDefaultsSectionParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -120,19 +120,13 @@ type GetDefaultsSectionsHandlerImpl struct { Client client_native.HAProxyClient } -func (h GetDefaultsSectionsHandlerImpl) Handle(params defaults.GetDefaultsSectionsParams, principal interface{}) middleware.Responder { +func (h GetDefaultsSectionsHandlerImpl) Handle(params defaults.GetDefaultsSectionsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID } - configuration, err := h.Client.Configuration() - if err != nil { - e := misc.HandleError(err) - return defaults.NewGetDefaultsSectionsDefault(int(*e.Code)).WithPayload(e) - } - - _, fs, err := configuration.GetDefaultsSections(t) + _, fs, err := h.getDefaultsSections(params, t) if err != nil { e := misc.HandleError(err) return defaults.NewGetDefaultsSectionsDefault(int(*e.Code)).WithPayload(e) @@ -140,7 +134,7 @@ func (h GetDefaultsSectionsHandlerImpl) Handle(params defaults.GetDefaultsSectio return defaults.NewGetDefaultsSectionsOK().WithPayload(fs) } -func (h *GetDefaultsSectionsHandlerImpl) getDefaultsSections(params defaults.GetDefaultsSectionParams, t string) (int64, models.DefaultsSections, error) { +func (h *GetDefaultsSectionsHandlerImpl) getDefaultsSections(params defaults.GetDefaultsSectionsParams, t string) (int64, models.DefaultsSections, error) { configuration, err := h.Client.Configuration() if err != nil { return 0, nil, err @@ -155,7 +149,7 @@ type GetDefaultsSectionHandlerImpl struct { Client client_native.HAProxyClient } -func (h GetDefaultsSectionHandlerImpl) Handle(params defaults.GetDefaultsSectionParams, principal interface{}) middleware.Responder { +func (h GetDefaultsSectionHandlerImpl) Handle(params defaults.GetDefaultsSectionParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -185,7 +179,7 @@ type CreateDefaultsSectionHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h CreateDefaultsSectionHandlerImpl) Handle(params defaults.CreateDefaultsSectionParams, principal interface{}) middleware.Responder { +func (h CreateDefaultsSectionHandlerImpl) Handle(params defaults.CreateDefaultsSectionParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -242,7 +236,7 @@ type ReplaceDefaultsSectionHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h ReplaceDefaultsSectionHandlerImpl) Handle(params defaults.ReplaceDefaultsSectionParams, principal interface{}) middleware.Responder { +func (h ReplaceDefaultsSectionHandlerImpl) Handle(params defaults.ReplaceDefaultsSectionParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -298,7 +292,7 @@ type DeleteDefaultsSectionHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h DeleteDefaultsSectionHandlerImpl) Handle(params defaults.DeleteDefaultsSectionParams, principal interface{}) middleware.Responder { +func (h DeleteDefaultsSectionHandlerImpl) Handle(params defaults.DeleteDefaultsSectionParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/dgram_bind.go b/handlers/dgram_bind.go index 960ac0e2..2fbb772a 100644 --- a/handlers/dgram_bind.go +++ b/handlers/dgram_bind.go @@ -54,7 +54,7 @@ type ReplaceDgramBindHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateDgramBindHandlerImpl) Handle(params dgram_bind.CreateDgramBindParams, principal interface{}) middleware.Responder { +func (h *CreateDgramBindHandlerImpl) Handle(params dgram_bind.CreateDgramBindParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -102,7 +102,7 @@ func (h *CreateDgramBindHandlerImpl) Handle(params dgram_bind.CreateDgramBindPar } // Handle executing the request and returning a response -func (h *DeleteDgramBindHandlerImpl) Handle(params dgram_bind.DeleteDgramBindParams, principal interface{}) middleware.Responder { +func (h *DeleteDgramBindHandlerImpl) Handle(params dgram_bind.DeleteDgramBindParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -149,7 +149,7 @@ func (h *DeleteDgramBindHandlerImpl) Handle(params dgram_bind.DeleteDgramBindPar } // Handle executing the request and returning a response -func (h *GetDgramBindHandlerImpl) Handle(params dgram_bind.GetDgramBindParams, principal interface{}) middleware.Responder { +func (h *GetDgramBindHandlerImpl) Handle(params dgram_bind.GetDgramBindParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -170,7 +170,7 @@ func (h *GetDgramBindHandlerImpl) Handle(params dgram_bind.GetDgramBindParams, p } // Handle executing the request and returning a response -func (h *GetDgramBindsHandlerImpl) Handle(params dgram_bind.GetDgramBindsParams, principal interface{}) middleware.Responder { +func (h *GetDgramBindsHandlerImpl) Handle(params dgram_bind.GetDgramBindsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -191,7 +191,7 @@ func (h *GetDgramBindsHandlerImpl) Handle(params dgram_bind.GetDgramBindsParams, } // Handle executing the request and returning a response -func (h *ReplaceDgramBindHandlerImpl) Handle(params dgram_bind.ReplaceDgramBindParams, principal interface{}) middleware.Responder { +func (h *ReplaceDgramBindHandlerImpl) Handle(params dgram_bind.ReplaceDgramBindParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/fcgi_app.go b/handlers/fcgi_app.go index 960bff46..2dbed5b9 100644 --- a/handlers/fcgi_app.go +++ b/handlers/fcgi_app.go @@ -29,7 +29,7 @@ type CreateFCGIAppHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (c CreateFCGIAppHandlerImpl) Handle(params fcgi_app.CreateFCGIAppParams, _ interface{}) middleware.Responder { +func (c CreateFCGIAppHandlerImpl) Handle(params fcgi_app.CreateFCGIAppParams, _ any) middleware.Responder { var t string var v int64 @@ -44,7 +44,7 @@ func (c CreateFCGIAppHandlerImpl) Handle(params fcgi_app.CreateFCGIAppParams, _ code := misc.ErrHTTPBadRequest e := &models.Error{ - Message: misc.StringP("Both force_reload and transaction specified, specify only one"), + Message: new("Both force_reload and transaction specified, specify only one"), Code: &code, } @@ -89,7 +89,7 @@ type DeleteFCGIAppHandlerImpl struct { Client client_native.HAProxyClient } -func (d DeleteFCGIAppHandlerImpl) Handle(params fcgi_app.DeleteFCGIAppParams, _ interface{}) middleware.Responder { +func (d DeleteFCGIAppHandlerImpl) Handle(params fcgi_app.DeleteFCGIAppParams, _ any) middleware.Responder { var t string var v int64 @@ -104,7 +104,7 @@ func (d DeleteFCGIAppHandlerImpl) Handle(params fcgi_app.DeleteFCGIAppParams, _ code := misc.ErrHTTPBadRequest e := &models.Error{ - Message: misc.StringP("Both force_reload and transaction specified, specify only one"), + Message: new("Both force_reload and transaction specified, specify only one"), Code: &code, } @@ -143,7 +143,7 @@ type GetFCGIAppHandlerImpl struct { Client client_native.HAProxyClient } -func (g GetFCGIAppHandlerImpl) Handle(params fcgi_app.GetFCGIAppParams, _ interface{}) middleware.Responder { +func (g GetFCGIAppHandlerImpl) Handle(params fcgi_app.GetFCGIAppParams, _ any) middleware.Responder { var t string if params.TransactionID != nil { @@ -175,7 +175,7 @@ type GetFCGIAppsHandlerImpl struct { Client client_native.HAProxyClient } -func (g GetFCGIAppsHandlerImpl) Handle(params fcgi_app.GetFCGIAppsParams, _ interface{}) middleware.Responder { +func (g GetFCGIAppsHandlerImpl) Handle(params fcgi_app.GetFCGIAppsParams, _ any) middleware.Responder { var t string if params.TransactionID != nil { @@ -208,7 +208,7 @@ type ReplaceFCGIAppHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (r ReplaceFCGIAppHandlerImpl) Handle(params fcgi_app.ReplaceFCGIAppParams, _ interface{}) middleware.Responder { +func (r ReplaceFCGIAppHandlerImpl) Handle(params fcgi_app.ReplaceFCGIAppParams, _ any) middleware.Responder { var t string var v int64 @@ -224,7 +224,7 @@ func (r ReplaceFCGIAppHandlerImpl) Handle(params fcgi_app.ReplaceFCGIAppParams, code := misc.ErrHTTPBadRequest e := &models.Error{ - Message: misc.StringP("Both force_reload and transaction specified, specify only one"), + Message: new("Both force_reload and transaction specified, specify only one"), Code: &code, } diff --git a/handlers/filter.go b/handlers/filter.go index 05d1a7a6..576d8d12 100644 --- a/handlers/filter.go +++ b/handlers/filter.go @@ -61,7 +61,7 @@ type ReplaceAllFilterHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.CreateFilterBackendParams, principal interface{}) middleware.Responder { +func (h *CreateFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.CreateFilterBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -108,7 +108,7 @@ func (h *CreateFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, pa } // Handle executing the request and returning a response -func (h *DeleteFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.DeleteFilterBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.DeleteFilterBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -155,7 +155,7 @@ func (h *DeleteFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, pa } // Handle executing the request and returning a response -func (h *GetFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.GetFilterBackendParams, principal interface{}) middleware.Responder { +func (h *GetFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.GetFilterBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -176,7 +176,7 @@ func (h *GetFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, param } // Handle executing the request and returning a response -func (h *GetAllFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.GetAllFilterBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.GetAllFilterBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -200,7 +200,7 @@ func (h *GetAllFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, pa } // Handle executing the request and returning a response -func (h *ReplaceFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.ReplaceFilterBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.ReplaceFilterBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -247,7 +247,7 @@ func (h *ReplaceFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, p } // Handle executing the request and returning a response -func (h *ReplaceAllFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.ReplaceAllFilterBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllFilterHandlerImpl) Handle(parentType cnconstants.CnParentType, params filter.ReplaceAllFilterBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/frontend.go b/handlers/frontend.go index 1bf4892b..31c93193 100644 --- a/handlers/frontend.go +++ b/handlers/frontend.go @@ -54,7 +54,7 @@ type ReplaceFrontendHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateFrontendHandlerImpl) Handle(params frontend.CreateFrontendParams, principal interface{}) middleware.Responder { +func (h *CreateFrontendHandlerImpl) Handle(params frontend.CreateFrontendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -106,7 +106,7 @@ func (h *CreateFrontendHandlerImpl) createFrontend(params frontend.CreateFronten } // Handle executing the request and returning a response -func (h *DeleteFrontendHandlerImpl) Handle(params frontend.DeleteFrontendParams, principal interface{}) middleware.Responder { +func (h *DeleteFrontendHandlerImpl) Handle(params frontend.DeleteFrontendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -153,7 +153,7 @@ func (h *DeleteFrontendHandlerImpl) Handle(params frontend.DeleteFrontendParams, } // Handle executing the request and returning a response -func (h *GetFrontendHandlerImpl) Handle(params frontend.GetFrontendParams, principal interface{}) middleware.Responder { +func (h *GetFrontendHandlerImpl) Handle(params frontend.GetFrontendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -179,7 +179,7 @@ func (h *GetFrontendHandlerImpl) getFrontend(params frontend.GetFrontendParams, } // Handle executing the request and returning a response -func (h *GetFrontendsHandlerImpl) Handle(params frontend.GetFrontendsParams, principal interface{}) middleware.Responder { +func (h *GetFrontendsHandlerImpl) Handle(params frontend.GetFrontendsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -205,7 +205,7 @@ func (h *GetFrontendsHandlerImpl) getFrontends(params frontend.GetFrontendsParam } // Handle executing the request and returning a response -func (h *ReplaceFrontendHandlerImpl) Handle(params frontend.ReplaceFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceFrontendHandlerImpl) Handle(params frontend.ReplaceFrontendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/general_storage.go b/handlers/general_storage.go index e7dfece3..d8970144 100644 --- a/handlers/general_storage.go +++ b/handlers/general_storage.go @@ -18,6 +18,8 @@ package handlers import ( "bufio" "fmt" + "io" + "net/http" "os" "path/filepath" "strings" @@ -37,7 +39,15 @@ type StorageCreateStorageGeneralFileHandlerImpl struct { Client client_native.HAProxyClient } -func (h *StorageCreateStorageGeneralFileHandlerImpl) Handle(params storage.CreateStorageGeneralFileParams, principal interface{}) middleware.Responder { +func (h *StorageCreateStorageGeneralFileHandlerImpl) Handle(params storage.CreateStorageGeneralFileParams, principal any) middleware.Responder { + if params.FileUpload == nil { + e := &models.Error{ + Code: new(int64(http.StatusBadRequest)), + Message: new("No file_upload form param specified"), + } + return storage.NewReplaceStorageGeneralFileBadRequest().WithPayload(e) + } + file, ok := params.FileUpload.(*runtime.File) if !ok { return storage.NewCreateStorageGeneralFileBadRequest() @@ -71,7 +81,7 @@ type StorageGetAllStorageGeneralFilesHandlerImpl struct { } // Handle executing the request and returning a response -func (h *StorageGetAllStorageGeneralFilesHandlerImpl) Handle(params storage.GetAllStorageGeneralFilesParams, principal interface{}) middleware.Responder { +func (h *StorageGetAllStorageGeneralFilesHandlerImpl) Handle(params storage.GetAllStorageGeneralFilesParams, principal any) middleware.Responder { gs, err := h.Client.GeneralStorage() if err != nil { e := misc.HandleError(err) @@ -102,7 +112,7 @@ type StorageGetOneStorageGeneralFileHandlerImpl struct { Client client_native.HAProxyClient } -func (h *StorageGetOneStorageGeneralFileHandlerImpl) Handle(params storage.GetOneStorageGeneralFileParams, principal interface{}) middleware.Responder { +func (h *StorageGetOneStorageGeneralFileHandlerImpl) Handle(params storage.GetOneStorageGeneralFileParams, principal any) middleware.Responder { gs, err := h.Client.GeneralStorage() if err != nil { e := misc.HandleError(err) @@ -130,7 +140,7 @@ type StorageDeleteStorageGeneralFileHandlerImpl struct { Client client_native.HAProxyClient } -func (h *StorageDeleteStorageGeneralFileHandlerImpl) Handle(params storage.DeleteStorageGeneralFileParams, principal interface{}) middleware.Responder { +func (h *StorageDeleteStorageGeneralFileHandlerImpl) Handle(params storage.DeleteStorageGeneralFileParams, principal any) middleware.Responder { configuration, err := h.Client.Configuration() if err != nil { e := misc.HandleError(err) @@ -181,14 +191,26 @@ type StorageReplaceStorageGeneralFileHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h *StorageReplaceStorageGeneralFileHandlerImpl) Handle(params storage.ReplaceStorageGeneralFileParams, principal interface{}) middleware.Responder { +func (h *StorageReplaceStorageGeneralFileHandlerImpl) Handle(params storage.ReplaceStorageGeneralFileParams, principal any) middleware.Responder { gs, err := h.Client.GeneralStorage() if err != nil { e := misc.HandleError(err) return storage.NewReplaceStorageGeneralFileDefault(int(*e.Code)).WithPayload(e) } - _, err = gs.Replace(params.Name, params.Data) + if params.FileUpload == nil { + e := &models.Error{ + Code: new(int64(http.StatusBadRequest)), + Message: new("No file_upload form param specified"), + } + return storage.NewReplaceStorageGeneralFileBadRequest().WithPayload(e) + } + + data, err := io.ReadAll(params.FileUpload) + if err != nil { + return storage.NewReplaceStorageGeneralFileBadRequest() + } + _, err = gs.Replace(params.Name, string(data)) if err != nil { e := misc.HandleError(err) return storage.NewReplaceStorageGeneralFileDefault(int(*e.Code)).WithPayload(e) diff --git a/handlers/global.go b/handlers/global.go index b4bcaed1..681decd6 100644 --- a/handlers/global.go +++ b/handlers/global.go @@ -37,7 +37,7 @@ type ReplaceGlobalHandlerImpl struct { } // Handle executing the request and returning a response -func (h *GetGlobalHandlerImpl) Handle(params global.GetGlobalParams, principal interface{}) middleware.Responder { +func (h *GetGlobalHandlerImpl) Handle(params global.GetGlobalParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -63,7 +63,7 @@ func (h *GetGlobalHandlerImpl) getGlobalConfiguration(params global.GetGlobalPar } // Handle executing the request and returning a response -func (h *ReplaceGlobalHandlerImpl) Handle(params global.ReplaceGlobalParams, principal interface{}) middleware.Responder { +func (h *ReplaceGlobalHandlerImpl) Handle(params global.ReplaceGlobalParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/group.go b/handlers/group.go index bf4f0ceb..5d150079 100644 --- a/handlers/group.go +++ b/handlers/group.go @@ -54,7 +54,7 @@ type ReplaceGroupHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateGroupHandlerImpl) Handle(params group.CreateGroupParams, principal interface{}) middleware.Responder { +func (h *CreateGroupHandlerImpl) Handle(params group.CreateGroupParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -101,7 +101,7 @@ func (h *CreateGroupHandlerImpl) Handle(params group.CreateGroupParams, principa } // Handle executing the request and returning a response -func (h *DeleteGroupHandlerImpl) Handle(params group.DeleteGroupParams, principal interface{}) middleware.Responder { +func (h *DeleteGroupHandlerImpl) Handle(params group.DeleteGroupParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -156,7 +156,7 @@ func (h *DeleteGroupHandlerImpl) Handle(params group.DeleteGroupParams, principa } // Handle executing the request and returning a response -func (h *GetGroupHandlerImpl) Handle(params group.GetGroupParams, principal interface{}) middleware.Responder { +func (h *GetGroupHandlerImpl) Handle(params group.GetGroupParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -182,7 +182,7 @@ func (h *GetGroupHandlerImpl) Handle(params group.GetGroupParams, principal inte } // Handle executing the request and returning a response -func (h *GetGroupsHandlerImpl) Handle(params group.GetGroupsParams, principal interface{}) middleware.Responder { +func (h *GetGroupsHandlerImpl) Handle(params group.GetGroupsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -214,7 +214,7 @@ func (h *GetGroupsHandlerImpl) Handle(params group.GetGroupsParams, principal in } // Handle executing the request and returning a response -func (h *ReplaceGroupHandlerImpl) Handle(params group.ReplaceGroupParams, principal interface{}) middleware.Responder { +func (h *ReplaceGroupHandlerImpl) Handle(params group.ReplaceGroupParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/health.go b/handlers/health.go index 66a3285a..910a9bd2 100644 --- a/handlers/health.go +++ b/handlers/health.go @@ -12,7 +12,7 @@ type GetHealthHandlerImpl struct { HAProxy haproxy.IReloadAgent } -func (h *GetHealthHandlerImpl) Handle(health.GetHealthParams, interface{}) middleware.Responder { +func (h *GetHealthHandlerImpl) Handle(health.GetHealthParams, any) middleware.Responder { data := models.Health{} status, err := h.HAProxy.Status() if err == nil { diff --git a/handlers/http_after_response_rule.go b/handlers/http_after_response_rule.go index 516ba0dc..9aeedc22 100644 --- a/handlers/http_after_response_rule.go +++ b/handlers/http_after_response_rule.go @@ -1,6 +1,8 @@ package handlers import ( + "net/http" + "github.com/go-openapi/runtime/middleware" client_native "github.com/haproxytech/client-native/v6" "github.com/haproxytech/client-native/v6/models" @@ -16,7 +18,7 @@ type CreateHTTPAfterResponseRuleHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (c CreateHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.CreateHTTPAfterResponseRuleBackendParams, _ interface{}) middleware.Responder { +func (c CreateHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.CreateHTTPAfterResponseRuleBackendParams, _ any) middleware.Responder { t, v := "", int64(0) if params.TransactionID != nil { @@ -29,8 +31,8 @@ func (c CreateHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.Cn if t != "" && *params.ForceReload { e := &models.Error{ - Message: misc.StringP("Both force_reload and transaction specified, specify only one"), - Code: misc.Int64P(int(misc.ErrHTTPBadRequest)), + Message: new("Both force_reload and transaction specified, specify only one"), + Code: new(int64(http.StatusBadRequest)), } return http_after_response_rule.NewCreateHTTPAfterResponseRuleBackendDefault(int(*e.Code)).WithPayload(e) } @@ -67,7 +69,7 @@ type DeleteHTTPAfterResponseRuleHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (d DeleteHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.DeleteHTTPAfterResponseRuleBackendParams, _ interface{}) middleware.Responder { +func (d DeleteHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.DeleteHTTPAfterResponseRuleBackendParams, _ any) middleware.Responder { t, v := "", int64(0) if params.TransactionID != nil { @@ -80,8 +82,8 @@ func (d DeleteHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.Cn if t != "" && *params.ForceReload { e := &models.Error{ - Message: misc.StringP("Both force_reload and transaction specified, specify only one"), - Code: misc.Int64P(int(misc.ErrHTTPBadRequest)), + Message: new("Both force_reload and transaction specified, specify only one"), + Code: new(int64(http.StatusBadRequest)), } return http_after_response_rule.NewDeleteHTTPAfterResponseRuleBackendDefault(int(*e.Code)).WithPayload(e) } @@ -117,7 +119,7 @@ type GetHTTPAfterResponseRuleHandlerImpl struct { Client client_native.HAProxyClient } -func (g GetHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.GetHTTPAfterResponseRuleBackendParams, _ interface{}) middleware.Responder { +func (g GetHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.GetHTTPAfterResponseRuleBackendParams, _ any) middleware.Responder { var t string if params.TransactionID != nil { @@ -143,7 +145,7 @@ type GetAllHTTPAfterResponseRuleHandlerImpl struct { Client client_native.HAProxyClient } -func (g GetAllHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.GetAllHTTPAfterResponseRuleBackendParams, _ interface{}) middleware.Responder { +func (g GetAllHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.GetAllHTTPAfterResponseRuleBackendParams, _ any) middleware.Responder { var t string if params.TransactionID != nil { @@ -170,7 +172,7 @@ type ReplaceHTTPAfterResponseRuleHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (r ReplaceHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.ReplaceHTTPAfterResponseRuleBackendParams, _ interface{}) middleware.Responder { +func (r ReplaceHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.ReplaceHTTPAfterResponseRuleBackendParams, _ any) middleware.Responder { t, v := "", int64(0) if params.TransactionID != nil { @@ -183,8 +185,8 @@ func (r ReplaceHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.C if t != "" && *params.ForceReload { e := &models.Error{ - Message: misc.StringP("Both force_reload and transaction specified, specify only one"), - Code: misc.Int64P(int(misc.ErrHTTPBadRequest)), + Message: new("Both force_reload and transaction specified, specify only one"), + Code: new(int64(http.StatusBadRequest)), } return http_after_response_rule.NewReplaceHTTPAfterResponseRuleBackendDefault(int(*e.Code)).WithPayload(e) } @@ -222,7 +224,7 @@ type ReplaceAllHTTPAfterResponseRuleHandlerImpl struct { } // Handle executing the request and returning a response -func (h *ReplaceAllHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.ReplaceAllHTTPAfterResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPAfterResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_after_response_rule.ReplaceAllHTTPAfterResponseRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/http_check.go b/handlers/http_check.go index 778fcb75..76477ca8 100644 --- a/handlers/http_check.go +++ b/handlers/http_check.go @@ -61,7 +61,7 @@ type ReplaceAllHTTPCheckHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.CreateHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.CreateHTTPCheckBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -109,7 +109,7 @@ func (h *CreateHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, } // Handle executing the request and returning a response -func (h *DeleteHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.DeleteHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.DeleteHTTPCheckBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -156,7 +156,7 @@ func (h *DeleteHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, } // Handle executing the request and returning a response -func (h *GetHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.GetHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.GetHTTPCheckBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -177,7 +177,7 @@ func (h *GetHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, pa } // Handle executing the request and returning a response -func (h *GetAllHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.GetAllHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.GetAllHTTPCheckBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -201,7 +201,7 @@ func (h *GetAllHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, } // Handle executing the request and returning a response -func (h *ReplaceHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.ReplaceHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.ReplaceHTTPCheckBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -248,7 +248,7 @@ func (h *ReplaceHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType } // Handle executing the request and returning a response -func (h *ReplaceAllHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.ReplaceAllHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_check.ReplaceAllHTTPCheckBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/http_error_rule.go b/handlers/http_error_rule.go index 00ccf250..ffa0015f 100644 --- a/handlers/http_error_rule.go +++ b/handlers/http_error_rule.go @@ -61,7 +61,7 @@ type ReplaceAllHTTPErrorRuleHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.CreateHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.CreateHTTPErrorRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -109,7 +109,7 @@ func (h *CreateHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentT } // Handle executing the request and returning a response -func (h *DeleteHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.DeleteHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.DeleteHTTPErrorRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -156,7 +156,7 @@ func (h *DeleteHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentT } // Handle executing the request and returning a response -func (h *GetHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.GetHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.GetHTTPErrorRuleBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -177,7 +177,7 @@ func (h *GetHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType } // Handle executing the request and returning a response -func (h *GetAllHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.GetAllHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.GetAllHTTPErrorRuleBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -201,7 +201,7 @@ func (h *GetAllHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentT } // Handle executing the request and returning a response -func (h *ReplaceHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.ReplaceHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.ReplaceHTTPErrorRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -247,7 +247,7 @@ func (h *ReplaceHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParent return http_error_rule.NewReplaceHTTPErrorRuleBackendAccepted().WithPayload(params.Data) } -func (h *ReplaceAllHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.ReplaceAllHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPErrorRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_error_rule.ReplaceAllHTTPErrorRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/http_errors.go b/handlers/http_errors.go index 4316b343..54879cf5 100644 --- a/handlers/http_errors.go +++ b/handlers/http_errors.go @@ -53,7 +53,7 @@ type ReplaceHTTPErrorsSectionHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateHTTPErrorsSectionHandlerImpl) Handle(params http_errors.CreateHTTPErrorsSectionParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPErrorsSectionHandlerImpl) Handle(params http_errors.CreateHTTPErrorsSectionParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -101,7 +101,7 @@ func (h *CreateHTTPErrorsSectionHandlerImpl) Handle(params http_errors.CreateHTT } // Handle executing the request and returning a response -func (h *DeleteHTTPErrorsSectionHandlerImpl) Handle(params http_errors.DeleteHTTPErrorsSectionParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPErrorsSectionHandlerImpl) Handle(params http_errors.DeleteHTTPErrorsSectionParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -149,7 +149,7 @@ func (h *DeleteHTTPErrorsSectionHandlerImpl) Handle(params http_errors.DeleteHTT } // Handle executing the request and returning a response -func (h *GetHTTPErrorsSectionHandlerImpl) Handle(params http_errors.GetHTTPErrorsSectionParams, principal interface{}) middleware.Responder { +func (h *GetHTTPErrorsSectionHandlerImpl) Handle(params http_errors.GetHTTPErrorsSectionParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -171,7 +171,7 @@ func (h *GetHTTPErrorsSectionHandlerImpl) Handle(params http_errors.GetHTTPError } // Handle executing the request and returning a response -func (h *GetHTTPErrorsSectionsHandlerImpl) Handle(params http_errors.GetHTTPErrorsSectionsParams, principal interface{}) middleware.Responder { +func (h *GetHTTPErrorsSectionsHandlerImpl) Handle(params http_errors.GetHTTPErrorsSectionsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -192,7 +192,7 @@ func (h *GetHTTPErrorsSectionsHandlerImpl) Handle(params http_errors.GetHTTPErro return http_errors.NewGetHTTPErrorsSectionsOK().WithPayload(ms) } -func (h *ReplaceHTTPErrorsSectionHandlerImpl) Handle(params http_errors.ReplaceHTTPErrorsSectionParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPErrorsSectionHandlerImpl) Handle(params http_errors.ReplaceHTTPErrorsSectionParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/http_request_rule.go b/handlers/http_request_rule.go index 8b5732b1..4e378f8e 100644 --- a/handlers/http_request_rule.go +++ b/handlers/http_request_rule.go @@ -61,7 +61,7 @@ type ReplaceAllHTTPRequestRuleHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.CreateHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.CreateHTTPRequestRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -109,7 +109,7 @@ func (h *CreateHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParen } // Handle executing the request and returning a response -func (h *DeleteHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.DeleteHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.DeleteHTTPRequestRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -156,7 +156,7 @@ func (h *DeleteHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParen } // Handle executing the request and returning a response -func (h *GetHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.GetHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.GetHTTPRequestRuleBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -177,7 +177,7 @@ func (h *GetHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentTy } // Handle executing the request and returning a response -func (h *GetAllHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.GetAllHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.GetAllHTTPRequestRuleBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -201,7 +201,7 @@ func (h *GetAllHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParen } // Handle executing the request and returning a response -func (h *ReplaceHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.ReplaceHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.ReplaceHTTPRequestRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -248,7 +248,7 @@ func (h *ReplaceHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnPare } // Handle executing the request and returning a response -func (h *ReplaceAllHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.ReplaceAllHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_request_rule.ReplaceAllHTTPRequestRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/http_response_rule.go b/handlers/http_response_rule.go index 075f9da7..b244a7bd 100644 --- a/handlers/http_response_rule.go +++ b/handlers/http_response_rule.go @@ -61,7 +61,7 @@ type ReplaceAllHTTPResponseRuleHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.CreateHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.CreateHTTPResponseRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -109,7 +109,7 @@ func (h *CreateHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnPare } // Handle executing the request and returning a response -func (h *DeleteHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.DeleteHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.DeleteHTTPResponseRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -156,7 +156,7 @@ func (h *DeleteHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnPare } // Handle executing the request and returning a response -func (h *GetHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.GetHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.GetHTTPResponseRuleBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -177,7 +177,7 @@ func (h *GetHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentT } // Handle executing the request and returning a response -func (h *GetAllHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.GetAllHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.GetAllHTTPResponseRuleBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -201,7 +201,7 @@ func (h *GetAllHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnPare } // Handle executing the request and returning a response -func (h *ReplaceHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.ReplaceHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.ReplaceHTTPResponseRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -248,7 +248,7 @@ func (h *ReplaceHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnPar } // Handle executing the request and returning a response -func (h *ReplaceAllHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.ReplaceAllHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params http_response_rule.ReplaceAllHTTPResponseRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/information.go b/handlers/information.go index ed8fe241..723fcf5b 100644 --- a/handlers/information.go +++ b/handlers/information.go @@ -42,7 +42,7 @@ type GetHaproxyProcessInfoHandlerImpl struct { } // Handle executing the request and returning a response -func (h *GetHaproxyProcessInfoHandlerImpl) Handle(params information.GetHaproxyProcessInfoParams, principal interface{}) middleware.Responder { +func (h *GetHaproxyProcessInfoHandlerImpl) Handle(params information.GetHaproxyProcessInfoParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -70,7 +70,7 @@ type GetInfoHandlerImpl struct { } // Handle executing the request and returning a response -func (h *GetInfoHandlerImpl) Handle(params information.GetInfoParams, principal interface{}) middleware.Responder { +func (h *GetInfoHandlerImpl) Handle(params information.GetInfoParams, principal any) middleware.Responder { api := &models.InfoAPI{ Version: h.Version, } diff --git a/handlers/log_forward.go b/handlers/log_forward.go index dd302e80..f66fec4b 100644 --- a/handlers/log_forward.go +++ b/handlers/log_forward.go @@ -54,7 +54,7 @@ type ReplaceLogForwardHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateLogForwardHandlerImpl) Handle(params log_forward.CreateLogForwardParams, principal interface{}) middleware.Responder { +func (h *CreateLogForwardHandlerImpl) Handle(params log_forward.CreateLogForwardParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -107,7 +107,7 @@ func (h *CreateLogForwardHandlerImpl) createLogForward(params log_forward.Create } // Handle executing the request and returning a response -func (h *DeleteLogForwardHandlerImpl) Handle(params log_forward.DeleteLogForwardParams, principal interface{}) middleware.Responder { +func (h *DeleteLogForwardHandlerImpl) Handle(params log_forward.DeleteLogForwardParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -154,7 +154,7 @@ func (h *DeleteLogForwardHandlerImpl) Handle(params log_forward.DeleteLogForward } // Handle executing the request and returning a response -func (h *GetLogForwardHandlerImpl) Handle(params log_forward.GetLogForwardParams, principal interface{}) middleware.Responder { +func (h *GetLogForwardHandlerImpl) Handle(params log_forward.GetLogForwardParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -180,7 +180,7 @@ func (h *GetLogForwardHandlerImpl) getLogForward(params log_forward.GetLogForwar } // Handle executing the request and returning a response -func (h *GetLogForwardsHandlerImpl) Handle(params log_forward.GetLogForwardsParams, principal interface{}) middleware.Responder { +func (h *GetLogForwardsHandlerImpl) Handle(params log_forward.GetLogForwardsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -206,7 +206,7 @@ func (h *GetLogForwardsHandlerImpl) getLogForwards(params log_forward.GetLogForw } // Handle executing the request and returning a response -func (h *ReplaceLogForwardHandlerImpl) Handle(params log_forward.ReplaceLogForwardParams, principal interface{}) middleware.Responder { +func (h *ReplaceLogForwardHandlerImpl) Handle(params log_forward.ReplaceLogForwardParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/log_target.go b/handlers/log_target.go index c5c22dac..e6767a9e 100644 --- a/handlers/log_target.go +++ b/handlers/log_target.go @@ -61,7 +61,7 @@ type ReplaceAllLogTargetHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.CreateLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *CreateLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.CreateLogTargetBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -109,7 +109,7 @@ func (h *CreateLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, } // Handle executing the request and returning a response -func (h *DeleteLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.DeleteLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.DeleteLogTargetBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -157,7 +157,7 @@ func (h *DeleteLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, } // Handle executing the request and returning a response -func (h *GetLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.GetLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *GetLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.GetLogTargetBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -178,7 +178,7 @@ func (h *GetLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, pa } // Handle executing the request and returning a response -func (h *GetAllLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.GetAllLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.GetAllLogTargetBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -202,7 +202,7 @@ func (h *GetAllLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, } // Handle executing the request and returning a response -func (h *ReplaceLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.ReplaceLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.ReplaceLogTargetBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -253,7 +253,7 @@ func logTargetParentTypeRequiresParentName(parentType string) bool { } // Handle executing the request and returning a response -func (h *ReplaceAllLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.ReplaceAllLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllLogTargetHandlerImpl) Handle(parentType cnconstants.CnParentType, params log_target.ReplaceAllLogTargetBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/mailer_entry.go b/handlers/mailer_entry.go index 1b08dbc3..2f75df65 100644 --- a/handlers/mailer_entry.go +++ b/handlers/mailer_entry.go @@ -48,7 +48,7 @@ type ReplaceMailerEntryHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateMailerEntryHandlerImpl) Handle(params mailer_entry.CreateMailerEntryParams, principal interface{}) middleware.Responder { +func (h *CreateMailerEntryHandlerImpl) Handle(params mailer_entry.CreateMailerEntryParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -95,7 +95,7 @@ func (h *CreateMailerEntryHandlerImpl) Handle(params mailer_entry.CreateMailerEn } // Handle executing the request and returning a response -func (h *DeleteMailerEntryHandlerImpl) Handle(params mailer_entry.DeleteMailerEntryParams, principal interface{}) middleware.Responder { +func (h *DeleteMailerEntryHandlerImpl) Handle(params mailer_entry.DeleteMailerEntryParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -142,7 +142,7 @@ func (h *DeleteMailerEntryHandlerImpl) Handle(params mailer_entry.DeleteMailerEn } // Handle executing the request and returning a response -func (h *GetMailerEntryHandlerImpl) Handle(params mailer_entry.GetMailerEntryParams, principal interface{}) middleware.Responder { +func (h *GetMailerEntryHandlerImpl) Handle(params mailer_entry.GetMailerEntryParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -163,7 +163,7 @@ func (h *GetMailerEntryHandlerImpl) Handle(params mailer_entry.GetMailerEntryPar } // Handle executing the request and returning a response -func (h *GetMailerEntriesHandlerImpl) Handle(params mailer_entry.GetMailerEntriesParams, principal interface{}) middleware.Responder { +func (h *GetMailerEntriesHandlerImpl) Handle(params mailer_entry.GetMailerEntriesParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -184,7 +184,7 @@ func (h *GetMailerEntriesHandlerImpl) Handle(params mailer_entry.GetMailerEntrie } // Handle executing the request and returning a response -func (h *ReplaceMailerEntryHandlerImpl) Handle(params mailer_entry.ReplaceMailerEntryParams, principal interface{}) middleware.Responder { +func (h *ReplaceMailerEntryHandlerImpl) Handle(params mailer_entry.ReplaceMailerEntryParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/mailers.go b/handlers/mailers.go index 6f919a50..58584dd8 100644 --- a/handlers/mailers.go +++ b/handlers/mailers.go @@ -53,7 +53,7 @@ type EditMailersSectionHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateMailersSectionHandlerImpl) Handle(params mailers.CreateMailersSectionParams, principal interface{}) middleware.Responder { +func (h *CreateMailersSectionHandlerImpl) Handle(params mailers.CreateMailersSectionParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -106,7 +106,7 @@ func (h *CreateMailersSectionHandlerImpl) createMailersSection(params mailers.Cr } // Handle executing the request and returning a response -func (h *DeleteMailersSectionHandlerImpl) Handle(params mailers.DeleteMailersSectionParams, principal interface{}) middleware.Responder { +func (h *DeleteMailersSectionHandlerImpl) Handle(params mailers.DeleteMailersSectionParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -154,7 +154,7 @@ func (h *DeleteMailersSectionHandlerImpl) Handle(params mailers.DeleteMailersSec } // Handle executing the request and returning a response -func (h *GetMailersSectionHandlerImpl) Handle(params mailers.GetMailersSectionParams, principal interface{}) middleware.Responder { +func (h *GetMailersSectionHandlerImpl) Handle(params mailers.GetMailersSectionParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -181,7 +181,7 @@ func (h *GetMailersSectionHandlerImpl) getMailersSection(params mailers.GetMaile } // Handle executing the request and returning a response -func (h *GetMailersSectionsHandlerImpl) Handle(params mailers.GetMailersSectionsParams, principal interface{}) middleware.Responder { +func (h *GetMailersSectionsHandlerImpl) Handle(params mailers.GetMailersSectionsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -207,7 +207,7 @@ func (h *GetMailersSectionsHandlerImpl) getMailersSections(params mailers.GetMai return configuration.GetMailersSections(t) } -func (h *EditMailersSectionHandlerImpl) Handle(params mailers.EditMailersSectionParams, principal interface{}) middleware.Responder { +func (h *EditMailersSectionHandlerImpl) Handle(params mailers.EditMailersSectionParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/map.go b/handlers/map.go index 187e5ec8..e7b0a8af 100644 --- a/handlers/map.go +++ b/handlers/map.go @@ -34,7 +34,7 @@ type GetMapsHandlerImpl struct { } // Handle executing the request and returning a response -func (h *GetMapsHandlerImpl) Handle(params maps.GetAllRuntimeMapFilesParams, principal interface{}) middleware.Responder { +func (h *GetMapsHandlerImpl) Handle(params maps.GetAllRuntimeMapFilesParams, principal any) middleware.Responder { mapList := []*models.Map{} runtime, err := h.Client.Runtime() @@ -71,7 +71,7 @@ type GetMapHandlerImpl struct { Client client_native.HAProxyClient } -func (h *GetMapHandlerImpl) Handle(params maps.GetOneRuntimeMapParams, principal interface{}) middleware.Responder { +func (h *GetMapHandlerImpl) Handle(params maps.GetOneRuntimeMapParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -94,7 +94,7 @@ type ClearMapHandlerImpl struct { Client client_native.HAProxyClient } -func (h *ClearMapHandlerImpl) Handle(params maps.ClearRuntimeMapParams, principal interface{}) middleware.Responder { +func (h *ClearMapHandlerImpl) Handle(params maps.ClearRuntimeMapParams, principal any) middleware.Responder { forceDelete := false if params.ForceDelete != nil { forceDelete = *params.ForceDelete @@ -132,7 +132,7 @@ type ShowMapHandlerImpl struct { Client client_native.HAProxyClient } -func (h *ShowMapHandlerImpl) Handle(params maps.ShowRuntimeMapParams, principal interface{}) middleware.Responder { +func (h *ShowMapHandlerImpl) Handle(params maps.ShowRuntimeMapParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -154,7 +154,7 @@ type AddMapEntryHandlerImpl struct { Client client_native.HAProxyClient } -func (h *AddMapEntryHandlerImpl) Handle(params maps.AddMapEntryParams, principal interface{}) middleware.Responder { +func (h *AddMapEntryHandlerImpl) Handle(params maps.AddMapEntryParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -186,7 +186,7 @@ type MapsAddPayloadRuntimeMapHandlerImpl struct { Client client_native.HAProxyClient } -func (h *MapsAddPayloadRuntimeMapHandlerImpl) Handle(params maps.AddPayloadRuntimeMapParams, principal interface{}) middleware.Responder { +func (h *MapsAddPayloadRuntimeMapHandlerImpl) Handle(params maps.AddPayloadRuntimeMapParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -218,7 +218,7 @@ type GetRuntimeMapEntryHandlerImpl struct { Client client_native.HAProxyClient } -func (h *GetRuntimeMapEntryHandlerImpl) Handle(params maps.GetRuntimeMapEntryParams, principal interface{}) middleware.Responder { +func (h *GetRuntimeMapEntryHandlerImpl) Handle(params maps.GetRuntimeMapEntryParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -240,7 +240,7 @@ type ReplaceRuntimeMapEntryHandlerImpl struct { Client client_native.HAProxyClient } -func (h *ReplaceRuntimeMapEntryHandlerImpl) Handle(params maps.ReplaceRuntimeMapEntryParams, principal interface{}) middleware.Responder { +func (h *ReplaceRuntimeMapEntryHandlerImpl) Handle(params maps.ReplaceRuntimeMapEntryParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -277,7 +277,7 @@ type DeleteRuntimeMapEntryHandlerImpl struct { Client client_native.HAProxyClient } -func (h *DeleteRuntimeMapEntryHandlerImpl) Handle(params maps.DeleteRuntimeMapEntryParams, principal interface{}) middleware.Responder { +func (h *DeleteRuntimeMapEntryHandlerImpl) Handle(params maps.DeleteRuntimeMapEntryParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) diff --git a/handlers/map_storage.go b/handlers/map_storage.go index e15e6dfd..f819fdb1 100644 --- a/handlers/map_storage.go +++ b/handlers/map_storage.go @@ -37,7 +37,7 @@ type StorageCreateStorageMapFileHandlerImpl struct { Client client_native.HAProxyClient } -func (h *StorageCreateStorageMapFileHandlerImpl) Handle(params storage.CreateStorageMapFileParams, principal interface{}) middleware.Responder { +func (h *StorageCreateStorageMapFileHandlerImpl) Handle(params storage.CreateStorageMapFileParams, principal any) middleware.Responder { file, ok := params.FileUpload.(*runtime.File) if !ok { return storage.NewCreateStorageMapFileBadRequest() @@ -72,7 +72,7 @@ type GetAllStorageMapFilesHandlerImpl struct { } // Handle executing the request and returning a response -func (h *GetAllStorageMapFilesHandlerImpl) Handle(params storage.GetAllStorageMapFilesParams, principal interface{}) middleware.Responder { +func (h *GetAllStorageMapFilesHandlerImpl) Handle(params storage.GetAllStorageMapFilesParams, principal any) middleware.Responder { st, err := h.Client.MapStorage() if err != nil { e := misc.HandleError(err) @@ -104,7 +104,7 @@ type GetOneStorageMapHandlerImpl struct { Client client_native.HAProxyClient } -func (h *GetOneStorageMapHandlerImpl) Handle(params storage.GetOneStorageMapParams, principal interface{}) middleware.Responder { +func (h *GetOneStorageMapHandlerImpl) Handle(params storage.GetOneStorageMapParams, principal any) middleware.Responder { st, err := h.Client.MapStorage() if err != nil { e := misc.HandleError(err) @@ -132,7 +132,7 @@ type StorageDeleteStorageMapHandlerImpl struct { Client client_native.HAProxyClient } -func (h *StorageDeleteStorageMapHandlerImpl) Handle(params storage.DeleteStorageMapParams, principal interface{}) middleware.Responder { +func (h *StorageDeleteStorageMapHandlerImpl) Handle(params storage.DeleteStorageMapParams, principal any) middleware.Responder { configuration, err := h.Client.Configuration() if err != nil { e := misc.HandleError(err) @@ -183,7 +183,7 @@ type StorageReplaceStorageMapFileHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h *StorageReplaceStorageMapFileHandlerImpl) Handle(params storage.ReplaceStorageMapFileParams, principal interface{}) middleware.Responder { +func (h *StorageReplaceStorageMapFileHandlerImpl) Handle(params storage.ReplaceStorageMapFileParams, principal any) middleware.Responder { st, err := h.Client.MapStorage() if err != nil { e := misc.HandleError(err) diff --git a/handlers/nameserver.go b/handlers/nameserver.go index b7ffeec4..50fa77ce 100644 --- a/handlers/nameserver.go +++ b/handlers/nameserver.go @@ -54,7 +54,7 @@ type ReplaceNameserverHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateNameserverHandlerImpl) Handle(params nameserver.CreateNameserverParams, principal interface{}) middleware.Responder { +func (h *CreateNameserverHandlerImpl) Handle(params nameserver.CreateNameserverParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -100,7 +100,7 @@ func (h *CreateNameserverHandlerImpl) Handle(params nameserver.CreateNameserverP } // Handle executing the request and returning a response -func (h *DeleteNameserverHandlerImpl) Handle(params nameserver.DeleteNameserverParams, principal interface{}) middleware.Responder { +func (h *DeleteNameserverHandlerImpl) Handle(params nameserver.DeleteNameserverParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -147,7 +147,7 @@ func (h *DeleteNameserverHandlerImpl) Handle(params nameserver.DeleteNameserverP } // Handle executing the request and returning a response -func (h *GetNameserverHandlerImpl) Handle(params nameserver.GetNameserverParams, principal interface{}) middleware.Responder { +func (h *GetNameserverHandlerImpl) Handle(params nameserver.GetNameserverParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -168,7 +168,7 @@ func (h *GetNameserverHandlerImpl) Handle(params nameserver.GetNameserverParams, } // Handle executing the request and returning a response -func (h *GetNameserversHandlerImpl) Handle(params nameserver.GetNameserversParams, principal interface{}) middleware.Responder { +func (h *GetNameserversHandlerImpl) Handle(params nameserver.GetNameserversParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -189,7 +189,7 @@ func (h *GetNameserversHandlerImpl) Handle(params nameserver.GetNameserversParam } // Handle executing the request and returning a response -func (h *ReplaceNameserverHandlerImpl) Handle(params nameserver.ReplaceNameserverParams, principal interface{}) middleware.Responder { +func (h *ReplaceNameserverHandlerImpl) Handle(params nameserver.ReplaceNameserverParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/parent_acl_generated.go b/handlers/parent_acl_generated.go index 9571cc22..dabdad82 100644 --- a/handlers/parent_acl_generated.go +++ b/handlers/parent_acl_generated.go @@ -56,103 +56,103 @@ type ( ReplaceAllACLFCGIAppHandlerImpl ReplaceAllACLHandlerImpl ) -func (h *CreateACLBackendHandlerImpl) Handle(params acl.CreateACLBackendParams, principal interface{}) middleware.Responder { +func (h *CreateACLBackendHandlerImpl) Handle(params acl.CreateACLBackendParams, principal any) middleware.Responder { g := CreateACLHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *CreateACLFrontendHandlerImpl) Handle(params acl.CreateACLFrontendParams, principal interface{}) middleware.Responder { +func (h *CreateACLFrontendHandlerImpl) Handle(params acl.CreateACLFrontendParams, principal any) middleware.Responder { g := CreateACLHandlerImpl(*h) pg := acl.CreateACLBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *CreateACLFCGIAppHandlerImpl) Handle(params acl.CreateACLFCGIAppParams, principal interface{}) middleware.Responder { +func (h *CreateACLFCGIAppHandlerImpl) Handle(params acl.CreateACLFCGIAppParams, principal any) middleware.Responder { g := CreateACLHandlerImpl(*h) pg := acl.CreateACLBackendParams(params) return g.Handle(cnconstants.FCGIAppParentType, pg, principal) } -func (h *GetACLBackendHandlerImpl) Handle(params acl.GetACLBackendParams, principal interface{}) middleware.Responder { +func (h *GetACLBackendHandlerImpl) Handle(params acl.GetACLBackendParams, principal any) middleware.Responder { g := GetACLHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetACLFrontendHandlerImpl) Handle(params acl.GetACLFrontendParams, principal interface{}) middleware.Responder { +func (h *GetACLFrontendHandlerImpl) Handle(params acl.GetACLFrontendParams, principal any) middleware.Responder { g := GetACLHandlerImpl(*h) pg := acl.GetACLBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetACLFCGIAppHandlerImpl) Handle(params acl.GetACLFCGIAppParams, principal interface{}) middleware.Responder { +func (h *GetACLFCGIAppHandlerImpl) Handle(params acl.GetACLFCGIAppParams, principal any) middleware.Responder { g := GetACLHandlerImpl(*h) pg := acl.GetACLBackendParams(params) return g.Handle(cnconstants.FCGIAppParentType, pg, principal) } -func (h *GetAllACLBackendHandlerImpl) Handle(params acl.GetAllACLBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllACLBackendHandlerImpl) Handle(params acl.GetAllACLBackendParams, principal any) middleware.Responder { g := GetAllACLHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllACLFrontendHandlerImpl) Handle(params acl.GetAllACLFrontendParams, principal interface{}) middleware.Responder { +func (h *GetAllACLFrontendHandlerImpl) Handle(params acl.GetAllACLFrontendParams, principal any) middleware.Responder { g := GetAllACLHandlerImpl(*h) pg := acl.GetAllACLBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetAllACLFCGIAppHandlerImpl) Handle(params acl.GetAllACLFCGIAppParams, principal interface{}) middleware.Responder { +func (h *GetAllACLFCGIAppHandlerImpl) Handle(params acl.GetAllACLFCGIAppParams, principal any) middleware.Responder { g := GetAllACLHandlerImpl(*h) pg := acl.GetAllACLBackendParams(params) return g.Handle(cnconstants.FCGIAppParentType, pg, principal) } -func (h *DeleteACLBackendHandlerImpl) Handle(params acl.DeleteACLBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteACLBackendHandlerImpl) Handle(params acl.DeleteACLBackendParams, principal any) middleware.Responder { g := DeleteACLHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteACLFrontendHandlerImpl) Handle(params acl.DeleteACLFrontendParams, principal interface{}) middleware.Responder { +func (h *DeleteACLFrontendHandlerImpl) Handle(params acl.DeleteACLFrontendParams, principal any) middleware.Responder { g := DeleteACLHandlerImpl(*h) pg := acl.DeleteACLBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *DeleteACLFCGIAppHandlerImpl) Handle(params acl.DeleteACLFCGIAppParams, principal interface{}) middleware.Responder { +func (h *DeleteACLFCGIAppHandlerImpl) Handle(params acl.DeleteACLFCGIAppParams, principal any) middleware.Responder { g := DeleteACLHandlerImpl(*h) pg := acl.DeleteACLBackendParams(params) return g.Handle(cnconstants.FCGIAppParentType, pg, principal) } -func (h *ReplaceACLBackendHandlerImpl) Handle(params acl.ReplaceACLBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceACLBackendHandlerImpl) Handle(params acl.ReplaceACLBackendParams, principal any) middleware.Responder { g := ReplaceACLHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceACLFrontendHandlerImpl) Handle(params acl.ReplaceACLFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceACLFrontendHandlerImpl) Handle(params acl.ReplaceACLFrontendParams, principal any) middleware.Responder { g := ReplaceACLHandlerImpl(*h) pg := acl.ReplaceACLBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceACLFCGIAppHandlerImpl) Handle(params acl.ReplaceACLFCGIAppParams, principal interface{}) middleware.Responder { +func (h *ReplaceACLFCGIAppHandlerImpl) Handle(params acl.ReplaceACLFCGIAppParams, principal any) middleware.Responder { g := ReplaceACLHandlerImpl(*h) pg := acl.ReplaceACLBackendParams(params) return g.Handle(cnconstants.FCGIAppParentType, pg, principal) } -func (h *ReplaceAllACLBackendHandlerImpl) Handle(params acl.ReplaceAllACLBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllACLBackendHandlerImpl) Handle(params acl.ReplaceAllACLBackendParams, principal any) middleware.Responder { g := ReplaceAllACLHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceAllACLFrontendHandlerImpl) Handle(params acl.ReplaceAllACLFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllACLFrontendHandlerImpl) Handle(params acl.ReplaceAllACLFrontendParams, principal any) middleware.Responder { g := ReplaceAllACLHandlerImpl(*h) pg := acl.ReplaceAllACLBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceAllACLFCGIAppHandlerImpl) Handle(params acl.ReplaceAllACLFCGIAppParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllACLFCGIAppHandlerImpl) Handle(params acl.ReplaceAllACLFCGIAppParams, principal any) middleware.Responder { g := ReplaceAllACLHandlerImpl(*h) pg := acl.ReplaceAllACLBackendParams(params) return g.Handle(cnconstants.FCGIAppParentType, pg, principal) diff --git a/handlers/parent_bind_generated.go b/handlers/parent_bind_generated.go index 5adcd93f..fe58c618 100644 --- a/handlers/parent_bind_generated.go +++ b/handlers/parent_bind_generated.go @@ -50,86 +50,86 @@ type ( ReplaceBindPeerHandlerImpl ReplaceBindHandlerImpl ) -func (h *CreateBindFrontendHandlerImpl) Handle(params bind.CreateBindFrontendParams, principal interface{}) middleware.Responder { +func (h *CreateBindFrontendHandlerImpl) Handle(params bind.CreateBindFrontendParams, principal any) middleware.Responder { g := CreateBindHandlerImpl(*h) return g.Handle(cnconstants.FrontendParentType, params, principal) } -func (h *CreateBindLogForwardHandlerImpl) Handle(params bind.CreateBindLogForwardParams, principal interface{}) middleware.Responder { +func (h *CreateBindLogForwardHandlerImpl) Handle(params bind.CreateBindLogForwardParams, principal any) middleware.Responder { g := CreateBindHandlerImpl(*h) pg := bind.CreateBindFrontendParams(params) return g.Handle(cnconstants.LogForwardParentType, pg, principal) } -func (h *CreateBindPeerHandlerImpl) Handle(params bind.CreateBindPeerParams, principal interface{}) middleware.Responder { +func (h *CreateBindPeerHandlerImpl) Handle(params bind.CreateBindPeerParams, principal any) middleware.Responder { g := CreateBindHandlerImpl(*h) pg := bind.CreateBindFrontendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *GetBindFrontendHandlerImpl) Handle(params bind.GetBindFrontendParams, principal interface{}) middleware.Responder { +func (h *GetBindFrontendHandlerImpl) Handle(params bind.GetBindFrontendParams, principal any) middleware.Responder { g := GetBindHandlerImpl(*h) return g.Handle(cnconstants.FrontendParentType, params, principal) } -func (h *GetBindLogForwardHandlerImpl) Handle(params bind.GetBindLogForwardParams, principal interface{}) middleware.Responder { +func (h *GetBindLogForwardHandlerImpl) Handle(params bind.GetBindLogForwardParams, principal any) middleware.Responder { g := GetBindHandlerImpl(*h) pg := bind.GetBindFrontendParams(params) return g.Handle(cnconstants.LogForwardParentType, pg, principal) } -func (h *GetBindPeerHandlerImpl) Handle(params bind.GetBindPeerParams, principal interface{}) middleware.Responder { +func (h *GetBindPeerHandlerImpl) Handle(params bind.GetBindPeerParams, principal any) middleware.Responder { g := GetBindHandlerImpl(*h) pg := bind.GetBindFrontendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *GetAllBindFrontendHandlerImpl) Handle(params bind.GetAllBindFrontendParams, principal interface{}) middleware.Responder { +func (h *GetAllBindFrontendHandlerImpl) Handle(params bind.GetAllBindFrontendParams, principal any) middleware.Responder { g := GetAllBindHandlerImpl(*h) return g.Handle(cnconstants.FrontendParentType, params, principal) } -func (h *GetAllBindLogForwardHandlerImpl) Handle(params bind.GetAllBindLogForwardParams, principal interface{}) middleware.Responder { +func (h *GetAllBindLogForwardHandlerImpl) Handle(params bind.GetAllBindLogForwardParams, principal any) middleware.Responder { g := GetAllBindHandlerImpl(*h) pg := bind.GetAllBindFrontendParams(params) return g.Handle(cnconstants.LogForwardParentType, pg, principal) } -func (h *GetAllBindPeerHandlerImpl) Handle(params bind.GetAllBindPeerParams, principal interface{}) middleware.Responder { +func (h *GetAllBindPeerHandlerImpl) Handle(params bind.GetAllBindPeerParams, principal any) middleware.Responder { g := GetAllBindHandlerImpl(*h) pg := bind.GetAllBindFrontendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *DeleteBindFrontendHandlerImpl) Handle(params bind.DeleteBindFrontendParams, principal interface{}) middleware.Responder { +func (h *DeleteBindFrontendHandlerImpl) Handle(params bind.DeleteBindFrontendParams, principal any) middleware.Responder { g := DeleteBindHandlerImpl(*h) return g.Handle(cnconstants.FrontendParentType, params, principal) } -func (h *DeleteBindLogForwardHandlerImpl) Handle(params bind.DeleteBindLogForwardParams, principal interface{}) middleware.Responder { +func (h *DeleteBindLogForwardHandlerImpl) Handle(params bind.DeleteBindLogForwardParams, principal any) middleware.Responder { g := DeleteBindHandlerImpl(*h) pg := bind.DeleteBindFrontendParams(params) return g.Handle(cnconstants.LogForwardParentType, pg, principal) } -func (h *DeleteBindPeerHandlerImpl) Handle(params bind.DeleteBindPeerParams, principal interface{}) middleware.Responder { +func (h *DeleteBindPeerHandlerImpl) Handle(params bind.DeleteBindPeerParams, principal any) middleware.Responder { g := DeleteBindHandlerImpl(*h) pg := bind.DeleteBindFrontendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *ReplaceBindFrontendHandlerImpl) Handle(params bind.ReplaceBindFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceBindFrontendHandlerImpl) Handle(params bind.ReplaceBindFrontendParams, principal any) middleware.Responder { g := ReplaceBindHandlerImpl(*h) return g.Handle(cnconstants.FrontendParentType, params, principal) } -func (h *ReplaceBindLogForwardHandlerImpl) Handle(params bind.ReplaceBindLogForwardParams, principal interface{}) middleware.Responder { +func (h *ReplaceBindLogForwardHandlerImpl) Handle(params bind.ReplaceBindLogForwardParams, principal any) middleware.Responder { g := ReplaceBindHandlerImpl(*h) pg := bind.ReplaceBindFrontendParams(params) return g.Handle(cnconstants.LogForwardParentType, pg, principal) } -func (h *ReplaceBindPeerHandlerImpl) Handle(params bind.ReplaceBindPeerParams, principal interface{}) middleware.Responder { +func (h *ReplaceBindPeerHandlerImpl) Handle(params bind.ReplaceBindPeerParams, principal any) middleware.Responder { g := ReplaceBindHandlerImpl(*h) pg := bind.ReplaceBindFrontendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) diff --git a/handlers/parent_filter_generated.go b/handlers/parent_filter_generated.go index 6ec3fea1..a9401717 100644 --- a/handlers/parent_filter_generated.go +++ b/handlers/parent_filter_generated.go @@ -50,67 +50,67 @@ type ( ReplaceAllFilterFrontendHandlerImpl ReplaceAllFilterHandlerImpl ) -func (h *CreateFilterBackendHandlerImpl) Handle(params filter.CreateFilterBackendParams, principal interface{}) middleware.Responder { +func (h *CreateFilterBackendHandlerImpl) Handle(params filter.CreateFilterBackendParams, principal any) middleware.Responder { g := CreateFilterHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *CreateFilterFrontendHandlerImpl) Handle(params filter.CreateFilterFrontendParams, principal interface{}) middleware.Responder { +func (h *CreateFilterFrontendHandlerImpl) Handle(params filter.CreateFilterFrontendParams, principal any) middleware.Responder { g := CreateFilterHandlerImpl(*h) pg := filter.CreateFilterBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetFilterBackendHandlerImpl) Handle(params filter.GetFilterBackendParams, principal interface{}) middleware.Responder { +func (h *GetFilterBackendHandlerImpl) Handle(params filter.GetFilterBackendParams, principal any) middleware.Responder { g := GetFilterHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetFilterFrontendHandlerImpl) Handle(params filter.GetFilterFrontendParams, principal interface{}) middleware.Responder { +func (h *GetFilterFrontendHandlerImpl) Handle(params filter.GetFilterFrontendParams, principal any) middleware.Responder { g := GetFilterHandlerImpl(*h) pg := filter.GetFilterBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetAllFilterBackendHandlerImpl) Handle(params filter.GetAllFilterBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllFilterBackendHandlerImpl) Handle(params filter.GetAllFilterBackendParams, principal any) middleware.Responder { g := GetAllFilterHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllFilterFrontendHandlerImpl) Handle(params filter.GetAllFilterFrontendParams, principal interface{}) middleware.Responder { +func (h *GetAllFilterFrontendHandlerImpl) Handle(params filter.GetAllFilterFrontendParams, principal any) middleware.Responder { g := GetAllFilterHandlerImpl(*h) pg := filter.GetAllFilterBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *DeleteFilterBackendHandlerImpl) Handle(params filter.DeleteFilterBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteFilterBackendHandlerImpl) Handle(params filter.DeleteFilterBackendParams, principal any) middleware.Responder { g := DeleteFilterHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteFilterFrontendHandlerImpl) Handle(params filter.DeleteFilterFrontendParams, principal interface{}) middleware.Responder { +func (h *DeleteFilterFrontendHandlerImpl) Handle(params filter.DeleteFilterFrontendParams, principal any) middleware.Responder { g := DeleteFilterHandlerImpl(*h) pg := filter.DeleteFilterBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceFilterBackendHandlerImpl) Handle(params filter.ReplaceFilterBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceFilterBackendHandlerImpl) Handle(params filter.ReplaceFilterBackendParams, principal any) middleware.Responder { g := ReplaceFilterHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceFilterFrontendHandlerImpl) Handle(params filter.ReplaceFilterFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceFilterFrontendHandlerImpl) Handle(params filter.ReplaceFilterFrontendParams, principal any) middleware.Responder { g := ReplaceFilterHandlerImpl(*h) pg := filter.ReplaceFilterBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceAllFilterBackendHandlerImpl) Handle(params filter.ReplaceAllFilterBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllFilterBackendHandlerImpl) Handle(params filter.ReplaceAllFilterBackendParams, principal any) middleware.Responder { g := ReplaceAllFilterHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceAllFilterFrontendHandlerImpl) Handle(params filter.ReplaceAllFilterFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllFilterFrontendHandlerImpl) Handle(params filter.ReplaceAllFilterFrontendParams, principal any) middleware.Responder { g := ReplaceAllFilterHandlerImpl(*h) pg := filter.ReplaceAllFilterBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) diff --git a/handlers/parent_http_after_response_rule_generated.go b/handlers/parent_http_after_response_rule_generated.go index f93491ff..76109286 100644 --- a/handlers/parent_http_after_response_rule_generated.go +++ b/handlers/parent_http_after_response_rule_generated.go @@ -50,67 +50,67 @@ type ( ReplaceAllHTTPAfterResponseRuleFrontendHandlerImpl ReplaceAllHTTPAfterResponseRuleHandlerImpl ) -func (h *CreateHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.CreateHTTPAfterResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.CreateHTTPAfterResponseRuleBackendParams, principal any) middleware.Responder { g := CreateHTTPAfterResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *CreateHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.CreateHTTPAfterResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.CreateHTTPAfterResponseRuleFrontendParams, principal any) middleware.Responder { g := CreateHTTPAfterResponseRuleHandlerImpl(*h) pg := http_after_response_rule.CreateHTTPAfterResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.GetHTTPAfterResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.GetHTTPAfterResponseRuleBackendParams, principal any) middleware.Responder { g := GetHTTPAfterResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.GetHTTPAfterResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.GetHTTPAfterResponseRuleFrontendParams, principal any) middleware.Responder { g := GetHTTPAfterResponseRuleHandlerImpl(*h) pg := http_after_response_rule.GetHTTPAfterResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetAllHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.GetAllHTTPAfterResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.GetAllHTTPAfterResponseRuleBackendParams, principal any) middleware.Responder { g := GetAllHTTPAfterResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.GetAllHTTPAfterResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.GetAllHTTPAfterResponseRuleFrontendParams, principal any) middleware.Responder { g := GetAllHTTPAfterResponseRuleHandlerImpl(*h) pg := http_after_response_rule.GetAllHTTPAfterResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *DeleteHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.DeleteHTTPAfterResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.DeleteHTTPAfterResponseRuleBackendParams, principal any) middleware.Responder { g := DeleteHTTPAfterResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.DeleteHTTPAfterResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.DeleteHTTPAfterResponseRuleFrontendParams, principal any) middleware.Responder { g := DeleteHTTPAfterResponseRuleHandlerImpl(*h) pg := http_after_response_rule.DeleteHTTPAfterResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.ReplaceHTTPAfterResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.ReplaceHTTPAfterResponseRuleBackendParams, principal any) middleware.Responder { g := ReplaceHTTPAfterResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.ReplaceHTTPAfterResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.ReplaceHTTPAfterResponseRuleFrontendParams, principal any) middleware.Responder { g := ReplaceHTTPAfterResponseRuleHandlerImpl(*h) pg := http_after_response_rule.ReplaceHTTPAfterResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceAllHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.ReplaceAllHTTPAfterResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPAfterResponseRuleBackendHandlerImpl) Handle(params http_after_response_rule.ReplaceAllHTTPAfterResponseRuleBackendParams, principal any) middleware.Responder { g := ReplaceAllHTTPAfterResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceAllHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.ReplaceAllHTTPAfterResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPAfterResponseRuleFrontendHandlerImpl) Handle(params http_after_response_rule.ReplaceAllHTTPAfterResponseRuleFrontendParams, principal any) middleware.Responder { g := ReplaceAllHTTPAfterResponseRuleHandlerImpl(*h) pg := http_after_response_rule.ReplaceAllHTTPAfterResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) diff --git a/handlers/parent_http_check_generated.go b/handlers/parent_http_check_generated.go index 67405ba6..5746f4af 100644 --- a/handlers/parent_http_check_generated.go +++ b/handlers/parent_http_check_generated.go @@ -50,67 +50,67 @@ type ( ReplaceAllHTTPCheckDefaultsHandlerImpl ReplaceAllHTTPCheckHandlerImpl ) -func (h *CreateHTTPCheckBackendHandlerImpl) Handle(params http_check.CreateHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPCheckBackendHandlerImpl) Handle(params http_check.CreateHTTPCheckBackendParams, principal any) middleware.Responder { g := CreateHTTPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *CreateHTTPCheckDefaultsHandlerImpl) Handle(params http_check.CreateHTTPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPCheckDefaultsHandlerImpl) Handle(params http_check.CreateHTTPCheckDefaultsParams, principal any) middleware.Responder { g := CreateHTTPCheckHandlerImpl(*h) pg := http_check.CreateHTTPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *GetHTTPCheckBackendHandlerImpl) Handle(params http_check.GetHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPCheckBackendHandlerImpl) Handle(params http_check.GetHTTPCheckBackendParams, principal any) middleware.Responder { g := GetHTTPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetHTTPCheckDefaultsHandlerImpl) Handle(params http_check.GetHTTPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *GetHTTPCheckDefaultsHandlerImpl) Handle(params http_check.GetHTTPCheckDefaultsParams, principal any) middleware.Responder { g := GetHTTPCheckHandlerImpl(*h) pg := http_check.GetHTTPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *GetAllHTTPCheckBackendHandlerImpl) Handle(params http_check.GetAllHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPCheckBackendHandlerImpl) Handle(params http_check.GetAllHTTPCheckBackendParams, principal any) middleware.Responder { g := GetAllHTTPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllHTTPCheckDefaultsHandlerImpl) Handle(params http_check.GetAllHTTPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPCheckDefaultsHandlerImpl) Handle(params http_check.GetAllHTTPCheckDefaultsParams, principal any) middleware.Responder { g := GetAllHTTPCheckHandlerImpl(*h) pg := http_check.GetAllHTTPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *DeleteHTTPCheckBackendHandlerImpl) Handle(params http_check.DeleteHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPCheckBackendHandlerImpl) Handle(params http_check.DeleteHTTPCheckBackendParams, principal any) middleware.Responder { g := DeleteHTTPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteHTTPCheckDefaultsHandlerImpl) Handle(params http_check.DeleteHTTPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPCheckDefaultsHandlerImpl) Handle(params http_check.DeleteHTTPCheckDefaultsParams, principal any) middleware.Responder { g := DeleteHTTPCheckHandlerImpl(*h) pg := http_check.DeleteHTTPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *ReplaceHTTPCheckBackendHandlerImpl) Handle(params http_check.ReplaceHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPCheckBackendHandlerImpl) Handle(params http_check.ReplaceHTTPCheckBackendParams, principal any) middleware.Responder { g := ReplaceHTTPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceHTTPCheckDefaultsHandlerImpl) Handle(params http_check.ReplaceHTTPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPCheckDefaultsHandlerImpl) Handle(params http_check.ReplaceHTTPCheckDefaultsParams, principal any) middleware.Responder { g := ReplaceHTTPCheckHandlerImpl(*h) pg := http_check.ReplaceHTTPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *ReplaceAllHTTPCheckBackendHandlerImpl) Handle(params http_check.ReplaceAllHTTPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPCheckBackendHandlerImpl) Handle(params http_check.ReplaceAllHTTPCheckBackendParams, principal any) middleware.Responder { g := ReplaceAllHTTPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceAllHTTPCheckDefaultsHandlerImpl) Handle(params http_check.ReplaceAllHTTPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPCheckDefaultsHandlerImpl) Handle(params http_check.ReplaceAllHTTPCheckDefaultsParams, principal any) middleware.Responder { g := ReplaceAllHTTPCheckHandlerImpl(*h) pg := http_check.ReplaceAllHTTPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) diff --git a/handlers/parent_http_error_rule_generated.go b/handlers/parent_http_error_rule_generated.go index 40e21d55..0949d140 100644 --- a/handlers/parent_http_error_rule_generated.go +++ b/handlers/parent_http_error_rule_generated.go @@ -56,103 +56,103 @@ type ( ReplaceAllHTTPErrorRuleDefaultsHandlerImpl ReplaceAllHTTPErrorRuleHandlerImpl ) -func (h *CreateHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.CreateHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.CreateHTTPErrorRuleBackendParams, principal any) middleware.Responder { g := CreateHTTPErrorRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *CreateHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.CreateHTTPErrorRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.CreateHTTPErrorRuleFrontendParams, principal any) middleware.Responder { g := CreateHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.CreateHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *CreateHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.CreateHTTPErrorRuleDefaultsParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.CreateHTTPErrorRuleDefaultsParams, principal any) middleware.Responder { g := CreateHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.CreateHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *GetHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.GetHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.GetHTTPErrorRuleBackendParams, principal any) middleware.Responder { g := GetHTTPErrorRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.GetHTTPErrorRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.GetHTTPErrorRuleFrontendParams, principal any) middleware.Responder { g := GetHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.GetHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.GetHTTPErrorRuleDefaultsParams, principal interface{}) middleware.Responder { +func (h *GetHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.GetHTTPErrorRuleDefaultsParams, principal any) middleware.Responder { g := GetHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.GetHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *GetAllHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.GetAllHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.GetAllHTTPErrorRuleBackendParams, principal any) middleware.Responder { g := GetAllHTTPErrorRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.GetAllHTTPErrorRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.GetAllHTTPErrorRuleFrontendParams, principal any) middleware.Responder { g := GetAllHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.GetAllHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetAllHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.GetAllHTTPErrorRuleDefaultsParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.GetAllHTTPErrorRuleDefaultsParams, principal any) middleware.Responder { g := GetAllHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.GetAllHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *DeleteHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.DeleteHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.DeleteHTTPErrorRuleBackendParams, principal any) middleware.Responder { g := DeleteHTTPErrorRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.DeleteHTTPErrorRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.DeleteHTTPErrorRuleFrontendParams, principal any) middleware.Responder { g := DeleteHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.DeleteHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *DeleteHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.DeleteHTTPErrorRuleDefaultsParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.DeleteHTTPErrorRuleDefaultsParams, principal any) middleware.Responder { g := DeleteHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.DeleteHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *ReplaceHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.ReplaceHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.ReplaceHTTPErrorRuleBackendParams, principal any) middleware.Responder { g := ReplaceHTTPErrorRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.ReplaceHTTPErrorRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.ReplaceHTTPErrorRuleFrontendParams, principal any) middleware.Responder { g := ReplaceHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.ReplaceHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.ReplaceHTTPErrorRuleDefaultsParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.ReplaceHTTPErrorRuleDefaultsParams, principal any) middleware.Responder { g := ReplaceHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.ReplaceHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *ReplaceAllHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.ReplaceAllHTTPErrorRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPErrorRuleBackendHandlerImpl) Handle(params http_error_rule.ReplaceAllHTTPErrorRuleBackendParams, principal any) middleware.Responder { g := ReplaceAllHTTPErrorRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceAllHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.ReplaceAllHTTPErrorRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPErrorRuleFrontendHandlerImpl) Handle(params http_error_rule.ReplaceAllHTTPErrorRuleFrontendParams, principal any) middleware.Responder { g := ReplaceAllHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.ReplaceAllHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceAllHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.ReplaceAllHTTPErrorRuleDefaultsParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPErrorRuleDefaultsHandlerImpl) Handle(params http_error_rule.ReplaceAllHTTPErrorRuleDefaultsParams, principal any) middleware.Responder { g := ReplaceAllHTTPErrorRuleHandlerImpl(*h) pg := http_error_rule.ReplaceAllHTTPErrorRuleBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) diff --git a/handlers/parent_http_request_rule_generated.go b/handlers/parent_http_request_rule_generated.go index 97e2f6c6..913bebdb 100644 --- a/handlers/parent_http_request_rule_generated.go +++ b/handlers/parent_http_request_rule_generated.go @@ -50,67 +50,67 @@ type ( ReplaceAllHTTPRequestRuleFrontendHandlerImpl ReplaceAllHTTPRequestRuleHandlerImpl ) -func (h *CreateHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.CreateHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.CreateHTTPRequestRuleBackendParams, principal any) middleware.Responder { g := CreateHTTPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *CreateHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.CreateHTTPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.CreateHTTPRequestRuleFrontendParams, principal any) middleware.Responder { g := CreateHTTPRequestRuleHandlerImpl(*h) pg := http_request_rule.CreateHTTPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.GetHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.GetHTTPRequestRuleBackendParams, principal any) middleware.Responder { g := GetHTTPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.GetHTTPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.GetHTTPRequestRuleFrontendParams, principal any) middleware.Responder { g := GetHTTPRequestRuleHandlerImpl(*h) pg := http_request_rule.GetHTTPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetAllHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.GetAllHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.GetAllHTTPRequestRuleBackendParams, principal any) middleware.Responder { g := GetAllHTTPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.GetAllHTTPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.GetAllHTTPRequestRuleFrontendParams, principal any) middleware.Responder { g := GetAllHTTPRequestRuleHandlerImpl(*h) pg := http_request_rule.GetAllHTTPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *DeleteHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.DeleteHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.DeleteHTTPRequestRuleBackendParams, principal any) middleware.Responder { g := DeleteHTTPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.DeleteHTTPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.DeleteHTTPRequestRuleFrontendParams, principal any) middleware.Responder { g := DeleteHTTPRequestRuleHandlerImpl(*h) pg := http_request_rule.DeleteHTTPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.ReplaceHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.ReplaceHTTPRequestRuleBackendParams, principal any) middleware.Responder { g := ReplaceHTTPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.ReplaceHTTPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.ReplaceHTTPRequestRuleFrontendParams, principal any) middleware.Responder { g := ReplaceHTTPRequestRuleHandlerImpl(*h) pg := http_request_rule.ReplaceHTTPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceAllHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.ReplaceAllHTTPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPRequestRuleBackendHandlerImpl) Handle(params http_request_rule.ReplaceAllHTTPRequestRuleBackendParams, principal any) middleware.Responder { g := ReplaceAllHTTPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceAllHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.ReplaceAllHTTPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPRequestRuleFrontendHandlerImpl) Handle(params http_request_rule.ReplaceAllHTTPRequestRuleFrontendParams, principal any) middleware.Responder { g := ReplaceAllHTTPRequestRuleHandlerImpl(*h) pg := http_request_rule.ReplaceAllHTTPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) diff --git a/handlers/parent_http_response_rule_generated.go b/handlers/parent_http_response_rule_generated.go index 228af231..2798adb3 100644 --- a/handlers/parent_http_response_rule_generated.go +++ b/handlers/parent_http_response_rule_generated.go @@ -50,67 +50,67 @@ type ( ReplaceAllHTTPResponseRuleFrontendHandlerImpl ReplaceAllHTTPResponseRuleHandlerImpl ) -func (h *CreateHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.CreateHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.CreateHTTPResponseRuleBackendParams, principal any) middleware.Responder { g := CreateHTTPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *CreateHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.CreateHTTPResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *CreateHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.CreateHTTPResponseRuleFrontendParams, principal any) middleware.Responder { g := CreateHTTPResponseRuleHandlerImpl(*h) pg := http_response_rule.CreateHTTPResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.GetHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.GetHTTPResponseRuleBackendParams, principal any) middleware.Responder { g := GetHTTPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.GetHTTPResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *GetHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.GetHTTPResponseRuleFrontendParams, principal any) middleware.Responder { g := GetHTTPResponseRuleHandlerImpl(*h) pg := http_response_rule.GetHTTPResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetAllHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.GetAllHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.GetAllHTTPResponseRuleBackendParams, principal any) middleware.Responder { g := GetAllHTTPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.GetAllHTTPResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *GetAllHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.GetAllHTTPResponseRuleFrontendParams, principal any) middleware.Responder { g := GetAllHTTPResponseRuleHandlerImpl(*h) pg := http_response_rule.GetAllHTTPResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *DeleteHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.DeleteHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.DeleteHTTPResponseRuleBackendParams, principal any) middleware.Responder { g := DeleteHTTPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.DeleteHTTPResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *DeleteHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.DeleteHTTPResponseRuleFrontendParams, principal any) middleware.Responder { g := DeleteHTTPResponseRuleHandlerImpl(*h) pg := http_response_rule.DeleteHTTPResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.ReplaceHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.ReplaceHTTPResponseRuleBackendParams, principal any) middleware.Responder { g := ReplaceHTTPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.ReplaceHTTPResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.ReplaceHTTPResponseRuleFrontendParams, principal any) middleware.Responder { g := ReplaceHTTPResponseRuleHandlerImpl(*h) pg := http_response_rule.ReplaceHTTPResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceAllHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.ReplaceAllHTTPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPResponseRuleBackendHandlerImpl) Handle(params http_response_rule.ReplaceAllHTTPResponseRuleBackendParams, principal any) middleware.Responder { g := ReplaceAllHTTPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceAllHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.ReplaceAllHTTPResponseRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllHTTPResponseRuleFrontendHandlerImpl) Handle(params http_response_rule.ReplaceAllHTTPResponseRuleFrontendParams, principal any) middleware.Responder { g := ReplaceAllHTTPResponseRuleHandlerImpl(*h) pg := http_response_rule.ReplaceAllHTTPResponseRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) diff --git a/handlers/parent_log_target_generated.go b/handlers/parent_log_target_generated.go index 3bcb74d0..b2fb408d 100644 --- a/handlers/parent_log_target_generated.go +++ b/handlers/parent_log_target_generated.go @@ -68,175 +68,175 @@ type ( ReplaceAllLogTargetLogForwardHandlerImpl ReplaceAllLogTargetHandlerImpl ) -func (h *CreateLogTargetBackendHandlerImpl) Handle(params log_target.CreateLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *CreateLogTargetBackendHandlerImpl) Handle(params log_target.CreateLogTargetBackendParams, principal any) middleware.Responder { g := CreateLogTargetHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *CreateLogTargetFrontendHandlerImpl) Handle(params log_target.CreateLogTargetFrontendParams, principal interface{}) middleware.Responder { +func (h *CreateLogTargetFrontendHandlerImpl) Handle(params log_target.CreateLogTargetFrontendParams, principal any) middleware.Responder { g := CreateLogTargetHandlerImpl(*h) pg := log_target.CreateLogTargetBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *CreateLogTargetDefaultsHandlerImpl) Handle(params log_target.CreateLogTargetDefaultsParams, principal interface{}) middleware.Responder { +func (h *CreateLogTargetDefaultsHandlerImpl) Handle(params log_target.CreateLogTargetDefaultsParams, principal any) middleware.Responder { g := CreateLogTargetHandlerImpl(*h) pg := log_target.CreateLogTargetBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *CreateLogTargetPeerHandlerImpl) Handle(params log_target.CreateLogTargetPeerParams, principal interface{}) middleware.Responder { +func (h *CreateLogTargetPeerHandlerImpl) Handle(params log_target.CreateLogTargetPeerParams, principal any) middleware.Responder { g := CreateLogTargetHandlerImpl(*h) pg := log_target.CreateLogTargetBackendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *CreateLogTargetLogForwardHandlerImpl) Handle(params log_target.CreateLogTargetLogForwardParams, principal interface{}) middleware.Responder { +func (h *CreateLogTargetLogForwardHandlerImpl) Handle(params log_target.CreateLogTargetLogForwardParams, principal any) middleware.Responder { g := CreateLogTargetHandlerImpl(*h) pg := log_target.CreateLogTargetBackendParams(params) return g.Handle(cnconstants.LogForwardParentType, pg, principal) } -func (h *GetLogTargetBackendHandlerImpl) Handle(params log_target.GetLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *GetLogTargetBackendHandlerImpl) Handle(params log_target.GetLogTargetBackendParams, principal any) middleware.Responder { g := GetLogTargetHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetLogTargetFrontendHandlerImpl) Handle(params log_target.GetLogTargetFrontendParams, principal interface{}) middleware.Responder { +func (h *GetLogTargetFrontendHandlerImpl) Handle(params log_target.GetLogTargetFrontendParams, principal any) middleware.Responder { g := GetLogTargetHandlerImpl(*h) pg := log_target.GetLogTargetBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetLogTargetDefaultsHandlerImpl) Handle(params log_target.GetLogTargetDefaultsParams, principal interface{}) middleware.Responder { +func (h *GetLogTargetDefaultsHandlerImpl) Handle(params log_target.GetLogTargetDefaultsParams, principal any) middleware.Responder { g := GetLogTargetHandlerImpl(*h) pg := log_target.GetLogTargetBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *GetLogTargetPeerHandlerImpl) Handle(params log_target.GetLogTargetPeerParams, principal interface{}) middleware.Responder { +func (h *GetLogTargetPeerHandlerImpl) Handle(params log_target.GetLogTargetPeerParams, principal any) middleware.Responder { g := GetLogTargetHandlerImpl(*h) pg := log_target.GetLogTargetBackendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *GetLogTargetLogForwardHandlerImpl) Handle(params log_target.GetLogTargetLogForwardParams, principal interface{}) middleware.Responder { +func (h *GetLogTargetLogForwardHandlerImpl) Handle(params log_target.GetLogTargetLogForwardParams, principal any) middleware.Responder { g := GetLogTargetHandlerImpl(*h) pg := log_target.GetLogTargetBackendParams(params) return g.Handle(cnconstants.LogForwardParentType, pg, principal) } -func (h *GetAllLogTargetBackendHandlerImpl) Handle(params log_target.GetAllLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllLogTargetBackendHandlerImpl) Handle(params log_target.GetAllLogTargetBackendParams, principal any) middleware.Responder { g := GetAllLogTargetHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllLogTargetFrontendHandlerImpl) Handle(params log_target.GetAllLogTargetFrontendParams, principal interface{}) middleware.Responder { +func (h *GetAllLogTargetFrontendHandlerImpl) Handle(params log_target.GetAllLogTargetFrontendParams, principal any) middleware.Responder { g := GetAllLogTargetHandlerImpl(*h) pg := log_target.GetAllLogTargetBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetAllLogTargetDefaultsHandlerImpl) Handle(params log_target.GetAllLogTargetDefaultsParams, principal interface{}) middleware.Responder { +func (h *GetAllLogTargetDefaultsHandlerImpl) Handle(params log_target.GetAllLogTargetDefaultsParams, principal any) middleware.Responder { g := GetAllLogTargetHandlerImpl(*h) pg := log_target.GetAllLogTargetBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *GetAllLogTargetPeerHandlerImpl) Handle(params log_target.GetAllLogTargetPeerParams, principal interface{}) middleware.Responder { +func (h *GetAllLogTargetPeerHandlerImpl) Handle(params log_target.GetAllLogTargetPeerParams, principal any) middleware.Responder { g := GetAllLogTargetHandlerImpl(*h) pg := log_target.GetAllLogTargetBackendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *GetAllLogTargetLogForwardHandlerImpl) Handle(params log_target.GetAllLogTargetLogForwardParams, principal interface{}) middleware.Responder { +func (h *GetAllLogTargetLogForwardHandlerImpl) Handle(params log_target.GetAllLogTargetLogForwardParams, principal any) middleware.Responder { g := GetAllLogTargetHandlerImpl(*h) pg := log_target.GetAllLogTargetBackendParams(params) return g.Handle(cnconstants.LogForwardParentType, pg, principal) } -func (h *DeleteLogTargetBackendHandlerImpl) Handle(params log_target.DeleteLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteLogTargetBackendHandlerImpl) Handle(params log_target.DeleteLogTargetBackendParams, principal any) middleware.Responder { g := DeleteLogTargetHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteLogTargetFrontendHandlerImpl) Handle(params log_target.DeleteLogTargetFrontendParams, principal interface{}) middleware.Responder { +func (h *DeleteLogTargetFrontendHandlerImpl) Handle(params log_target.DeleteLogTargetFrontendParams, principal any) middleware.Responder { g := DeleteLogTargetHandlerImpl(*h) pg := log_target.DeleteLogTargetBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *DeleteLogTargetDefaultsHandlerImpl) Handle(params log_target.DeleteLogTargetDefaultsParams, principal interface{}) middleware.Responder { +func (h *DeleteLogTargetDefaultsHandlerImpl) Handle(params log_target.DeleteLogTargetDefaultsParams, principal any) middleware.Responder { g := DeleteLogTargetHandlerImpl(*h) pg := log_target.DeleteLogTargetBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *DeleteLogTargetPeerHandlerImpl) Handle(params log_target.DeleteLogTargetPeerParams, principal interface{}) middleware.Responder { +func (h *DeleteLogTargetPeerHandlerImpl) Handle(params log_target.DeleteLogTargetPeerParams, principal any) middleware.Responder { g := DeleteLogTargetHandlerImpl(*h) pg := log_target.DeleteLogTargetBackendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *DeleteLogTargetLogForwardHandlerImpl) Handle(params log_target.DeleteLogTargetLogForwardParams, principal interface{}) middleware.Responder { +func (h *DeleteLogTargetLogForwardHandlerImpl) Handle(params log_target.DeleteLogTargetLogForwardParams, principal any) middleware.Responder { g := DeleteLogTargetHandlerImpl(*h) pg := log_target.DeleteLogTargetBackendParams(params) return g.Handle(cnconstants.LogForwardParentType, pg, principal) } -func (h *ReplaceLogTargetBackendHandlerImpl) Handle(params log_target.ReplaceLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceLogTargetBackendHandlerImpl) Handle(params log_target.ReplaceLogTargetBackendParams, principal any) middleware.Responder { g := ReplaceLogTargetHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceLogTargetFrontendHandlerImpl) Handle(params log_target.ReplaceLogTargetFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceLogTargetFrontendHandlerImpl) Handle(params log_target.ReplaceLogTargetFrontendParams, principal any) middleware.Responder { g := ReplaceLogTargetHandlerImpl(*h) pg := log_target.ReplaceLogTargetBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceLogTargetDefaultsHandlerImpl) Handle(params log_target.ReplaceLogTargetDefaultsParams, principal interface{}) middleware.Responder { +func (h *ReplaceLogTargetDefaultsHandlerImpl) Handle(params log_target.ReplaceLogTargetDefaultsParams, principal any) middleware.Responder { g := ReplaceLogTargetHandlerImpl(*h) pg := log_target.ReplaceLogTargetBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *ReplaceLogTargetPeerHandlerImpl) Handle(params log_target.ReplaceLogTargetPeerParams, principal interface{}) middleware.Responder { +func (h *ReplaceLogTargetPeerHandlerImpl) Handle(params log_target.ReplaceLogTargetPeerParams, principal any) middleware.Responder { g := ReplaceLogTargetHandlerImpl(*h) pg := log_target.ReplaceLogTargetBackendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *ReplaceLogTargetLogForwardHandlerImpl) Handle(params log_target.ReplaceLogTargetLogForwardParams, principal interface{}) middleware.Responder { +func (h *ReplaceLogTargetLogForwardHandlerImpl) Handle(params log_target.ReplaceLogTargetLogForwardParams, principal any) middleware.Responder { g := ReplaceLogTargetHandlerImpl(*h) pg := log_target.ReplaceLogTargetBackendParams(params) return g.Handle(cnconstants.LogForwardParentType, pg, principal) } -func (h *ReplaceAllLogTargetBackendHandlerImpl) Handle(params log_target.ReplaceAllLogTargetBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllLogTargetBackendHandlerImpl) Handle(params log_target.ReplaceAllLogTargetBackendParams, principal any) middleware.Responder { g := ReplaceAllLogTargetHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceAllLogTargetFrontendHandlerImpl) Handle(params log_target.ReplaceAllLogTargetFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllLogTargetFrontendHandlerImpl) Handle(params log_target.ReplaceAllLogTargetFrontendParams, principal any) middleware.Responder { g := ReplaceAllLogTargetHandlerImpl(*h) pg := log_target.ReplaceAllLogTargetBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceAllLogTargetDefaultsHandlerImpl) Handle(params log_target.ReplaceAllLogTargetDefaultsParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllLogTargetDefaultsHandlerImpl) Handle(params log_target.ReplaceAllLogTargetDefaultsParams, principal any) middleware.Responder { g := ReplaceAllLogTargetHandlerImpl(*h) pg := log_target.ReplaceAllLogTargetBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *ReplaceAllLogTargetPeerHandlerImpl) Handle(params log_target.ReplaceAllLogTargetPeerParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllLogTargetPeerHandlerImpl) Handle(params log_target.ReplaceAllLogTargetPeerParams, principal any) middleware.Responder { g := ReplaceAllLogTargetHandlerImpl(*h) pg := log_target.ReplaceAllLogTargetBackendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *ReplaceAllLogTargetLogForwardHandlerImpl) Handle(params log_target.ReplaceAllLogTargetLogForwardParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllLogTargetLogForwardHandlerImpl) Handle(params log_target.ReplaceAllLogTargetLogForwardParams, principal any) middleware.Responder { g := ReplaceAllLogTargetHandlerImpl(*h) pg := log_target.ReplaceAllLogTargetBackendParams(params) return g.Handle(cnconstants.LogForwardParentType, pg, principal) diff --git a/handlers/parent_log_target_global.go b/handlers/parent_log_target_global.go index f0d4a6ed..7ff87fd2 100644 --- a/handlers/parent_log_target_global.go +++ b/handlers/parent_log_target_global.go @@ -44,7 +44,7 @@ type ( ReplaceAllLogTargetGlobalHandlerImpl ReplaceAllLogTargetHandlerImpl ) -func (h *CreateLogTargetGlobalHandlerImpl) Handle(params log_target.CreateLogTargetGlobalParams, principal interface{}) middleware.Responder { +func (h *CreateLogTargetGlobalHandlerImpl) Handle(params log_target.CreateLogTargetGlobalParams, principal any) middleware.Responder { g := CreateLogTargetHandlerImpl(*h) paramsG := log_target.CreateLogTargetBackendParams{ Data: params.Data, @@ -58,7 +58,7 @@ func (h *CreateLogTargetGlobalHandlerImpl) Handle(params log_target.CreateLogTar return g.Handle(cnconstants.GlobalParentType, paramsG, principal) } -func (h *GetLogTargetGlobalHandlerImpl) Handle(params log_target.GetLogTargetGlobalParams, principal interface{}) middleware.Responder { +func (h *GetLogTargetGlobalHandlerImpl) Handle(params log_target.GetLogTargetGlobalParams, principal any) middleware.Responder { g := GetLogTargetHandlerImpl(*h) paramsG := log_target.GetLogTargetBackendParams{ HTTPRequest: params.HTTPRequest, @@ -69,7 +69,7 @@ func (h *GetLogTargetGlobalHandlerImpl) Handle(params log_target.GetLogTargetGlo return g.Handle(cnconstants.GlobalParentType, paramsG, principal) } -func (h *GetAllLogTargetGlobalHandlerImpl) Handle(params log_target.GetAllLogTargetGlobalParams, principal interface{}) middleware.Responder { +func (h *GetAllLogTargetGlobalHandlerImpl) Handle(params log_target.GetAllLogTargetGlobalParams, principal any) middleware.Responder { g := GetAllLogTargetHandlerImpl(*h) paramsG := log_target.GetAllLogTargetBackendParams{ HTTPRequest: params.HTTPRequest, @@ -79,7 +79,7 @@ func (h *GetAllLogTargetGlobalHandlerImpl) Handle(params log_target.GetAllLogTar return g.Handle(cnconstants.GlobalParentType, paramsG, principal) } -func (h *DeleteLogTargetGlobalHandlerImpl) Handle(params log_target.DeleteLogTargetGlobalParams, principal interface{}) middleware.Responder { +func (h *DeleteLogTargetGlobalHandlerImpl) Handle(params log_target.DeleteLogTargetGlobalParams, principal any) middleware.Responder { g := DeleteLogTargetHandlerImpl(*h) paramsG := log_target.DeleteLogTargetBackendParams{ HTTPRequest: params.HTTPRequest, @@ -92,7 +92,7 @@ func (h *DeleteLogTargetGlobalHandlerImpl) Handle(params log_target.DeleteLogTar return g.Handle(cnconstants.GlobalParentType, paramsG, principal) } -func (h *ReplaceLogTargetGlobalHandlerImpl) Handle(params log_target.ReplaceLogTargetGlobalParams, principal interface{}) middleware.Responder { +func (h *ReplaceLogTargetGlobalHandlerImpl) Handle(params log_target.ReplaceLogTargetGlobalParams, principal any) middleware.Responder { g := ReplaceLogTargetHandlerImpl(*h) paramsG := log_target.ReplaceLogTargetBackendParams{ Data: params.Data, @@ -106,7 +106,7 @@ func (h *ReplaceLogTargetGlobalHandlerImpl) Handle(params log_target.ReplaceLogT return g.Handle(cnconstants.GlobalParentType, paramsG, principal) } -func (h *ReplaceAllLogTargetGlobalHandlerImpl) Handle(params log_target.ReplaceAllLogTargetGlobalParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllLogTargetGlobalHandlerImpl) Handle(params log_target.ReplaceAllLogTargetGlobalParams, principal any) middleware.Responder { g := ReplaceAllLogTargetHandlerImpl(*h) paramsG := log_target.ReplaceAllLogTargetBackendParams{ Data: params.Data, diff --git a/handlers/parent_server_generated.go b/handlers/parent_server_generated.go index b2783f54..147ddbd1 100644 --- a/handlers/parent_server_generated.go +++ b/handlers/parent_server_generated.go @@ -50,86 +50,86 @@ type ( ReplaceServerRingHandlerImpl ReplaceServerHandlerImpl ) -func (h *CreateServerBackendHandlerImpl) Handle(params server.CreateServerBackendParams, principal interface{}) middleware.Responder { +func (h *CreateServerBackendHandlerImpl) Handle(params server.CreateServerBackendParams, principal any) middleware.Responder { g := CreateServerHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *CreateServerPeerHandlerImpl) Handle(params server.CreateServerPeerParams, principal interface{}) middleware.Responder { +func (h *CreateServerPeerHandlerImpl) Handle(params server.CreateServerPeerParams, principal any) middleware.Responder { g := CreateServerHandlerImpl(*h) pg := server.CreateServerBackendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *CreateServerRingHandlerImpl) Handle(params server.CreateServerRingParams, principal interface{}) middleware.Responder { +func (h *CreateServerRingHandlerImpl) Handle(params server.CreateServerRingParams, principal any) middleware.Responder { g := CreateServerHandlerImpl(*h) pg := server.CreateServerBackendParams(params) return g.Handle(cnconstants.RingParentType, pg, principal) } -func (h *GetServerBackendHandlerImpl) Handle(params server.GetServerBackendParams, principal interface{}) middleware.Responder { +func (h *GetServerBackendHandlerImpl) Handle(params server.GetServerBackendParams, principal any) middleware.Responder { g := GetServerHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetServerPeerHandlerImpl) Handle(params server.GetServerPeerParams, principal interface{}) middleware.Responder { +func (h *GetServerPeerHandlerImpl) Handle(params server.GetServerPeerParams, principal any) middleware.Responder { g := GetServerHandlerImpl(*h) pg := server.GetServerBackendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *GetServerRingHandlerImpl) Handle(params server.GetServerRingParams, principal interface{}) middleware.Responder { +func (h *GetServerRingHandlerImpl) Handle(params server.GetServerRingParams, principal any) middleware.Responder { g := GetServerHandlerImpl(*h) pg := server.GetServerBackendParams(params) return g.Handle(cnconstants.RingParentType, pg, principal) } -func (h *GetAllServerBackendHandlerImpl) Handle(params server.GetAllServerBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllServerBackendHandlerImpl) Handle(params server.GetAllServerBackendParams, principal any) middleware.Responder { g := GetAllServerHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllServerPeerHandlerImpl) Handle(params server.GetAllServerPeerParams, principal interface{}) middleware.Responder { +func (h *GetAllServerPeerHandlerImpl) Handle(params server.GetAllServerPeerParams, principal any) middleware.Responder { g := GetAllServerHandlerImpl(*h) pg := server.GetAllServerBackendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *GetAllServerRingHandlerImpl) Handle(params server.GetAllServerRingParams, principal interface{}) middleware.Responder { +func (h *GetAllServerRingHandlerImpl) Handle(params server.GetAllServerRingParams, principal any) middleware.Responder { g := GetAllServerHandlerImpl(*h) pg := server.GetAllServerBackendParams(params) return g.Handle(cnconstants.RingParentType, pg, principal) } -func (h *DeleteServerBackendHandlerImpl) Handle(params server.DeleteServerBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteServerBackendHandlerImpl) Handle(params server.DeleteServerBackendParams, principal any) middleware.Responder { g := DeleteServerHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteServerPeerHandlerImpl) Handle(params server.DeleteServerPeerParams, principal interface{}) middleware.Responder { +func (h *DeleteServerPeerHandlerImpl) Handle(params server.DeleteServerPeerParams, principal any) middleware.Responder { g := DeleteServerHandlerImpl(*h) pg := server.DeleteServerBackendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *DeleteServerRingHandlerImpl) Handle(params server.DeleteServerRingParams, principal interface{}) middleware.Responder { +func (h *DeleteServerRingHandlerImpl) Handle(params server.DeleteServerRingParams, principal any) middleware.Responder { g := DeleteServerHandlerImpl(*h) pg := server.DeleteServerBackendParams(params) return g.Handle(cnconstants.RingParentType, pg, principal) } -func (h *ReplaceServerBackendHandlerImpl) Handle(params server.ReplaceServerBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceServerBackendHandlerImpl) Handle(params server.ReplaceServerBackendParams, principal any) middleware.Responder { g := ReplaceServerHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceServerPeerHandlerImpl) Handle(params server.ReplaceServerPeerParams, principal interface{}) middleware.Responder { +func (h *ReplaceServerPeerHandlerImpl) Handle(params server.ReplaceServerPeerParams, principal any) middleware.Responder { g := ReplaceServerHandlerImpl(*h) pg := server.ReplaceServerBackendParams(params) return g.Handle(cnconstants.PeerParentType, pg, principal) } -func (h *ReplaceServerRingHandlerImpl) Handle(params server.ReplaceServerRingParams, principal interface{}) middleware.Responder { +func (h *ReplaceServerRingHandlerImpl) Handle(params server.ReplaceServerRingParams, principal any) middleware.Responder { g := ReplaceServerHandlerImpl(*h) pg := server.ReplaceServerBackendParams(params) return g.Handle(cnconstants.RingParentType, pg, principal) diff --git a/handlers/parent_tcp_check_generated.go b/handlers/parent_tcp_check_generated.go index da8bfbda..26458608 100644 --- a/handlers/parent_tcp_check_generated.go +++ b/handlers/parent_tcp_check_generated.go @@ -50,67 +50,67 @@ type ( ReplaceAllTCPCheckDefaultsHandlerImpl ReplaceAllTCPCheckHandlerImpl ) -func (h *CreateTCPCheckBackendHandlerImpl) Handle(params tcp_check.CreateTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *CreateTCPCheckBackendHandlerImpl) Handle(params tcp_check.CreateTCPCheckBackendParams, principal any) middleware.Responder { g := CreateTCPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *CreateTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.CreateTCPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *CreateTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.CreateTCPCheckDefaultsParams, principal any) middleware.Responder { g := CreateTCPCheckHandlerImpl(*h) pg := tcp_check.CreateTCPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *GetTCPCheckBackendHandlerImpl) Handle(params tcp_check.GetTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *GetTCPCheckBackendHandlerImpl) Handle(params tcp_check.GetTCPCheckBackendParams, principal any) middleware.Responder { g := GetTCPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.GetTCPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *GetTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.GetTCPCheckDefaultsParams, principal any) middleware.Responder { g := GetTCPCheckHandlerImpl(*h) pg := tcp_check.GetTCPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *GetAllTCPCheckBackendHandlerImpl) Handle(params tcp_check.GetAllTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllTCPCheckBackendHandlerImpl) Handle(params tcp_check.GetAllTCPCheckBackendParams, principal any) middleware.Responder { g := GetAllTCPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.GetAllTCPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *GetAllTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.GetAllTCPCheckDefaultsParams, principal any) middleware.Responder { g := GetAllTCPCheckHandlerImpl(*h) pg := tcp_check.GetAllTCPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *DeleteTCPCheckBackendHandlerImpl) Handle(params tcp_check.DeleteTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteTCPCheckBackendHandlerImpl) Handle(params tcp_check.DeleteTCPCheckBackendParams, principal any) middleware.Responder { g := DeleteTCPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.DeleteTCPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *DeleteTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.DeleteTCPCheckDefaultsParams, principal any) middleware.Responder { g := DeleteTCPCheckHandlerImpl(*h) pg := tcp_check.DeleteTCPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *ReplaceTCPCheckBackendHandlerImpl) Handle(params tcp_check.ReplaceTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceTCPCheckBackendHandlerImpl) Handle(params tcp_check.ReplaceTCPCheckBackendParams, principal any) middleware.Responder { g := ReplaceTCPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.ReplaceTCPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *ReplaceTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.ReplaceTCPCheckDefaultsParams, principal any) middleware.Responder { g := ReplaceTCPCheckHandlerImpl(*h) pg := tcp_check.ReplaceTCPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) } -func (h *ReplaceAllTCPCheckBackendHandlerImpl) Handle(params tcp_check.ReplaceAllTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllTCPCheckBackendHandlerImpl) Handle(params tcp_check.ReplaceAllTCPCheckBackendParams, principal any) middleware.Responder { g := ReplaceAllTCPCheckHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceAllTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.ReplaceAllTCPCheckDefaultsParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllTCPCheckDefaultsHandlerImpl) Handle(params tcp_check.ReplaceAllTCPCheckDefaultsParams, principal any) middleware.Responder { g := ReplaceAllTCPCheckHandlerImpl(*h) pg := tcp_check.ReplaceAllTCPCheckBackendParams(params) return g.Handle(cnconstants.DefaultsParentType, pg, principal) diff --git a/handlers/parent_tcp_request_rule_generated.go b/handlers/parent_tcp_request_rule_generated.go index 2d205af2..7e4d2622 100644 --- a/handlers/parent_tcp_request_rule_generated.go +++ b/handlers/parent_tcp_request_rule_generated.go @@ -50,67 +50,67 @@ type ( ReplaceAllTCPRequestRuleFrontendHandlerImpl ReplaceAllTCPRequestRuleHandlerImpl ) -func (h *CreateTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.CreateTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *CreateTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.CreateTCPRequestRuleBackendParams, principal any) middleware.Responder { g := CreateTCPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *CreateTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.CreateTCPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *CreateTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.CreateTCPRequestRuleFrontendParams, principal any) middleware.Responder { g := CreateTCPRequestRuleHandlerImpl(*h) pg := tcp_request_rule.CreateTCPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.GetTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.GetTCPRequestRuleBackendParams, principal any) middleware.Responder { g := GetTCPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.GetTCPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *GetTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.GetTCPRequestRuleFrontendParams, principal any) middleware.Responder { g := GetTCPRequestRuleHandlerImpl(*h) pg := tcp_request_rule.GetTCPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *GetAllTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.GetAllTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.GetAllTCPRequestRuleBackendParams, principal any) middleware.Responder { g := GetAllTCPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.GetAllTCPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *GetAllTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.GetAllTCPRequestRuleFrontendParams, principal any) middleware.Responder { g := GetAllTCPRequestRuleHandlerImpl(*h) pg := tcp_request_rule.GetAllTCPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *DeleteTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.DeleteTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.DeleteTCPRequestRuleBackendParams, principal any) middleware.Responder { g := DeleteTCPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.DeleteTCPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *DeleteTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.DeleteTCPRequestRuleFrontendParams, principal any) middleware.Responder { g := DeleteTCPRequestRuleHandlerImpl(*h) pg := tcp_request_rule.DeleteTCPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.ReplaceTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.ReplaceTCPRequestRuleBackendParams, principal any) middleware.Responder { g := ReplaceTCPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.ReplaceTCPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.ReplaceTCPRequestRuleFrontendParams, principal any) middleware.Responder { g := ReplaceTCPRequestRuleHandlerImpl(*h) pg := tcp_request_rule.ReplaceTCPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) } -func (h *ReplaceAllTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.ReplaceAllTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllTCPRequestRuleBackendHandlerImpl) Handle(params tcp_request_rule.ReplaceAllTCPRequestRuleBackendParams, principal any) middleware.Responder { g := ReplaceAllTCPRequestRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceAllTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.ReplaceAllTCPRequestRuleFrontendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllTCPRequestRuleFrontendHandlerImpl) Handle(params tcp_request_rule.ReplaceAllTCPRequestRuleFrontendParams, principal any) middleware.Responder { g := ReplaceAllTCPRequestRuleHandlerImpl(*h) pg := tcp_request_rule.ReplaceAllTCPRequestRuleBackendParams(params) return g.Handle(cnconstants.FrontendParentType, pg, principal) diff --git a/handlers/parent_tcp_response_rule_generated.go b/handlers/parent_tcp_response_rule_generated.go index 5cfeaf5d..ad93f4da 100644 --- a/handlers/parent_tcp_response_rule_generated.go +++ b/handlers/parent_tcp_response_rule_generated.go @@ -44,32 +44,32 @@ type ( ReplaceAllTCPResponseRuleBackendHandlerImpl ReplaceAllTCPResponseRuleHandlerImpl ) -func (h *CreateTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.CreateTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *CreateTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.CreateTCPResponseRuleBackendParams, principal any) middleware.Responder { g := CreateTCPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.GetTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.GetTCPResponseRuleBackendParams, principal any) middleware.Responder { g := GetTCPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *GetAllTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.GetAllTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.GetAllTCPResponseRuleBackendParams, principal any) middleware.Responder { g := GetAllTCPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *DeleteTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.DeleteTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.DeleteTCPResponseRuleBackendParams, principal any) middleware.Responder { g := DeleteTCPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.ReplaceTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.ReplaceTCPResponseRuleBackendParams, principal any) middleware.Responder { g := ReplaceTCPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } -func (h *ReplaceAllTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.ReplaceAllTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllTCPResponseRuleBackendHandlerImpl) Handle(params tcp_response_rule.ReplaceAllTCPResponseRuleBackendParams, principal any) middleware.Responder { g := ReplaceAllTCPResponseRuleHandlerImpl(*h) return g.Handle(cnconstants.BackendParentType, params, principal) } diff --git a/handlers/peer.go b/handlers/peer.go index ca6322c5..de53734c 100644 --- a/handlers/peer.go +++ b/handlers/peer.go @@ -54,7 +54,7 @@ type ReplacePeerHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreatePeerHandlerImpl) Handle(params peer.CreatePeerParams, principal interface{}) middleware.Responder { +func (h *CreatePeerHandlerImpl) Handle(params peer.CreatePeerParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -107,7 +107,7 @@ func (h *CreatePeerHandlerImpl) createPeerSection(params peer.CreatePeerParams, } // Handle executing the request and returning a response -func (h *DeletePeerHandlerImpl) Handle(params peer.DeletePeerParams, principal interface{}) middleware.Responder { +func (h *DeletePeerHandlerImpl) Handle(params peer.DeletePeerParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -154,7 +154,7 @@ func (h *DeletePeerHandlerImpl) Handle(params peer.DeletePeerParams, principal i } // Handle executing the request and returning a response -func (h *GetPeerHandlerImpl) Handle(params peer.GetPeerSectionParams, principal interface{}) middleware.Responder { +func (h *GetPeerHandlerImpl) Handle(params peer.GetPeerSectionParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -180,7 +180,7 @@ func (h *GetPeerHandlerImpl) getPeerSection(params peer.GetPeerSectionParams, t } // Handle executing the request and returning a response -func (h *GetPeersHandlerImpl) Handle(params peer.GetPeerSectionsParams, principal interface{}) middleware.Responder { +func (h *GetPeersHandlerImpl) Handle(params peer.GetPeerSectionsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID diff --git a/handlers/peer_entry.go b/handlers/peer_entry.go index 245cfaf1..ec00a3c9 100644 --- a/handlers/peer_entry.go +++ b/handlers/peer_entry.go @@ -54,7 +54,7 @@ type ReplacePeerEntryHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreatePeerEntryHandlerImpl) Handle(params peer_entry.CreatePeerEntryParams, principal interface{}) middleware.Responder { +func (h *CreatePeerEntryHandlerImpl) Handle(params peer_entry.CreatePeerEntryParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -101,7 +101,7 @@ func (h *CreatePeerEntryHandlerImpl) Handle(params peer_entry.CreatePeerEntryPar } // Handle executing the request and returning a response -func (h *DeletePeerEntryHandlerImpl) Handle(params peer_entry.DeletePeerEntryParams, principal interface{}) middleware.Responder { +func (h *DeletePeerEntryHandlerImpl) Handle(params peer_entry.DeletePeerEntryParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -148,7 +148,7 @@ func (h *DeletePeerEntryHandlerImpl) Handle(params peer_entry.DeletePeerEntryPar } // Handle executing the request and returning a response -func (h *GetPeerEntryHandlerImpl) Handle(params peer_entry.GetPeerEntryParams, principal interface{}) middleware.Responder { +func (h *GetPeerEntryHandlerImpl) Handle(params peer_entry.GetPeerEntryParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -169,7 +169,7 @@ func (h *GetPeerEntryHandlerImpl) Handle(params peer_entry.GetPeerEntryParams, p } // Handle executing the request and returning a response -func (h *GetPeerEntriesHandlerImpl) Handle(params peer_entry.GetPeerEntriesParams, principal interface{}) middleware.Responder { +func (h *GetPeerEntriesHandlerImpl) Handle(params peer_entry.GetPeerEntriesParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -190,7 +190,7 @@ func (h *GetPeerEntriesHandlerImpl) Handle(params peer_entry.GetPeerEntriesParam } // Handle executing the request and returning a response -func (h *ReplacePeerEntryHandlerImpl) Handle(params peer_entry.ReplacePeerEntryParams, principal interface{}) middleware.Responder { +func (h *ReplacePeerEntryHandlerImpl) Handle(params peer_entry.ReplacePeerEntryParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/program.go b/handlers/program.go index f94eb135..058aad8c 100644 --- a/handlers/program.go +++ b/handlers/program.go @@ -28,7 +28,7 @@ type DeleteProgramHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (d DeleteProgramHandlerImpl) Handle(params process_manager.DeleteProgramParams, _ interface{}) middleware.Responder { +func (d DeleteProgramHandlerImpl) Handle(params process_manager.DeleteProgramParams, _ any) middleware.Responder { var t string var v int64 @@ -43,7 +43,7 @@ func (d DeleteProgramHandlerImpl) Handle(params process_manager.DeleteProgramPar code := misc.ErrHTTPBadRequest e := &models.Error{ - Message: misc.StringP("Both force_reload and transaction specified, specify only one"), + Message: new("Both force_reload and transaction specified, specify only one"), Code: &code, } @@ -83,7 +83,7 @@ type CreateProgramHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (c CreateProgramHandlerImpl) Handle(params process_manager.CreateProgramParams, _ interface{}) middleware.Responder { +func (c CreateProgramHandlerImpl) Handle(params process_manager.CreateProgramParams, _ any) middleware.Responder { var t string var v int64 @@ -98,7 +98,7 @@ func (c CreateProgramHandlerImpl) Handle(params process_manager.CreateProgramPar code := misc.ErrHTTPBadRequest e := &models.Error{ - Message: misc.StringP("Both force_reload and transaction specified, specify only one"), + Message: new("Both force_reload and transaction specified, specify only one"), Code: &code, } @@ -137,7 +137,7 @@ type GetProgramHandlerImpl struct { Client client_native.HAProxyClient } -func (g GetProgramHandlerImpl) Handle(params process_manager.GetProgramParams, _ interface{}) middleware.Responder { +func (g GetProgramHandlerImpl) Handle(params process_manager.GetProgramParams, _ any) middleware.Responder { var t string if params.TransactionID != nil { @@ -165,7 +165,7 @@ type GetProgramsHandlerImpl struct { Client client_native.HAProxyClient } -func (g GetProgramsHandlerImpl) Handle(params process_manager.GetProgramsParams, _ interface{}) middleware.Responder { +func (g GetProgramsHandlerImpl) Handle(params process_manager.GetProgramsParams, _ any) middleware.Responder { var t string if params.TransactionID != nil { @@ -194,7 +194,7 @@ type ReplaceProgramHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (r ReplaceProgramHandlerImpl) Handle(params process_manager.ReplaceProgramParams, _ interface{}) middleware.Responder { +func (r ReplaceProgramHandlerImpl) Handle(params process_manager.ReplaceProgramParams, _ any) middleware.Responder { var t string var v int64 @@ -210,7 +210,7 @@ func (r ReplaceProgramHandlerImpl) Handle(params process_manager.ReplaceProgramP code := misc.ErrHTTPBadRequest e := &models.Error{ - Message: misc.StringP("Both force_reload and transaction specified, specify only one"), + Message: new("Both force_reload and transaction specified, specify only one"), Code: &code, } diff --git a/handlers/raw.go b/handlers/raw.go index d2b0b370..e839df99 100644 --- a/handlers/raw.go +++ b/handlers/raw.go @@ -16,7 +16,9 @@ package handlers import ( + "encoding/json" "fmt" + "net/http" "strconv" "strings" @@ -41,7 +43,7 @@ type PostRawConfigurationHandlerImpl struct { } // Handle executing the request and returning a response -func (h *GetRawConfigurationHandlerImpl) Handle(params configuration.GetHAProxyConfigurationParams, principal interface{}) middleware.Responder { +func (h *GetRawConfigurationHandlerImpl) Handle(params configuration.GetHAProxyConfigurationParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -61,17 +63,21 @@ func (h *GetRawConfigurationHandlerImpl) Handle(params configuration.GetHAProxyC _, clusterVersion, md5Hash, data, err := cfg.GetRawConfigurationWithClusterData(t, v) if err != nil { e := misc.HandleError(err) - return configuration.NewGetHAProxyConfigurationDefault(int(*e.Code)).WithPayload(e) + errorStr, marshallError := json.Marshal(e) + if marshallError != nil { + configuration.NewPostHAProxyConfigurationDefault(http.StatusInternalServerError).WithPayload(marshallError.Error()) + } + return configuration.NewGetHAProxyConfigurationDefault(int(*e.Code)).WithPayload(string(errorStr)) } cVersion := "" if clusterVersion != 0 { cVersion = strconv.FormatInt(clusterVersion, 10) } - return configuration.NewGetHAProxyConfigurationOK().WithPayload(&configuration.GetHAProxyConfigurationOKBody{Data: &data}).WithClusterVersion(cVersion).WithConfigurationChecksum(md5Hash) + return configuration.NewGetHAProxyConfigurationOK().WithPayload(data).WithClusterVersion(cVersion).WithConfigurationChecksum(md5Hash) } // Handle executing the request and returning a response -func (h *PostRawConfigurationHandlerImpl) Handle(params configuration.PostHAProxyConfigurationParams, principal interface{}) middleware.Responder { +func (h *PostRawConfigurationHandlerImpl) Handle(params configuration.PostHAProxyConfigurationParams, principal any) middleware.Responder { v := int64(0) if params.Version != nil { v = *params.Version @@ -99,25 +105,41 @@ func (h *PostRawConfigurationHandlerImpl) Handle(params configuration.PostHAProx code := misc.ErrHTTPBadRequest msg := "invalid configuration: no newline character found" e := &models.Error{Code: &code, Message: &msg} - return configuration.NewPostHAProxyConfigurationBadRequest().WithPayload(e) + errorStr, marshallError := json.Marshal(e) + if marshallError != nil { + configuration.NewPostHAProxyConfigurationDefault(http.StatusInternalServerError).WithPayload(marshallError.Error()) + } + return configuration.NewPostHAProxyConfigurationBadRequest().WithPayload(string(errorStr)) } cfg, err := h.Client.Configuration() if err != nil { e := misc.HandleError(err) - return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(e) + errorStr, marshallError := json.Marshal(e) + if marshallError != nil { + configuration.NewPostHAProxyConfigurationDefault(http.StatusInternalServerError).WithPayload(marshallError.Error()) + } + return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(string(errorStr)) } err = cfg.PostRawConfiguration(¶ms.Data, v, skipVersion, onlyValidate) if err != nil { e := misc.HandleError(err) - return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(e) + errorStr, marshallError := json.Marshal(e) + if marshallError != nil { + configuration.NewPostHAProxyConfigurationDefault(http.StatusInternalServerError).WithPayload(marshallError.Error()) + } + return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(string(errorStr)) } _, clusterVersion, md5Hash, data, err := cfg.GetRawConfigurationWithClusterData("", 0) if err != nil { e := misc.HandleError(err) - return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(e) + errorStr, marshallError := json.Marshal(e) + if marshallError != nil { + configuration.NewPostHAProxyConfigurationDefault(http.StatusInternalServerError).WithPayload(marshallError.Error()) + } + return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(string(errorStr)) } cVersion := "" @@ -132,7 +154,11 @@ func (h *PostRawConfigurationHandlerImpl) Handle(params configuration.PostHAProx if params.XRuntimeActions != nil { if err = executeRuntimeActions(*params.XRuntimeActions, h.Client); err != nil { e := misc.HandleError(err) - return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(e) + errorStr, marshallError := json.Marshal(e) + if marshallError != nil { + configuration.NewPostHAProxyConfigurationDefault(http.StatusInternalServerError).WithPayload(marshallError.Error()) + } + return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(string(errorStr)) } } return configuration.NewPostHAProxyConfigurationCreated().WithPayload(data).WithClusterVersion(cVersion).WithConfigurationChecksum(md5Hash) @@ -143,7 +169,11 @@ func (h *PostRawConfigurationHandlerImpl) Handle(params configuration.PostHAProx callbackNeeded, reconfigureFunc, err = cn.ReconfigureRuntime(h.Client) if err != nil { e := misc.HandleError(err) - return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(e) + errorStr, marshallError := json.Marshal(e) + if marshallError != nil { + configuration.NewPostHAProxyConfigurationDefault(http.StatusInternalServerError).WithPayload(marshallError.Error()) + } + return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(string(errorStr)) } if callbackNeeded { err = h.ReloadAgent.ForceReloadWithCallback(reconfigureFunc) @@ -152,14 +182,22 @@ func (h *PostRawConfigurationHandlerImpl) Handle(params configuration.PostHAProx } if err != nil { e := misc.HandleError(err) - return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(e) + errorStr, marshallError := json.Marshal(e) + if marshallError != nil { + configuration.NewPostHAProxyConfigurationDefault(http.StatusInternalServerError).WithPayload(marshallError.Error()) + } + return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(string(errorStr)) } return configuration.NewPostHAProxyConfigurationCreated().WithPayload(data).WithClusterVersion(cVersion).WithConfigurationChecksum(md5Hash) } callbackNeeded, reconfigureFunc, err := cn.ReconfigureRuntime(h.Client) if err != nil { e := misc.HandleError(err) - return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(e) + errorStr, marshallError := json.Marshal(e) + if marshallError != nil { + configuration.NewPostHAProxyConfigurationDefault(http.StatusInternalServerError).WithPayload(marshallError.Error()) + } + return configuration.NewPostHAProxyConfigurationDefault(int(*e.Code)).WithPayload(string(errorStr)) } var rID string @@ -177,13 +215,16 @@ func executeRuntimeActions(actionsStr string, client client_native.HAProxyClient if err != nil { return err } - actions := strings.Split(actionsStr, ";") - for _, a := range actions { + actions := strings.SplitSeq(actionsStr, ";") + for a := range actions { params := strings.Split(a, " ") if len(params) == 0 { continue } action := params[0] + if action == "" { + continue + } switch action { case "SetFrontendMaxConn": if len(params) > 2 { diff --git a/handlers/reloads.go b/handlers/reloads.go index 07a81ea7..74d3a7da 100644 --- a/handlers/reloads.go +++ b/handlers/reloads.go @@ -37,7 +37,7 @@ type GetReloadsHandlerImpl struct { } // Handle executing the request and returning a response -func (rh *GetReloadHandlerImpl) Handle(params reloads.GetReloadParams, principal interface{}) middleware.Responder { +func (rh *GetReloadHandlerImpl) Handle(params reloads.GetReloadParams, principal any) middleware.Responder { r := rh.ReloadAgent.GetReload(params.ID) if r == nil { msg := fmt.Sprintf("Reload with ID %s does not exist", params.ID) @@ -52,7 +52,7 @@ func (rh *GetReloadHandlerImpl) Handle(params reloads.GetReloadParams, principal } // Handle executing the request and returning a response -func (rh *GetReloadsHandlerImpl) Handle(params reloads.GetReloadsParams, principal interface{}) middleware.Responder { +func (rh *GetReloadsHandlerImpl) Handle(params reloads.GetReloadsParams, principal any) middleware.Responder { rs := rh.ReloadAgent.GetReloads() return reloads.NewGetReloadsOK().WithPayload(rs) } diff --git a/handlers/resolver.go b/handlers/resolver.go index d0898b8a..45a8ca7a 100644 --- a/handlers/resolver.go +++ b/handlers/resolver.go @@ -54,7 +54,7 @@ type ReplaceResolverHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateResolverHandlerImpl) Handle(params resolver.CreateResolverParams, principal interface{}) middleware.Responder { +func (h *CreateResolverHandlerImpl) Handle(params resolver.CreateResolverParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -113,7 +113,7 @@ func (h *CreateResolverHandlerImpl) getResolver(params resolver.CreateResolverPa } // Handle executing the request and returning a response -func (h *DeleteResolverHandlerImpl) Handle(params resolver.DeleteResolverParams, principal interface{}) middleware.Responder { +func (h *DeleteResolverHandlerImpl) Handle(params resolver.DeleteResolverParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -160,7 +160,7 @@ func (h *DeleteResolverHandlerImpl) Handle(params resolver.DeleteResolverParams, } // Handle executing the request and returning a response -func (h *GetResolverHandlerImpl) Handle(params resolver.GetResolverParams, principal interface{}) middleware.Responder { +func (h *GetResolverHandlerImpl) Handle(params resolver.GetResolverParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -186,7 +186,7 @@ func (h *GetResolverHandlerImpl) getResolver(params resolver.GetResolverParams, } // Handle executing the request and returning a response -func (h *GetResolversHandlerImpl) Handle(params resolver.GetResolversParams, principal interface{}) middleware.Responder { +func (h *GetResolversHandlerImpl) Handle(params resolver.GetResolversParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -212,7 +212,7 @@ func (h *GetResolversHandlerImpl) getResolvers(params resolver.GetResolversParam } // Handle executing the request and returning a response -func (h *ReplaceResolverHandlerImpl) Handle(params resolver.ReplaceResolverParams, principal interface{}) middleware.Responder { +func (h *ReplaceResolverHandlerImpl) Handle(params resolver.ReplaceResolverParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/ring.go b/handlers/ring.go index 8faff166..fa09e6d5 100644 --- a/handlers/ring.go +++ b/handlers/ring.go @@ -54,7 +54,7 @@ type ReplaceRingHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateRingHandlerImpl) Handle(params ring.CreateRingParams, principal interface{}) middleware.Responder { +func (h *CreateRingHandlerImpl) Handle(params ring.CreateRingParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -107,7 +107,7 @@ func (h *CreateRingHandlerImpl) createRing(params ring.CreateRingParams, t strin } // Handle executing the request and returning a response -func (h *DeleteRingHandlerImpl) Handle(params ring.DeleteRingParams, principal interface{}) middleware.Responder { +func (h *DeleteRingHandlerImpl) Handle(params ring.DeleteRingParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -154,7 +154,7 @@ func (h *DeleteRingHandlerImpl) Handle(params ring.DeleteRingParams, principal i } // Handle executing the request and returning a response -func (h *GetRingHandlerImpl) Handle(params ring.GetRingParams, principal interface{}) middleware.Responder { +func (h *GetRingHandlerImpl) Handle(params ring.GetRingParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -180,7 +180,7 @@ func (h *GetRingHandlerImpl) getRing(params ring.GetRingParams, t string) (int64 } // Handle executing the request and returning a response -func (h *GetRingsHandlerImpl) Handle(params ring.GetRingsParams, principal interface{}) middleware.Responder { +func (h *GetRingsHandlerImpl) Handle(params ring.GetRingsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -206,7 +206,7 @@ func (h *GetRingsHandlerImpl) getRings(params ring.GetRingsParams, t string) (in } // Handle executing the request and returning a response -func (h *ReplaceRingHandlerImpl) Handle(params ring.ReplaceRingParams, principal interface{}) middleware.Responder { +func (h *ReplaceRingHandlerImpl) Handle(params ring.ReplaceRingParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/runtime.go b/handlers/runtime.go index 89cb2e88..3b54d5de 100644 --- a/handlers/runtime.go +++ b/handlers/runtime.go @@ -33,7 +33,7 @@ var RuntimeSupportedFields = map[string][]string{ // ChangeThroughRuntimeAPI checks if something can be changed through the runtime API, and // returns false if reload is not needed, or true if needed. -func changeThroughRuntimeAPI(data, ondisk interface{}, parentName string, client client_native.HAProxyClient) (reload bool) { +func changeThroughRuntimeAPI(data, ondisk any, parentName string, client client_native.HAProxyClient) (reload bool) { // reflect kinds and values are loosely checked as they are bound strictly in // schema, but in case of any panic, we will log and reload to ensure // changes go through @@ -179,7 +179,7 @@ func changeThroughRuntimeAPI(data, ondisk interface{}, parentName string, client } // return string of field names that have a diff -func compareObjects(data, ondisk interface{}) []string { +func compareObjects(data, ondisk any) []string { diff := make([]string, 0) dataVal := reflect.ValueOf(data) ondiskVal := reflect.ValueOf(ondisk) diff --git a/handlers/runtime_server.go b/handlers/runtime_server.go index e2a97912..71370de1 100644 --- a/handlers/runtime_server.go +++ b/handlers/runtime_server.go @@ -23,6 +23,7 @@ import ( client_native "github.com/haproxytech/client-native/v6" native_errors "github.com/haproxytech/client-native/v6/errors" "github.com/haproxytech/client-native/v6/models" + cn_runtime "github.com/haproxytech/client-native/v6/runtime" "github.com/haproxytech/dataplaneapi/misc" "github.com/haproxytech/dataplaneapi/operations/server" @@ -54,7 +55,7 @@ type DeleteRuntimeServerHandlerImpl struct { } // Handle executing the request and returning a response -func (h *GetRuntimeServerHandlerImpl) Handle(params server.GetRuntimeServerParams, principal interface{}) middleware.Responder { +func (h *GetRuntimeServerHandlerImpl) Handle(params server.GetRuntimeServerParams, principal any) middleware.Responder { rn, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -82,7 +83,7 @@ func (h *GetRuntimeServerHandlerImpl) Handle(params server.GetRuntimeServerParam } // Handle executing the request and returning a response -func (h *GetAllRuntimeServerHandlerImpl) Handle(params server.GetAllRuntimeServerParams, principal interface{}) middleware.Responder { +func (h *GetAllRuntimeServerHandlerImpl) Handle(params server.GetAllRuntimeServerParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -102,7 +103,7 @@ func (h *GetAllRuntimeServerHandlerImpl) Handle(params server.GetAllRuntimeServe } // Handle executing the request and returning a response -func (h *ReplaceRuntimeServerHandlerImpl) Handle(params server.ReplaceRuntimeServerParams, principal interface{}) middleware.Responder { +func (h *ReplaceRuntimeServerHandlerImpl) Handle(params server.ReplaceRuntimeServerParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -155,7 +156,7 @@ func (h *ReplaceRuntimeServerHandlerImpl) Handle(params server.ReplaceRuntimeSer // Adds a new server dynamically without modifying the configuration. // Warning: this only works if you have not defined a `default_server` in the defaults // or in the current `backend` section. -func (h *AddRuntimeServerHandlerImpl) Handle(params server.AddRuntimeServerParams, principal interface{}) middleware.Responder { +func (h *AddRuntimeServerHandlerImpl) Handle(params server.AddRuntimeServerParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -168,7 +169,13 @@ func (h *AddRuntimeServerHandlerImpl) Handle(params server.AddRuntimeServerParam return server.NewAddRuntimeServerBadRequest().WithPayload(&models.Error{Code: &code, Message: &msg}) } - err = runtime.AddServer(params.ParentName, params.Data.Name, SerializeRuntimeAddServer(params.Data)) + haversion, err := runtime.GetVersion() + if err != nil { + e := misc.HandleError(err) + return server.NewAddRuntimeServerDefault(int(*e.Code)).WithPayload(e) + } + + err = runtime.AddServer(params.ParentName, params.Data.Name, SerializeRuntimeAddServer(params.Data, &haversion)) if err != nil { msg := err.Error() switch { @@ -194,7 +201,7 @@ func isNotFoundError(err error) bool { } // Deletes a server from a backend immediately, without waiting for connections to drain. -func (h *DeleteRuntimeServerHandlerImpl) Handle(params server.DeleteRuntimeServerParams, principal interface{}) middleware.Responder { +func (h *DeleteRuntimeServerHandlerImpl) Handle(params server.DeleteRuntimeServerParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -236,7 +243,7 @@ func (h *DeleteRuntimeServerHandlerImpl) Handle(params server.DeleteRuntimeServe // SerializeRuntimeAddServer returns a string in the HAProxy config format, suitable // for the "add server" operation over the control socket. // Not all the Server attributes are available in this case. -func SerializeRuntimeAddServer(srv *models.RuntimeAddServer) string { //nolint:cyclop,maintidx +func SerializeRuntimeAddServer(srv *models.RuntimeAddServer, version *cn_runtime.HAProxyVersion) string { //nolint: cyclop,maintidx b := &strings.Builder{} push := func(s string) { @@ -248,11 +255,14 @@ func SerializeRuntimeAddServer(srv *models.RuntimeAddServer) string { //nolint:c } // push a quoted string pushq := func(key, val string) { - fmt.Fprintf(b, ` %s "%s"`, key, val) + fmt.Fprintf(b, ` %s %s`, key, val) } enabled := func(s string) bool { return s == "enabled" } + disabled := func(s string) bool { + return s == "disabled" + } // Address is mandatory and must come first, with an optional port number. addr := srv.Address @@ -261,155 +271,228 @@ func SerializeRuntimeAddServer(srv *models.RuntimeAddServer) string { //nolint:c } push(addr) - switch { - case enabled(srv.AgentCheck): + if enabled(srv.AgentCheck) { push("agent-check") - case srv.AgentAddr != "": + } + if srv.AgentAddr != "" { pushq("agent-addr", srv.AgentAddr) - case srv.AgentPort != nil: + } + if srv.AgentPort != nil { pushi("agent-port", srv.AgentPort) - case srv.AgentInter != nil: + } + if srv.AgentInter != nil { pushi("agent-inter", srv.AgentInter) - case srv.AgentSend != "": + } + if srv.AgentSend != "" { pushq("agent-send", srv.AgentSend) - case srv.Allow0rtt: + } + if srv.Allow0rtt { push("allow-0rtt") - case srv.Alpn != "": + } + if srv.Alpn != "" { pushq("alpn", srv.Alpn) - case enabled(srv.Backup): + } + if enabled(srv.Backup) { push("backup") - case srv.SslCafile != "": + } + if srv.SslCafile != "" { pushq("ca-file", srv.SslCafile) - case enabled(srv.Check): + } + if enabled(srv.Check) { push("check") - case srv.CheckAlpn != "": + } + if srv.CheckAlpn != "" { pushq("check-alpn", srv.CheckAlpn) - case srv.HealthCheckAddress != "": + } + if srv.HealthCheckAddress != "" { pushq("addr", srv.HealthCheckAddress) - case srv.HealthCheckPort != nil: + } + if srv.HealthCheckPort != nil { pushi("port", srv.HealthCheckPort) - case srv.CheckProto != "": + } + if srv.CheckProto != "" { pushq("check-proto", srv.CheckProto) - case enabled(srv.CheckSendProxy): + } + if enabled(srv.CheckSendProxy) { push("check-send-proxy") - case srv.CheckSni != "": + } + if srv.CheckSni != "" { pushq("check-sni", srv.CheckSni) - case enabled(srv.CheckSsl): + } + if enabled(srv.CheckSsl) { push("check-ssl") - case enabled(srv.CheckViaSocks4): + } + if enabled(srv.CheckViaSocks4) { push("check-via-socks4") - case srv.Ciphers != "": + } + if srv.Ciphers != "" { pushq("ciphers", srv.Ciphers) - case srv.Ciphersuites != "": + } + if srv.Ciphersuites != "" { pushq("ciphersuites", srv.Ciphersuites) - case srv.CrlFile != "": + } + if srv.CrlFile != "" { pushq("crl-file", srv.CrlFile) - case srv.SslCertificate != "": + } + if srv.SslCertificate != "" { pushq("crt", srv.SslCertificate) - case enabled(srv.Maintenance): + } + if enabled(srv.Maintenance) { push("disabled") - case srv.Downinter != nil: + } + if srv.Downinter != nil { pushi("downinter", srv.Downinter) - case !enabled(srv.Maintenance): - push("enabled") - case srv.ErrorLimit != nil: + } + if disabled(srv.Maintenance) { + required := new(cn_runtime.HAProxyVersion) + required.ParseHAProxyVersion("3.0.0") + if !cn_runtime.IsBiggerOrEqual(required, version) { + push("enabled") + } + } + if srv.ErrorLimit != nil { pushi("error-limit", srv.ErrorLimit) - case srv.Fall != nil: + } + if srv.Fall != nil { pushi("fall", srv.Fall) - case srv.Fastinter != nil: + } + if srv.Fastinter != nil { pushi("fastinter", srv.Fastinter) - case enabled(srv.ForceSslv3): + } + if enabled(srv.ForceSslv3) { push("force-sslv3") - case enabled(srv.ForceTlsv10): + } + if enabled(srv.ForceTlsv10) { push("force-tlsv10") - case enabled(srv.ForceTlsv11): + } + if enabled(srv.ForceTlsv11) { push("force-tlsv11") - case enabled(srv.ForceTlsv12): + } + if enabled(srv.ForceTlsv12) { push("force-tlsv12") - case enabled(srv.ForceTlsv13): + } + if enabled(srv.ForceTlsv13) { push("force-tlsv13") - case srv.ID != "": + } + if srv.ID != "" { pushq("id", srv.ID) - case srv.Inter != nil: + } + if srv.Inter != nil { pushi("inter", srv.Inter) - case srv.Maxconn != nil: + } + if srv.Maxconn != nil { pushi("maxconn", srv.Maxconn) - case srv.Maxqueue != nil: + } + if srv.Maxqueue != nil { pushi("maxqueue", srv.Maxqueue) - case srv.Minconn != nil: + } + if srv.Minconn != nil { pushi("minconn", srv.Minconn) - case !enabled(srv.SslReuse): + } + if disabled(srv.SslReuse) { push("no-ssl-reuse") - case enabled(srv.NoSslv3): + } + if enabled(srv.NoSslv3) { push("no-sslv3") - case enabled(srv.NoTlsv10): + } + if enabled(srv.NoTlsv10) { push("no-tlsv10") - case enabled(srv.NoTlsv11): + } + if enabled(srv.NoTlsv11) { push("no-tlsv11") - case enabled(srv.NoTlsv12): + } + if enabled(srv.NoTlsv12) { push("no-tlsv12") - case enabled(srv.NoTlsv13): + } + if enabled(srv.NoTlsv13) { push("no-tlsv13") - case !enabled(srv.TLSTickets): + } + if disabled(srv.TLSTickets) { push("no-tls-tickets") - case srv.Npn != "": + } + if srv.Npn != "" { pushq("npm", srv.Npn) - case srv.Observe != "": + } + if srv.Observe != "" { pushq("observe", srv.Observe) - case srv.OnError != "": + } + if srv.OnError != "" { pushq("on-error", srv.OnError) - case srv.OnMarkedDown != "": + } + if srv.OnMarkedDown != "" { pushq("on-marked-down", srv.OnMarkedDown) - case srv.OnMarkedUp != "": + } + if srv.OnMarkedUp != "" { pushq("on-marked-up", srv.OnMarkedUp) - case srv.PoolLowConn != nil: + } + if srv.PoolLowConn != nil { pushi("pool-low-conn", srv.PoolLowConn) - case srv.PoolMaxConn != nil: + } + if srv.PoolMaxConn != nil { pushi("pool-max-conn", srv.PoolMaxConn) - case srv.PoolPurgeDelay != nil: + } + if srv.PoolPurgeDelay != nil { pushi("pool-purge-delay", srv.PoolPurgeDelay) - case srv.Proto != "": + } + if srv.Proto != "" { pushq("proto", srv.Proto) - case len(srv.ProxyV2Options) > 0: + } + if len(srv.ProxyV2Options) > 0 { pushq("proxy-v2-options", strings.Join(srv.ProxyV2Options, ",")) - case srv.Rise != nil: + } + if srv.Rise != nil { pushi("rise", srv.Rise) - case enabled(srv.SendProxy): + } + if enabled(srv.SendProxy) { push("send-proxy") - case enabled(srv.SendProxyV2): + } + if enabled(srv.SendProxyV2) { push("send-proxy-v2") - case enabled(srv.SendProxyV2Ssl): + } + if enabled(srv.SendProxyV2Ssl) { push("send-proxy-v2-ssl") - case enabled(srv.SendProxyV2SslCn): + } + if enabled(srv.SendProxyV2SslCn) { push("send-proxy-v2-ssl-cn") - case srv.Slowstart != nil: + } + if srv.Slowstart != nil { pushi("slowstart", srv.Slowstart) - case srv.Sni != "": + } + if srv.Sni != "" { pushq("sni", srv.Sni) - case srv.Source != "": + } + if srv.Source != "" { pushq("source", srv.Source) - case enabled(srv.Ssl): + } + if enabled(srv.Ssl) { push("ssl") - case srv.SslMaxVer != "": + } + if srv.SslMaxVer != "" { pushq("ssl-max-ver", srv.SslMaxVer) - case srv.SslMinVer != "": + } + if srv.SslMinVer != "" { pushq("ssl-min-ver", srv.SslMinVer) - case enabled(srv.Tfo): + } + if enabled(srv.Tfo) { push("tfo") - case enabled(srv.TLSTickets): + } + if enabled(srv.TLSTickets) { push("tls-tickets") - case srv.Track != "": + } + if srv.Track != "" { pushq("track", srv.Track) - /* XXX usesrc is not supported */ - case srv.Verify != "": + } + if srv.Verify != "" { pushq("verify", srv.Verify) - case srv.Verifyhost != "": + } + if srv.Verifyhost != "" { pushq("verifyhost", srv.Verifyhost) - case srv.Weight != nil: + } + if srv.Weight != nil { pushi("weight", srv.Weight) - case srv.Ws != "": + } + if srv.Ws != "" { pushq("ws", srv.Ws) } - return b.String() } diff --git a/handlers/server.go b/handlers/server.go index e38e80c2..541342db 100644 --- a/handlers/server.go +++ b/handlers/server.go @@ -73,7 +73,7 @@ func serverTypeParams(backend *string, parentType *string, parentName *string) ( } // Handle executing the request and returning a response -func (h *CreateServerHandlerImpl) Handle(parentType cnconstants.CnParentType, params server.CreateServerBackendParams, principal interface{}) middleware.Responder { +func (h *CreateServerHandlerImpl) Handle(parentType cnconstants.CnParentType, params server.CreateServerBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -99,7 +99,7 @@ func (h *CreateServerHandlerImpl) Handle(parentType cnconstants.CnParentType, pa return server.NewCreateServerBackendDefault(int(*e.Code)).WithPayload(e) } - pType, pName, err := serverTypeParams(nil, misc.StringP(string(parentType)), ¶ms.ParentName) + pType, pName, err := serverTypeParams(nil, new(string(parentType)), ¶ms.ParentName) if err != nil { e := misc.HandleError(err) return server.NewCreateServerBackendDefault(int(*e.Code)).WithPayload(e) @@ -145,7 +145,8 @@ func (h *CreateServerHandlerImpl) Handle(parentType cnconstants.CnParentType, pa return server.NewCreateServerBackendCreated().WithPayload(params.Data) } if useRuntime { - err = runtimeClient.AddServer(pName, params.Data.Name, SerializeRuntimeAddServer(ras)) + haversion, _ := runtimeClient.GetVersion() + err = runtimeClient.AddServer(pName, params.Data.Name, SerializeRuntimeAddServer(ras, &haversion)) if err == nil { // No need to reload. log.Debugf("backend %s: server %s added though runtime", pName, params.Data.Name) @@ -160,7 +161,7 @@ func (h *CreateServerHandlerImpl) Handle(parentType cnconstants.CnParentType, pa } // Handle executing the request and returning a response -func (h *DeleteServerHandlerImpl) Handle(parentType cnconstants.CnParentType, params server.DeleteServerBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteServerHandlerImpl) Handle(parentType cnconstants.CnParentType, params server.DeleteServerBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -186,7 +187,7 @@ func (h *DeleteServerHandlerImpl) Handle(parentType cnconstants.CnParentType, pa return server.NewDeleteServerBackendDefault(int(*e.Code)).WithPayload(e) } - pType, pName, err := serverTypeParams(nil, misc.StringP(string(parentType)), ¶ms.ParentName) + pType, pName, err := serverTypeParams(nil, new(string(parentType)), ¶ms.ParentName) if err != nil { e := misc.HandleError(err) return server.NewDeleteServerBackendDefault(int(*e.Code)).WithPayload(e) @@ -214,7 +215,7 @@ func (h *DeleteServerHandlerImpl) Handle(parentType cnconstants.CnParentType, pa } // Handle executing the request and returning a response -func (h *GetServerHandlerImpl) Handle(parentType cnconstants.CnParentType, params server.GetServerBackendParams, principal interface{}) middleware.Responder { +func (h *GetServerHandlerImpl) Handle(parentType cnconstants.CnParentType, params server.GetServerBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -226,7 +227,7 @@ func (h *GetServerHandlerImpl) Handle(parentType cnconstants.CnParentType, param return server.NewGetServerBackendDefault(int(*e.Code)).WithPayload(e) } - pType, pName, err := serverTypeParams(nil, misc.StringP(string(parentType)), ¶ms.ParentName) + pType, pName, err := serverTypeParams(nil, new(string(parentType)), ¶ms.ParentName) if err != nil { e := misc.HandleError(err) return server.NewGetServerBackendDefault(int(*e.Code)).WithPayload(e) @@ -241,7 +242,7 @@ func (h *GetServerHandlerImpl) Handle(parentType cnconstants.CnParentType, param } // Handle executing the request and returning a response -func (h *GetAllServerHandlerImpl) Handle(parentType cnconstants.CnParentType, params server.GetAllServerBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllServerHandlerImpl) Handle(parentType cnconstants.CnParentType, params server.GetAllServerBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -253,7 +254,7 @@ func (h *GetAllServerHandlerImpl) Handle(parentType cnconstants.CnParentType, pa return server.NewGetAllServerBackendDefault(int(*e.Code)).WithPayload(e) } - pType, pName, err := serverTypeParams(nil, misc.StringP(string(parentType)), ¶ms.ParentName) + pType, pName, err := serverTypeParams(nil, new(string(parentType)), ¶ms.ParentName) if err != nil { e := misc.HandleError(err) return server.NewGetAllServerBackendDefault(int(*e.Code)).WithPayload(e) @@ -271,7 +272,7 @@ func (h *GetAllServerHandlerImpl) Handle(parentType cnconstants.CnParentType, pa } // Handle executing the request and returning a response -func (h *ReplaceServerHandlerImpl) Handle(parentType cnconstants.CnParentType, params server.ReplaceServerBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceServerHandlerImpl) Handle(parentType cnconstants.CnParentType, params server.ReplaceServerBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -297,7 +298,7 @@ func (h *ReplaceServerHandlerImpl) Handle(parentType cnconstants.CnParentType, p return server.NewReplaceServerBackendDefault(int(*e.Code)).WithPayload(e) } - pType, pName, err := serverTypeParams(nil, misc.StringP(string(parentType)), ¶ms.ParentName) + pType, pName, err := serverTypeParams(nil, new(string(parentType)), ¶ms.ParentName) if err != nil { e := misc.HandleError(err) return server.NewReplaceServerBackendDefault(int(*e.Code)).WithPayload(e) diff --git a/handlers/server_switching_rule.go b/handlers/server_switching_rule.go index 5d47a0c6..036ae378 100644 --- a/handlers/server_switching_rule.go +++ b/handlers/server_switching_rule.go @@ -59,7 +59,7 @@ type ReplaceServerSwitchingRulesHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateServerSwitchingRuleHandlerImpl) Handle(params server_switching_rule.CreateServerSwitchingRuleParams, principal interface{}) middleware.Responder { +func (h *CreateServerSwitchingRuleHandlerImpl) Handle(params server_switching_rule.CreateServerSwitchingRuleParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -107,7 +107,7 @@ func (h *CreateServerSwitchingRuleHandlerImpl) Handle(params server_switching_ru } // Handle executing the request and returning a response -func (h *DeleteServerSwitchingRuleHandlerImpl) Handle(params server_switching_rule.DeleteServerSwitchingRuleParams, principal interface{}) middleware.Responder { +func (h *DeleteServerSwitchingRuleHandlerImpl) Handle(params server_switching_rule.DeleteServerSwitchingRuleParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -155,7 +155,7 @@ func (h *DeleteServerSwitchingRuleHandlerImpl) Handle(params server_switching_ru } // Handle executing the request and returning a response -func (h *GetServerSwitchingRuleHandlerImpl) Handle(params server_switching_rule.GetServerSwitchingRuleParams, principal interface{}) middleware.Responder { +func (h *GetServerSwitchingRuleHandlerImpl) Handle(params server_switching_rule.GetServerSwitchingRuleParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -176,7 +176,7 @@ func (h *GetServerSwitchingRuleHandlerImpl) Handle(params server_switching_rule. } // Handle executing the request and returning a response -func (h *GetServerSwitchingRulesHandlerImpl) Handle(params server_switching_rule.GetServerSwitchingRulesParams, principal interface{}) middleware.Responder { +func (h *GetServerSwitchingRulesHandlerImpl) Handle(params server_switching_rule.GetServerSwitchingRulesParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -200,7 +200,7 @@ func (h *GetServerSwitchingRulesHandlerImpl) Handle(params server_switching_rule } // Handle executing the request and returning a response -func (h *ReplaceServerSwitchingRuleHandlerImpl) Handle(params server_switching_rule.ReplaceServerSwitchingRuleParams, principal interface{}) middleware.Responder { +func (h *ReplaceServerSwitchingRuleHandlerImpl) Handle(params server_switching_rule.ReplaceServerSwitchingRuleParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -248,7 +248,7 @@ func (h *ReplaceServerSwitchingRuleHandlerImpl) Handle(params server_switching_r } // Handle executing the request and returning a response -func (h *ReplaceServerSwitchingRulesHandlerImpl) Handle(params server_switching_rule.ReplaceServerSwitchingRulesParams, principal interface{}) middleware.Responder { +func (h *ReplaceServerSwitchingRulesHandlerImpl) Handle(params server_switching_rule.ReplaceServerSwitchingRulesParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/server_template.go b/handlers/server_template.go index 0cfd39b4..84f9ec3c 100644 --- a/handlers/server_template.go +++ b/handlers/server_template.go @@ -54,7 +54,7 @@ type ReplaceServerTemplateHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateServerTemplateHandlerImpl) Handle(params server_template.CreateServerTemplateParams, principal interface{}) middleware.Responder { +func (h *CreateServerTemplateHandlerImpl) Handle(params server_template.CreateServerTemplateParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -101,7 +101,7 @@ func (h *CreateServerTemplateHandlerImpl) Handle(params server_template.CreateSe } // Handle executing the request and returning a response -func (h *DeleteServerTemplateHandlerImpl) Handle(params server_template.DeleteServerTemplateParams, principal interface{}) middleware.Responder { +func (h *DeleteServerTemplateHandlerImpl) Handle(params server_template.DeleteServerTemplateParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -149,7 +149,7 @@ func (h *DeleteServerTemplateHandlerImpl) Handle(params server_template.DeleteSe } // Handle executing the request and returning a response -func (h *GetServerTemplateHandlerImpl) Handle(params server_template.GetServerTemplateParams, principal interface{}) middleware.Responder { +func (h *GetServerTemplateHandlerImpl) Handle(params server_template.GetServerTemplateParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -170,7 +170,7 @@ func (h *GetServerTemplateHandlerImpl) Handle(params server_template.GetServerTe } // Handle executing the request and returning a response -func (h *GetServerTemplatesHandlerImpl) Handle(params server_template.GetServerTemplatesParams, principal interface{}) middleware.Responder { +func (h *GetServerTemplatesHandlerImpl) Handle(params server_template.GetServerTemplatesParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -194,7 +194,7 @@ func (h *GetServerTemplatesHandlerImpl) Handle(params server_template.GetServerT } // Handle executing the request and returning a response -func (h *ReplaceServerTemplateHandlerImpl) Handle(params server_template.ReplaceServerTemplateParams, principal interface{}) middleware.Responder { +func (h *ReplaceServerTemplateHandlerImpl) Handle(params server_template.ReplaceServerTemplateParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/site.go b/handlers/site.go index 44764378..031d1f59 100644 --- a/handlers/site.go +++ b/handlers/site.go @@ -54,7 +54,7 @@ type ReplaceSiteHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateSiteHandlerImpl) Handle(params sites.CreateSiteParams, principal interface{}) middleware.Responder { +func (h *CreateSiteHandlerImpl) Handle(params sites.CreateSiteParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -101,7 +101,7 @@ func (h *CreateSiteHandlerImpl) Handle(params sites.CreateSiteParams, principal } // Handle executing the request and returning a response -func (h *DeleteSiteHandlerImpl) Handle(params sites.DeleteSiteParams, principal interface{}) middleware.Responder { +func (h *DeleteSiteHandlerImpl) Handle(params sites.DeleteSiteParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -148,7 +148,7 @@ func (h *DeleteSiteHandlerImpl) Handle(params sites.DeleteSiteParams, principal } // Handle executing the request and returning a response -func (h *GetSiteHandlerImpl) Handle(params sites.GetSiteParams, principal interface{}) middleware.Responder { +func (h *GetSiteHandlerImpl) Handle(params sites.GetSiteParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -169,7 +169,7 @@ func (h *GetSiteHandlerImpl) Handle(params sites.GetSiteParams, principal interf } // Handle executing the request and returning a response -func (h *GetSitesHandlerImpl) Handle(params sites.GetSitesParams, principal interface{}) middleware.Responder { +func (h *GetSitesHandlerImpl) Handle(params sites.GetSitesParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -193,7 +193,7 @@ func (h *GetSitesHandlerImpl) Handle(params sites.GetSitesParams, principal inte } // Handle executing the request and returning a response -func (h *ReplaceSiteHandlerImpl) Handle(params sites.ReplaceSiteParams, principal interface{}) middleware.Responder { +func (h *ReplaceSiteHandlerImpl) Handle(params sites.ReplaceSiteParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/spoe.go b/handlers/spoe.go index cc2fbd03..970d6ad5 100644 --- a/handlers/spoe.go +++ b/handlers/spoe.go @@ -29,7 +29,7 @@ type SpoeCreateSpoeHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeCreateSpoeHandlerImpl) Handle(params spoe.CreateSpoeParams, principal interface{}) middleware.Responder { +func (h *SpoeCreateSpoeHandlerImpl) Handle(params spoe.CreateSpoeParams, principal any) middleware.Responder { file, ok := params.FileUpload.(*runtime.File) if !ok { return spoe.NewCreateSpoeBadRequest() @@ -54,7 +54,7 @@ type SpoeDeleteSpoeFileHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeDeleteSpoeFileHandlerImpl) Handle(params spoe.DeleteSpoeFileParams, principal interface{}) middleware.Responder { +func (h *SpoeDeleteSpoeFileHandlerImpl) Handle(params spoe.DeleteSpoeFileParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -75,7 +75,7 @@ type SpoeGetAllSpoeFilesHandlerImpl struct { } // SpoeGetAllSpoeFilesHandlerImpl implementation of the SpoeGetAllSpoeFilesHandler -func (h *SpoeGetAllSpoeFilesHandlerImpl) Handle(params spoe.GetAllSpoeFilesParams, principal interface{}) middleware.Responder { +func (h *SpoeGetAllSpoeFilesHandlerImpl) Handle(params spoe.GetAllSpoeFilesParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -95,7 +95,7 @@ type SpoeGetOneSpoeFileHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeGetOneSpoeFileHandlerImpl) Handle(params spoe.GetOneSpoeFileParams, principal interface{}) middleware.Responder { +func (h *SpoeGetOneSpoeFileHandlerImpl) Handle(params spoe.GetOneSpoeFileParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) diff --git a/handlers/spoe_agent.go b/handlers/spoe_agent.go index b2c21f2c..1cbe03f4 100644 --- a/handlers/spoe_agent.go +++ b/handlers/spoe_agent.go @@ -28,7 +28,7 @@ type SpoeCreateSpoeAgentHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeCreateSpoeAgentHandlerImpl) Handle(params spoe.CreateSpoeAgentParams, principal interface{}) middleware.Responder { +func (h *SpoeCreateSpoeAgentHandlerImpl) Handle(params spoe.CreateSpoeAgentParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -61,7 +61,7 @@ type SpoeDeleteSpoeAgentHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeDeleteSpoeAgentHandlerImpl) Handle(params spoe.DeleteSpoeAgentParams, principal interface{}) middleware.Responder { +func (h *SpoeDeleteSpoeAgentHandlerImpl) Handle(params spoe.DeleteSpoeAgentParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -94,7 +94,7 @@ type SpoeGetAllSpoeAgentHandlerImpl struct { } // SpoeGetAllSpoeFilesHandlerImpl implementation of the SpoeGetAllSpoeFilesHandler -func (h *SpoeGetAllSpoeAgentHandlerImpl) Handle(params spoe.GetAllSpoeAgentParams, principal interface{}) middleware.Responder { +func (h *SpoeGetAllSpoeAgentHandlerImpl) Handle(params spoe.GetAllSpoeAgentParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -123,7 +123,7 @@ type SpoeGetSpoeAgentHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeGetSpoeAgentHandlerImpl) Handle(params spoe.GetSpoeAgentParams, principal interface{}) middleware.Responder { +func (h *SpoeGetSpoeAgentHandlerImpl) Handle(params spoe.GetSpoeAgentParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -155,7 +155,7 @@ type SpoeReplaceSpoeAgentHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeReplaceSpoeAgentHandlerImpl) Handle(params spoe.ReplaceSpoeAgentParams, principal interface{}) middleware.Responder { +func (h *SpoeReplaceSpoeAgentHandlerImpl) Handle(params spoe.ReplaceSpoeAgentParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) diff --git a/handlers/spoe_group.go b/handlers/spoe_group.go index 10738ebb..32191a11 100644 --- a/handlers/spoe_group.go +++ b/handlers/spoe_group.go @@ -28,7 +28,7 @@ type SpoeCreateSpoeGroupHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeCreateSpoeGroupHandlerImpl) Handle(params spoe.CreateSpoeGroupParams, principal interface{}) middleware.Responder { +func (h *SpoeCreateSpoeGroupHandlerImpl) Handle(params spoe.CreateSpoeGroupParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -60,7 +60,7 @@ type SpoeDeleteSpoeGroupHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeDeleteSpoeGroupHandlerImpl) Handle(params spoe.DeleteSpoeGroupParams, principal interface{}) middleware.Responder { +func (h *SpoeDeleteSpoeGroupHandlerImpl) Handle(params spoe.DeleteSpoeGroupParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -94,7 +94,7 @@ type SpoeGetAllSpoeGroupHandlerImpl struct { } // SpoeGetAllSpoeGroupHandlerImpl implementation of the SpoeGetAllSpoeFilesHandler -func (h *SpoeGetAllSpoeGroupHandlerImpl) Handle(params spoe.GetAllSpoeGroupParams, principal interface{}) middleware.Responder { +func (h *SpoeGetAllSpoeGroupHandlerImpl) Handle(params spoe.GetAllSpoeGroupParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -123,7 +123,7 @@ type SpoeGetSpoeGroupHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeGetSpoeGroupHandlerImpl) Handle(params spoe.GetSpoeGroupParams, c interface{}) middleware.Responder { +func (h *SpoeGetSpoeGroupHandlerImpl) Handle(params spoe.GetSpoeGroupParams, c any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -155,7 +155,7 @@ type SpoeReplaceSpoeGroupHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeReplaceSpoeGroupHandlerImpl) Handle(params spoe.ReplaceSpoeGroupParams, principal interface{}) middleware.Responder { +func (h *SpoeReplaceSpoeGroupHandlerImpl) Handle(params spoe.ReplaceSpoeGroupParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) diff --git a/handlers/spoe_message.go b/handlers/spoe_message.go index cfd9aa67..3d97c542 100644 --- a/handlers/spoe_message.go +++ b/handlers/spoe_message.go @@ -28,7 +28,7 @@ type SpoeCreateSpoeMessageHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeCreateSpoeMessageHandlerImpl) Handle(params spoe.CreateSpoeMessageParams, principal interface{}) middleware.Responder { +func (h *SpoeCreateSpoeMessageHandlerImpl) Handle(params spoe.CreateSpoeMessageParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -61,7 +61,7 @@ type SpoeDeleteSpoeMessageHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeDeleteSpoeMessageHandlerImpl) Handle(params spoe.DeleteSpoeMessageParams, principal interface{}) middleware.Responder { +func (h *SpoeDeleteSpoeMessageHandlerImpl) Handle(params spoe.DeleteSpoeMessageParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -95,7 +95,7 @@ type SpoeGetAllSpoeMessageHandlerImpl struct { } // SpoeGetAllSpoeMessageHandlerImpl implementation of the SpoeGetAllSpoeFilesHandler -func (h *SpoeGetAllSpoeMessageHandlerImpl) Handle(params spoe.GetAllSpoeMessageParams, principal interface{}) middleware.Responder { +func (h *SpoeGetAllSpoeMessageHandlerImpl) Handle(params spoe.GetAllSpoeMessageParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -124,7 +124,7 @@ type SpoeGetSpoeMessageHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeGetSpoeMessageHandlerImpl) Handle(params spoe.GetSpoeMessageParams, c interface{}) middleware.Responder { +func (h *SpoeGetSpoeMessageHandlerImpl) Handle(params spoe.GetSpoeMessageParams, c any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -156,7 +156,7 @@ type SpoeReplaceSpoeMessageHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeReplaceSpoeMessageHandlerImpl) Handle(params spoe.ReplaceSpoeMessageParams, principal interface{}) middleware.Responder { +func (h *SpoeReplaceSpoeMessageHandlerImpl) Handle(params spoe.ReplaceSpoeMessageParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) diff --git a/handlers/spoe_scope.go b/handlers/spoe_scope.go index caf88b16..0c124ae3 100644 --- a/handlers/spoe_scope.go +++ b/handlers/spoe_scope.go @@ -28,7 +28,7 @@ type SpoeCreateSpoeScopeHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeCreateSpoeScopeHandlerImpl) Handle(params spoe.CreateSpoeScopeParams, principal interface{}) middleware.Responder { +func (h *SpoeCreateSpoeScopeHandlerImpl) Handle(params spoe.CreateSpoeScopeParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -61,7 +61,7 @@ type SpoeDeleteSpoeScopeHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeDeleteSpoeScopeHandlerImpl) Handle(params spoe.DeleteSpoeScopeParams, principal interface{}) middleware.Responder { +func (h *SpoeDeleteSpoeScopeHandlerImpl) Handle(params spoe.DeleteSpoeScopeParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -95,7 +95,7 @@ type SpoeGetAllSpoeScopeHandlerImpl struct { } // SpoeGetAllSpoeFilesHandlerImpl implementation of the SpoeGetAllSpoeFilesHandler -func (h *SpoeGetAllSpoeScopeHandlerImpl) Handle(params spoe.GetAllSpoeScopeParams, principal interface{}) middleware.Responder { +func (h *SpoeGetAllSpoeScopeHandlerImpl) Handle(params spoe.GetAllSpoeScopeParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -124,7 +124,7 @@ type SpoeGetSpoeScopeHandlerImpl struct { Client client_native.HAProxyClient } -func (h *SpoeGetSpoeScopeHandlerImpl) Handle(params spoe.GetSpoeScopeParams, principal interface{}) middleware.Responder { +func (h *SpoeGetSpoeScopeHandlerImpl) Handle(params spoe.GetSpoeScopeParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) diff --git a/handlers/spoe_transaction.go b/handlers/spoe_transaction.go index 20385292..19e83d09 100644 --- a/handlers/spoe_transaction.go +++ b/handlers/spoe_transaction.go @@ -31,7 +31,7 @@ type SpoeTransactionsStartSpoeTransactionHandlerImpl struct { } // Handle executing the request and returning a response -func (h *SpoeTransactionsStartSpoeTransactionHandlerImpl) Handle(params spoe_transactions.StartSpoeTransactionParams, principal interface{}) middleware.Responder { +func (h *SpoeTransactionsStartSpoeTransactionHandlerImpl) Handle(params spoe_transactions.StartSpoeTransactionParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -62,7 +62,7 @@ type SpoeTransactionsDeleteSpoeTransactionHandlerImpl struct { } // Handle executing the request and returning a response -func (h *SpoeTransactionsDeleteSpoeTransactionHandlerImpl) Handle(params spoe_transactions.DeleteSpoeTransactionParams, principal interface{}) middleware.Responder { +func (h *SpoeTransactionsDeleteSpoeTransactionHandlerImpl) Handle(params spoe_transactions.DeleteSpoeTransactionParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -88,7 +88,7 @@ type SpoeTransactionsGetSpoeTransactionHandlerImpl struct { } // Handle executing the request and returning a response -func (h *SpoeTransactionsGetSpoeTransactionHandlerImpl) Handle(params spoe_transactions.GetSpoeTransactionParams, principal interface{}) middleware.Responder { +func (h *SpoeTransactionsGetSpoeTransactionHandlerImpl) Handle(params spoe_transactions.GetSpoeTransactionParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -119,7 +119,7 @@ type SpoeTransactionsGetAllSpoeTransactionHandlerImpl struct { } // Handle executing the request and returning a response -func (h *SpoeTransactionsGetAllSpoeTransactionHandlerImpl) Handle(params spoe_transactions.GetAllSpoeTransactionParams, principal interface{}) middleware.Responder { +func (h *SpoeTransactionsGetAllSpoeTransactionHandlerImpl) Handle(params spoe_transactions.GetAllSpoeTransactionParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) @@ -141,7 +141,7 @@ func (h *SpoeTransactionsGetAllSpoeTransactionHandlerImpl) Handle(params spoe_tr return spoe_transactions.NewGetAllSpoeTransactionDefault(int(*e.Code)).WithPayload(e) } var ms models.SpoeTransactions - if *ts != nil && len(*ts) > 0 { + if len(*ts) > 0 { for _, t := range *ts { m := &models.SpoeTransaction{ Version: t.Version, @@ -161,7 +161,7 @@ type SpoeTransactionsCommitSpoeTransactionHandlerImpl struct { } // Handle executing the request and returning a response -func (h *SpoeTransactionsCommitSpoeTransactionHandlerImpl) Handle(params spoe_transactions.CommitSpoeTransactionParams, principal interface{}) middleware.Responder { +func (h *SpoeTransactionsCommitSpoeTransactionHandlerImpl) Handle(params spoe_transactions.CommitSpoeTransactionParams, principal any) middleware.Responder { spoeStorage, err := h.Client.Spoe() if err != nil { e := misc.HandleError(err) diff --git a/handlers/spoe_version.go b/handlers/spoe_version.go index 7a43858e..8847da2d 100644 --- a/handlers/spoe_version.go +++ b/handlers/spoe_version.go @@ -29,7 +29,7 @@ type SpoeGetSpoeConfigurationVersionHandlerImpl struct { } // Handle executing the request and returning a response -func (h *SpoeGetSpoeConfigurationVersionHandlerImpl) Handle(params spoe.GetSpoeConfigurationVersionParams, principal interface{}) middleware.Responder { +func (h *SpoeGetSpoeConfigurationVersionHandlerImpl) Handle(params spoe.GetSpoeConfigurationVersionParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID diff --git a/handlers/ssl_cert_storage.go b/handlers/ssl_cert_storage.go index 03801a73..6196728b 100644 --- a/handlers/ssl_cert_storage.go +++ b/handlers/ssl_cert_storage.go @@ -38,7 +38,7 @@ type StorageGetAllStorageSSLCertificatesHandlerImpl struct { } // Handle executing the request and returning a response -func (h *StorageGetAllStorageSSLCertificatesHandlerImpl) Handle(params storage.GetAllStorageSSLCertificatesParams, principal interface{}) middleware.Responder { +func (h *StorageGetAllStorageSSLCertificatesHandlerImpl) Handle(params storage.GetAllStorageSSLCertificatesParams, principal any) middleware.Responder { sslStorage, err := h.Client.SSLCertStorage() if err != nil { e := misc.HandleError(err) @@ -67,7 +67,7 @@ type StorageGetOneStorageSSLCertificateHandlerImpl struct { Client client_native.HAProxyClient } -func (h *StorageGetOneStorageSSLCertificateHandlerImpl) Handle(params storage.GetOneStorageSSLCertificateParams, principal interface{}) middleware.Responder { +func (h *StorageGetOneStorageSSLCertificateHandlerImpl) Handle(params storage.GetOneStorageSSLCertificateParams, principal any) middleware.Responder { sslStorage, err := h.Client.SSLCertStorage() if err != nil { e := misc.HandleError(err) @@ -97,6 +97,8 @@ func (h *StorageGetOneStorageSSLCertificateHandlerImpl) Handle(params storage.Ge Issuers: info.Issuers, Domains: info.DNS, IPAddresses: info.IPs, + Subject: info.Subject, + Serial: info.Serial, } return storage.NewGetOneStorageSSLCertificateOK().WithPayload(retf) } @@ -107,7 +109,7 @@ type StorageDeleteStorageSSLCertificateHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h *StorageDeleteStorageSSLCertificateHandlerImpl) Handle(params storage.DeleteStorageSSLCertificateParams, principal interface{}) middleware.Responder { +func (h *StorageDeleteStorageSSLCertificateHandlerImpl) Handle(params storage.DeleteStorageSSLCertificateParams, principal any) middleware.Responder { configuration, err := h.Client.Configuration() if err != nil { e := misc.HandleError(err) @@ -181,7 +183,7 @@ type StorageReplaceStorageSSLCertificateHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h *StorageReplaceStorageSSLCertificateHandlerImpl) Handle(params storage.ReplaceStorageSSLCertificateParams, principal interface{}) middleware.Responder { +func (h *StorageReplaceStorageSSLCertificateHandlerImpl) Handle(params storage.ReplaceStorageSSLCertificateParams, principal any) middleware.Responder { sslStorage, err := h.Client.SSLCertStorage() if err != nil { e := misc.HandleError(err) @@ -202,12 +204,14 @@ func (h *StorageReplaceStorageSSLCertificateHandlerImpl) Handle(params storage.R File: filename, Description: "managed SSL file", StorageName: filepath.Base(filename), - Size: misc.Int64P(len(params.Data)), + Size: new(int64(len(params.Data))), NotAfter: (*strfmt.DateTime)(info.NotAfter), NotBefore: (*strfmt.DateTime)(info.NotBefore), Issuers: info.Issuers, Domains: info.DNS, IPAddresses: info.IPs, + Subject: info.Subject, + Serial: info.Serial, } skipReload := false @@ -242,7 +246,7 @@ type StorageCreateStorageSSLCertificateHandlerImpl struct { ReloadAgent haproxy.IReloadAgent } -func (h *StorageCreateStorageSSLCertificateHandlerImpl) Handle(params storage.CreateStorageSSLCertificateParams, principal interface{}) middleware.Responder { +func (h *StorageCreateStorageSSLCertificateHandlerImpl) Handle(params storage.CreateStorageSSLCertificateParams, principal any) middleware.Responder { sslStorage, err := h.Client.SSLCertStorage() if err != nil { e := misc.HandleError(err) @@ -273,6 +277,13 @@ func (h *StorageCreateStorageSSLCertificateHandlerImpl) Handle(params storage.Cr Issuers: info.Issuers, Domains: info.DNS, IPAddresses: info.IPs, + Subject: info.Subject, + Serial: info.Serial, + } + + skipReload := false + if params.SkipReload != nil { + skipReload = *params.SkipReload } forceReload := false @@ -280,6 +291,10 @@ func (h *StorageCreateStorageSSLCertificateHandlerImpl) Handle(params storage.Cr forceReload = *params.ForceReload } + if skipReload { + return storage.NewCreateStorageSSLCertificateCreated().WithPayload(retf) + } + if forceReload { err := h.ReloadAgent.ForceReload() if err != nil { diff --git a/handlers/stats.go b/handlers/stats.go index 0ab4964d..ed8dd461 100644 --- a/handlers/stats.go +++ b/handlers/stats.go @@ -30,7 +30,7 @@ type GetStatsHandlerImpl struct { } // Handle executing the request and returning a response -func (h *GetStatsHandlerImpl) Handle(params stats.GetStatsParams, principal interface{}) middleware.Responder { +func (h *GetStatsHandlerImpl) Handle(params stats.GetStatsParams, principal any) middleware.Responder { if params.Name != nil { if params.Type == nil { code := misc.ErrHTTPBadRequest diff --git a/handlers/stick_rule.go b/handlers/stick_rule.go index f37cc7a1..358e3df5 100644 --- a/handlers/stick_rule.go +++ b/handlers/stick_rule.go @@ -60,7 +60,7 @@ type ReplaceStickRulesHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateStickRuleHandlerImpl) Handle(params stick_rule.CreateStickRuleParams, principal interface{}) middleware.Responder { +func (h *CreateStickRuleHandlerImpl) Handle(params stick_rule.CreateStickRuleParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -107,7 +107,7 @@ func (h *CreateStickRuleHandlerImpl) Handle(params stick_rule.CreateStickRulePar } // Handle executing the request and returning a response -func (h *DeleteStickRuleHandlerImpl) Handle(params stick_rule.DeleteStickRuleParams, principal interface{}) middleware.Responder { +func (h *DeleteStickRuleHandlerImpl) Handle(params stick_rule.DeleteStickRuleParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -155,7 +155,7 @@ func (h *DeleteStickRuleHandlerImpl) Handle(params stick_rule.DeleteStickRulePar } // Handle executing the request and returning a response -func (h *GetStickRuleHandlerImpl) Handle(params stick_rule.GetStickRuleParams, principal interface{}) middleware.Responder { +func (h *GetStickRuleHandlerImpl) Handle(params stick_rule.GetStickRuleParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -176,7 +176,7 @@ func (h *GetStickRuleHandlerImpl) Handle(params stick_rule.GetStickRuleParams, p } // Handle executing the request and returning a response -func (h *GetStickRulesHandlerImpl) Handle(params stick_rule.GetStickRulesParams, principal interface{}) middleware.Responder { +func (h *GetStickRulesHandlerImpl) Handle(params stick_rule.GetStickRulesParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -200,7 +200,7 @@ func (h *GetStickRulesHandlerImpl) Handle(params stick_rule.GetStickRulesParams, } // Handle executing the request and returning a response -func (h *ReplaceStickRuleHandlerImpl) Handle(params stick_rule.ReplaceStickRuleParams, principal interface{}) middleware.Responder { +func (h *ReplaceStickRuleHandlerImpl) Handle(params stick_rule.ReplaceStickRuleParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -248,7 +248,7 @@ func (h *ReplaceStickRuleHandlerImpl) Handle(params stick_rule.ReplaceStickRuleP } // Handle executing the request and returning a response -func (h *ReplaceStickRulesHandlerImpl) Handle(params stick_rule.ReplaceStickRulesParams, principal interface{}) middleware.Responder { +func (h *ReplaceStickRulesHandlerImpl) Handle(params stick_rule.ReplaceStickRulesParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/stick_table.go b/handlers/stick_table.go index 5b3a3eca..28806a0b 100644 --- a/handlers/stick_table.go +++ b/handlers/stick_table.go @@ -47,7 +47,7 @@ type SetStickTableEntriesHandlerImpl struct { } // Handle executing the request and returning a response -func (h *GetStickTablesHandlerImpl) Handle(params stick_table.GetStickTablesParams, principal interface{}) middleware.Responder { +func (h *GetStickTablesHandlerImpl) Handle(params stick_table.GetStickTablesParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -68,7 +68,7 @@ func (h *GetStickTablesHandlerImpl) Handle(params stick_table.GetStickTablesPara } // Handle executing the request and returning a response -func (h *GetStickTableHandlerImpl) Handle(params stick_table.GetStickTableParams, principal interface{}) middleware.Responder { +func (h *GetStickTableHandlerImpl) Handle(params stick_table.GetStickTableParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -96,7 +96,7 @@ func (h *GetStickTableHandlerImpl) Handle(params stick_table.GetStickTableParams } // Handle executing the request and returning a response -func (h *SetStickTableEntriesHandlerImpl) Handle(params stick_table.SetStickTableEntriesParams, principal interface{}) middleware.Responder { +func (h *SetStickTableEntriesHandlerImpl) Handle(params stick_table.SetStickTableEntriesParams, principal any) middleware.Responder { runtime, err := h.Client.Runtime() if err != nil { e := misc.HandleError(err) @@ -113,7 +113,7 @@ func (h *SetStickTableEntriesHandlerImpl) Handle(params stick_table.SetStickTabl } // Handle executing the request and returning a response -func (h *GetStickTableEntriesHandlerImpl) Handle(params stick_table.GetStickTableEntriesParams, principal interface{}) middleware.Responder { +func (h *GetStickTableEntriesHandlerImpl) Handle(params stick_table.GetStickTableEntriesParams, principal any) middleware.Responder { filter := make([]string, 0) if params.Filter != nil { filter = strings.Split(*params.Filter, ",") diff --git a/handlers/table.go b/handlers/table.go index 173b60d6..3e9a4056 100644 --- a/handlers/table.go +++ b/handlers/table.go @@ -54,7 +54,7 @@ type ReplaceTableHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateTableHandlerImpl) Handle(params table.CreateTableParams, principal interface{}) middleware.Responder { +func (h *CreateTableHandlerImpl) Handle(params table.CreateTableParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -101,7 +101,7 @@ func (h *CreateTableHandlerImpl) Handle(params table.CreateTableParams, principa } // Handle executing the request and returning a response -func (h *DeleteTableHandlerImpl) Handle(params table.DeleteTableParams, principal interface{}) middleware.Responder { +func (h *DeleteTableHandlerImpl) Handle(params table.DeleteTableParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -148,7 +148,7 @@ func (h *DeleteTableHandlerImpl) Handle(params table.DeleteTableParams, principa } // Handle executing the request and returning a response -func (h *GetTableHandlerImpl) Handle(params table.GetTableParams, principal interface{}) middleware.Responder { +func (h *GetTableHandlerImpl) Handle(params table.GetTableParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -169,7 +169,7 @@ func (h *GetTableHandlerImpl) Handle(params table.GetTableParams, principal inte } // Handle executing the request and returning a response -func (h *GetTablesHandlerImpl) Handle(params table.GetTablesParams, principal interface{}) middleware.Responder { +func (h *GetTablesHandlerImpl) Handle(params table.GetTablesParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -190,7 +190,7 @@ func (h *GetTablesHandlerImpl) Handle(params table.GetTablesParams, principal in } // Handle executing the request and returning a response -func (h *ReplaceTableHandlerImpl) Handle(params table.ReplaceTableParams, principal interface{}) middleware.Responder { +func (h *ReplaceTableHandlerImpl) Handle(params table.ReplaceTableParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/tcp_check.go b/handlers/tcp_check.go index c881f050..903f3ffb 100644 --- a/handlers/tcp_check.go +++ b/handlers/tcp_check.go @@ -61,7 +61,7 @@ type ReplaceAllTCPCheckHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.CreateTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *CreateTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.CreateTCPCheckBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -110,7 +110,7 @@ func (h *CreateTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, } // Handle executing the request and returning a response -func (h *DeleteTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.DeleteTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.DeleteTCPCheckBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -159,7 +159,7 @@ func (h *DeleteTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, } // Handle executing the request and returning a response -func (h *GetTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.GetTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *GetTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.GetTCPCheckBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -181,7 +181,7 @@ func (h *GetTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, par } // Handle executing the request and returning a response -func (h *GetAllTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.GetAllTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.GetAllTCPCheckBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -206,7 +206,7 @@ func (h *GetAllTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, } // Handle executing the request and returning a response -func (h *ReplaceTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.ReplaceTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.ReplaceTCPCheckBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -255,7 +255,7 @@ func (h *ReplaceTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, } // Handle executing the request and returning a response -func (h *ReplaceAllTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.ReplaceAllTCPCheckBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllTCPCheckHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_check.ReplaceAllTCPCheckBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/tcp_request_rule.go b/handlers/tcp_request_rule.go index 5222a8a5..856e0337 100644 --- a/handlers/tcp_request_rule.go +++ b/handlers/tcp_request_rule.go @@ -61,7 +61,7 @@ type ReplaceAllTCPRequestRuleHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.CreateTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *CreateTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.CreateTCPRequestRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -108,7 +108,7 @@ func (h *CreateTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParent } // Handle executing the request and returning a response -func (h *DeleteTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.DeleteTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.DeleteTCPRequestRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -156,7 +156,7 @@ func (h *DeleteTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParent } // Handle executing the request and returning a response -func (h *GetTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.GetTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.GetTCPRequestRuleBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -177,7 +177,7 @@ func (h *GetTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentTyp } // Handle executing the request and returning a response -func (h *GetAllTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.GetAllTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.GetAllTCPRequestRuleBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -201,7 +201,7 @@ func (h *GetAllTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParent } // Handle executing the request and returning a response -func (h *ReplaceTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.ReplaceTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.ReplaceTCPRequestRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -249,7 +249,7 @@ func (h *ReplaceTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParen } // Handle executing the request and returning a response -func (h *ReplaceAllTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.ReplaceAllTCPRequestRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllTCPRequestRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_request_rule.ReplaceAllTCPRequestRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/tcp_response_rule.go b/handlers/tcp_response_rule.go index ce058634..54bcf94e 100644 --- a/handlers/tcp_response_rule.go +++ b/handlers/tcp_response_rule.go @@ -61,7 +61,7 @@ type ReplaceAllTCPResponseRuleHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.CreateTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *CreateTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.CreateTCPResponseRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -109,7 +109,7 @@ func (h *CreateTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParen } // Handle executing the request and returning a response -func (h *DeleteTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.DeleteTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *DeleteTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.DeleteTCPResponseRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -156,7 +156,7 @@ func (h *DeleteTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParen } // Handle executing the request and returning a response -func (h *GetTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.GetTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.GetTCPResponseRuleBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -176,7 +176,7 @@ func (h *GetTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentTy } // Handle executing the request and returning a response -func (h *GetAllTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.GetAllTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *GetAllTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.GetAllTCPResponseRuleBackendParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -200,7 +200,7 @@ func (h *GetAllTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParen } // Handle executing the request and returning a response -func (h *ReplaceTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.ReplaceTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.ReplaceTCPResponseRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -247,7 +247,7 @@ func (h *ReplaceTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnPare return tcp_response_rule.NewReplaceTCPResponseRuleBackendAccepted().WithPayload(params.Data) } -func (h *ReplaceAllTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.ReplaceAllTCPResponseRuleBackendParams, principal interface{}) middleware.Responder { +func (h *ReplaceAllTCPResponseRuleHandlerImpl) Handle(parentType cnconstants.CnParentType, params tcp_response_rule.ReplaceAllTCPResponseRuleBackendParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/transaction.go b/handlers/transaction.go index 7c3cc693..97d552cc 100644 --- a/handlers/transaction.go +++ b/handlers/transaction.go @@ -64,7 +64,7 @@ type CommitTransactionHandlerImpl struct { } // Handle executing the request and returning a response -func (h *StartTransactionHandlerImpl) Handle(params transactions.StartTransactionParams, principal interface{}) middleware.Responder { +func (h *StartTransactionHandlerImpl) Handle(params transactions.StartTransactionParams, principal any) middleware.Responder { configuration, err := h.Client.Configuration() if err != nil { e := misc.HandleError(err) @@ -79,7 +79,7 @@ func (h *StartTransactionHandlerImpl) Handle(params transactions.StartTransactio } // Handle executing the request and returning a response -func (h *DeleteTransactionHandlerImpl) Handle(params transactions.DeleteTransactionParams, principal interface{}) middleware.Responder { +func (h *DeleteTransactionHandlerImpl) Handle(params transactions.DeleteTransactionParams, principal any) middleware.Responder { configuration, err := h.Client.Configuration() if err != nil { e := misc.HandleError(err) @@ -89,7 +89,7 @@ func (h *DeleteTransactionHandlerImpl) Handle(params transactions.DeleteTransact if err != nil { e := misc.HandleError(err) if strings.HasSuffix(*e.Message, "does not exist") { - e.Code = misc.Int64P(404) + e.Code = new(int64(404)) return transactions.NewDeleteTransactionNotFound().WithPayload(e) } return transactions.NewDeleteTransactionDefault(int(*e.Code)).WithPayload(e) @@ -98,7 +98,7 @@ func (h *DeleteTransactionHandlerImpl) Handle(params transactions.DeleteTransact } // Handle executing the request and returning a response -func (h *GetTransactionHandlerImpl) Handle(params transactions.GetTransactionParams, principal interface{}) middleware.Responder { +func (h *GetTransactionHandlerImpl) Handle(params transactions.GetTransactionParams, principal any) middleware.Responder { configuration, err := h.Client.Configuration() if err != nil { e := misc.HandleError(err) @@ -108,7 +108,7 @@ func (h *GetTransactionHandlerImpl) Handle(params transactions.GetTransactionPar if err != nil { e := misc.HandleError(err) if strings.HasSuffix(*e.Message, "does not exist") { - e.Code = misc.Int64P(404) + e.Code = new(int64(404)) return transactions.NewDeleteTransactionNotFound().WithPayload(e) } return transactions.NewGetTransactionsDefault(int(*e.Code)).WithPayload(e) @@ -117,7 +117,7 @@ func (h *GetTransactionHandlerImpl) Handle(params transactions.GetTransactionPar } // Handle executing the request and returning a response -func (h *GetTransactionsHandlerImpl) Handle(params transactions.GetTransactionsParams, principal interface{}) middleware.Responder { +func (h *GetTransactionsHandlerImpl) Handle(params transactions.GetTransactionsParams, principal any) middleware.Responder { s := "" if params.Status != nil { s = *params.Status @@ -138,7 +138,7 @@ func (h *GetTransactionsHandlerImpl) Handle(params transactions.GetTransactionsP } // Handle executing the request and returning a response -func (h *CommitTransactionHandlerImpl) Handle(params transactions.CommitTransactionParams, principal interface{}) middleware.Responder { +func (h *CommitTransactionHandlerImpl) Handle(params transactions.CommitTransactionParams, principal any) middleware.Responder { h.Mutex.Lock() defer h.Mutex.Unlock() @@ -155,7 +155,7 @@ func (h *CommitTransactionHandlerImpl) Handle(params transactions.CommitTransact if transaction, err = configuration.GetTransaction(params.ID); err != nil { e := misc.HandleError(err) if strings.HasSuffix(*e.Message, "does not exist") { - e.Code = misc.Int64P(404) + e.Code = new(int64(404)) return transactions.NewDeleteTransactionNotFound().WithPayload(e) } return transactions.NewCommitTransactionDefault(int(*e.Code)).WithPayload(e) @@ -172,7 +172,7 @@ func (h *CommitTransactionHandlerImpl) Handle(params transactions.CommitTransact if err != nil { e := misc.HandleError(err) if strings.HasSuffix(*e.Message, "does not exist") { - e.Code = misc.Int64P(404) + e.Code = new(int64(404)) return transactions.NewDeleteTransactionNotFound().WithPayload(e) } return transactions.NewCommitTransactionDefault(int(*e.Code)).WithPayload(e) @@ -222,7 +222,7 @@ func (h *CommitTransactionHandlerImpl) Handle(params transactions.CommitTransact } // Handle executes the decorated Handler and, in case of successful creation, increase the counter if this is -func (r RateLimitedStartTransactionHandlerImpl) Handle(params transactions.StartTransactionParams, principal interface{}) middleware.Responder { +func (r RateLimitedStartTransactionHandlerImpl) Handle(params transactions.StartTransactionParams, principal any) middleware.Responder { if err := r.TransactionCounter.LimitReached(); err != nil { e := misc.HandleError(err) return transactions.NewStartTransactionDefault(int(*e.Code)).WithPayload(e) diff --git a/handlers/user.go b/handlers/user.go index eba97402..745c025d 100644 --- a/handlers/user.go +++ b/handlers/user.go @@ -54,7 +54,7 @@ type ReplaceUserHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateUserHandlerImpl) Handle(params user.CreateUserParams, principal interface{}) middleware.Responder { +func (h *CreateUserHandlerImpl) Handle(params user.CreateUserParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -105,7 +105,7 @@ func (h *CreateUserHandlerImpl) Handle(params user.CreateUserParams, principal i } // Handle executing the request and returning a response -func (h *DeleteUserHandlerImpl) Handle(params user.DeleteUserParams, principal interface{}) middleware.Responder { +func (h *DeleteUserHandlerImpl) Handle(params user.DeleteUserParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -167,7 +167,7 @@ func (h *DeleteUserHandlerImpl) Handle(params user.DeleteUserParams, principal i } // Handle executing the request and returning a response -func (h *GetUserHandlerImpl) Handle(params user.GetUserParams, principal interface{}) middleware.Responder { +func (h *GetUserHandlerImpl) Handle(params user.GetUserParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -199,7 +199,7 @@ func (h *GetUserHandlerImpl) Handle(params user.GetUserParams, principal interfa } // Handle executing the request and returning a response -func (h *GetUsersHandlerImpl) Handle(params user.GetUsersParams, principal interface{}) middleware.Responder { +func (h *GetUsersHandlerImpl) Handle(params user.GetUsersParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -228,7 +228,7 @@ func (h *GetUsersHandlerImpl) Handle(params user.GetUsersParams, principal inter } // Handle executing the request and returning a response -func (h *ReplaceUserHandlerImpl) Handle(params user.ReplaceUserParams, principal interface{}) middleware.Responder { +func (h *ReplaceUserHandlerImpl) Handle(params user.ReplaceUserParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { diff --git a/handlers/userlist.go b/handlers/userlist.go index bade1fe7..eb6cf15c 100644 --- a/handlers/userlist.go +++ b/handlers/userlist.go @@ -48,7 +48,7 @@ type GetUserListsHandlerImpl struct { } // Handle executing the request and returning a response -func (h *CreateUserListHandlerImpl) Handle(params userlist.CreateUserlistParams, principal interface{}) middleware.Responder { +func (h *CreateUserListHandlerImpl) Handle(params userlist.CreateUserlistParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -100,7 +100,7 @@ func (h *CreateUserListHandlerImpl) createUserList(params userlist.CreateUserlis } // Handle executing the request and returning a response -func (h *DeleteUserListHandlerImpl) Handle(params userlist.DeleteUserlistParams, principal interface{}) middleware.Responder { +func (h *DeleteUserListHandlerImpl) Handle(params userlist.DeleteUserlistParams, principal any) middleware.Responder { t := "" v := int64(0) if params.TransactionID != nil { @@ -147,7 +147,7 @@ func (h *DeleteUserListHandlerImpl) Handle(params userlist.DeleteUserlistParams, } // Handle executing the request and returning a response -func (h *GetUserListHandlerImpl) Handle(params userlist.GetUserlistParams, principal interface{}) middleware.Responder { +func (h *GetUserListHandlerImpl) Handle(params userlist.GetUserlistParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID @@ -173,7 +173,7 @@ func (h *GetUserListHandlerImpl) getUserList(params userlist.GetUserlistParams, } // Handle executing the request and returning a response -func (h *GetUserListsHandlerImpl) Handle(params userlist.GetUserlistsParams, principal interface{}) middleware.Responder { +func (h *GetUserListsHandlerImpl) Handle(params userlist.GetUserlistsParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID diff --git a/handlers/version.go b/handlers/version.go index ba3ab110..2726d612 100644 --- a/handlers/version.go +++ b/handlers/version.go @@ -29,7 +29,7 @@ type ConfigurationGetConfigurationVersionHandlerImpl struct { } // Handle executing the request and returning a response -func (h *ConfigurationGetConfigurationVersionHandlerImpl) Handle(params configuration.GetConfigurationVersionParams, principal interface{}) middleware.Responder { +func (h *ConfigurationGetConfigurationVersionHandlerImpl) Handle(params configuration.GetConfigurationVersionParams, principal any) middleware.Responder { t := "" if params.TransactionID != nil { t = *params.TransactionID diff --git a/haproxy/reload_agent.go b/haproxy/reload_agent.go index 19a3ac54..7408339f 100644 --- a/haproxy/reload_agent.go +++ b/haproxy/reload_agent.go @@ -151,7 +151,7 @@ func (ra *ReloadAgent) setLkgPath(configFile, path string) error { } func (ra *ReloadAgent) handleReload(id string) (string, error) { - logFields := map[string]interface{}{logFieldReloadID: id} + logFields := map[string]any{logFieldReloadID: id} ra.cache.mu.Lock() ra.cache.current = id @@ -193,7 +193,7 @@ func (ra *ReloadAgent) handleReloads() { } func (ra *ReloadAgent) reloadHAProxy(id string) (string, error) { - logFields := map[string]interface{}{logFieldReloadID: id} + logFields := map[string]any{logFieldReloadID: id} // try the reload log.WithFields(logFields, log.DebugLevel, "Reload started") var output string @@ -259,7 +259,7 @@ func (ra *ReloadAgent) Reload() string { next := ra.cache.getNext() if next == "" { next = ra.cache.newReload() - log.WithFields(map[string]interface{}{logFieldReloadID: next}, log.DebugLevel, "Scheduling a new reload...") + log.WithFields(map[string]any{logFieldReloadID: next}, log.DebugLevel, "Scheduling a new reload...") } return next @@ -288,7 +288,7 @@ func (ra *ReloadAgent) ReloadWithCallback(callback func()) string { next := ra.cache.getNext() if next == "" { next = ra.cache.newReloadWithCallback(callback) - log.WithFields(map[string]interface{}{logFieldReloadID: next}, log.DebugLevel, "Scheduling a new reload...") + log.WithFields(map[string]any{logFieldReloadID: next}, log.DebugLevel, "Scheduling a new reload...") } ra.cache.mu.Lock() ra.cache.callbacks[next] = callback diff --git a/haproxy/reload_agent_test.go b/haproxy/reload_agent_test.go index 9dfd6c42..d3ac7658 100644 --- a/haproxy/reload_agent_test.go +++ b/haproxy/reload_agent_test.go @@ -26,8 +26,8 @@ import ( ) func TestReloadAgentDoesntMissReloads(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - f, err := os.CreateTemp("", "config.cfg") + ctx, cancel := context.WithCancel(t.Context()) + f, err := os.CreateTemp(t.TempDir(), "config.cfg") require.NoError(t, err) assert.NotNil(t, f) t.Cleanup(func() { diff --git a/log/log.go b/log/log.go index c2e14956..695b4ebe 100644 --- a/log/log.go +++ b/log/log.go @@ -190,127 +190,127 @@ func AccessLogger() (*Logger, error) { return accessLogger, nil } -func Log(level logrus.Level, args ...interface{}) { +func Log(level logrus.Level, args ...any) { if appLogger != nil { appLogger.Log(level, args...) } } -func Logf(level logrus.Level, format string, args ...interface{}) { +func Logf(level logrus.Level, format string, args ...any) { if appLogger != nil { appLogger.Logf(level, format, args...) } } -func Print(args ...interface{}) { +func Print(args ...any) { if appLogger != nil { appLogger.Print(args...) } } -func Trace(args ...interface{}) { +func Trace(args ...any) { if appLogger != nil { appLogger.Trace(args...) } } -func Debug(args ...interface{}) { +func Debug(args ...any) { if appLogger != nil { appLogger.Debug(args...) } } -func Info(args ...interface{}) { +func Info(args ...any) { if appLogger != nil { appLogger.Info(args...) } } -func Warning(args ...interface{}) { +func Warning(args ...any) { if appLogger != nil { appLogger.Warning(args...) } } -func Error(args ...interface{}) { +func Error(args ...any) { if appLogger != nil { appLogger.Error(args...) } } -func Panic(args ...interface{}) { +func Panic(args ...any) { if appLogger != nil { appLogger.Panic(args...) } } -func Fatal(args ...interface{}) { +func Fatal(args ...any) { if appLogger != nil { appLogger.Panic(args...) } } -func Printf(format string, args ...interface{}) { +func Printf(format string, args ...any) { if appLogger != nil { appLogger.Printf(format, args...) } } -func Tracef(format string, args ...interface{}) { +func Tracef(format string, args ...any) { if appLogger != nil { appLogger.Tracef(format, args...) } } -func Debugf(format string, args ...interface{}) { +func Debugf(format string, args ...any) { if appLogger != nil { appLogger.Debugf(format, args...) } } -func Infof(format string, args ...interface{}) { +func Infof(format string, args ...any) { if appLogger != nil { appLogger.Infof(format, args...) } } -func Warningf(format string, args ...interface{}) { +func Warningf(format string, args ...any) { if appLogger != nil { appLogger.Warningf(format, args...) } } -func Errorf(format string, args ...interface{}) { +func Errorf(format string, args ...any) { if appLogger != nil { appLogger.Errorf(format, args...) } } -func Panicf(format string, args ...interface{}) { +func Panicf(format string, args ...any) { if appLogger != nil { appLogger.Panicf(format, args...) } } -func Fatalf(format string, args ...interface{}) { +func Fatalf(format string, args ...any) { if appLogger != nil { appLogger.Fatalf(format, args...) } } -func Fatalln(format string, args ...interface{}) { //nolint:goprintffuncname +func Fatalln(format string, args ...any) { //nolint:goprintffuncname if appLogger != nil { appLogger.Fatalln(args...) } } -func WithFields(fields map[string]interface{}, level logrus.Level, args ...interface{}) { +func WithFields(fields map[string]any, level logrus.Level, args ...any) { if appLogger != nil { appLogger.WithFields(fields, level, args...) } } -func WithFieldsf(fields map[string]interface{}, level logrus.Level, format string, args ...interface{}) { +func WithFieldsf(fields map[string]any, level logrus.Level, format string, args ...any) { if appLogger != nil { appLogger.WithFieldsf(fields, level, format, args...) } diff --git a/log/logger.go b/log/logger.go index ca5b8e57..5d50c661 100644 --- a/log/logger.go +++ b/log/logger.go @@ -13,133 +13,134 @@ type Logger struct { type ACLLogger struct { *logrus.Logger + ApacheLog *apache_log.ApacheLog } -func (l *Logger) Log(level logrus.Level, args ...interface{}) { +func (l *Logger) Log(level logrus.Level, args ...any) { for _, log := range l.loggers { go log.Log(level, args...) } } -func (l *Logger) Logf(level logrus.Level, format string, args ...interface{}) { +func (l *Logger) Logf(level logrus.Level, format string, args ...any) { for _, log := range l.loggers { go log.Logf(level, format, args...) } } -func (l *Logger) Print(args ...interface{}) { +func (l *Logger) Print(args ...any) { for _, log := range l.loggers { go log.Print(args...) } } -func (l *Logger) Trace(args ...interface{}) { +func (l *Logger) Trace(args ...any) { for _, log := range l.loggers { go log.Trace(args...) } } -func (l *Logger) Debug(args ...interface{}) { +func (l *Logger) Debug(args ...any) { for _, log := range l.loggers { go log.Debug(args...) } } -func (l *Logger) Info(args ...interface{}) { +func (l *Logger) Info(args ...any) { for _, log := range l.loggers { go log.Info(args...) } } -func (l *Logger) Warning(args ...interface{}) { +func (l *Logger) Warning(args ...any) { for _, log := range l.loggers { go log.Warning(args...) } } -func (l *Logger) Error(args ...interface{}) { +func (l *Logger) Error(args ...any) { for _, log := range l.loggers { go log.Error(args...) } } -func (l *Logger) Panic(args ...interface{}) { +func (l *Logger) Panic(args ...any) { for _, log := range l.loggers { go log.Panic(args...) } } -func (l *Logger) Printf(format string, args ...interface{}) { +func (l *Logger) Printf(format string, args ...any) { for _, log := range l.loggers { go log.Printf(format, args...) } } -func (l *Logger) Tracef(format string, args ...interface{}) { +func (l *Logger) Tracef(format string, args ...any) { for _, log := range l.loggers { go log.Tracef(format, args...) } } -func (l *Logger) Debugf(format string, args ...interface{}) { +func (l *Logger) Debugf(format string, args ...any) { for _, log := range l.loggers { go log.Debugf(format, args...) } } -func (l *Logger) Infof(format string, args ...interface{}) { +func (l *Logger) Infof(format string, args ...any) { for _, log := range l.loggers { go log.Infof(format, args...) } } -func (l *Logger) Warningf(format string, args ...interface{}) { +func (l *Logger) Warningf(format string, args ...any) { for _, log := range l.loggers { go log.Warningf(format, args...) } } -func (l *Logger) Errorf(format string, args ...interface{}) { +func (l *Logger) Errorf(format string, args ...any) { for _, log := range l.loggers { go log.Errorf(format, args...) } } -func (l *Logger) Panicf(format string, args ...interface{}) { +func (l *Logger) Panicf(format string, args ...any) { for _, log := range l.loggers { go log.Panicf(format, args...) } } -func (l *Logger) Fatalln(args ...interface{}) { +func (l *Logger) Fatalln(args ...any) { for _, log := range l.loggers { log.Logln(logrus.FatalLevel, args...) } os.Exit(1) } -func (l *Logger) Fatal(args ...interface{}) { +func (l *Logger) Fatal(args ...any) { for _, log := range l.loggers { log.Log(logrus.FatalLevel, args...) } os.Exit(1) } -func (l *Logger) Fatalf(format string, args ...interface{}) { +func (l *Logger) Fatalf(format string, args ...any) { for _, log := range l.loggers { log.Logf(logrus.FatalLevel, format, args...) } os.Exit(1) } -func (l *Logger) WithFieldsf(fields map[string]interface{}, level logrus.Level, format string, args ...interface{}) { +func (l *Logger) WithFieldsf(fields map[string]any, level logrus.Level, format string, args ...any) { for _, log := range l.loggers { go log.WithFields(fields).Logf(level, format, args...) } } -func (l *Logger) WithFields(fields map[string]interface{}, level logrus.Level, args ...interface{}) { +func (l *Logger) WithFields(fields map[string]any, level logrus.Level, args ...any) { for _, log := range l.loggers { go log.WithFields(fields).Log(level, args...) } diff --git a/log/rfc5424.go b/log/rfc5424.go index 906009ab..b29ba17b 100644 --- a/log/rfc5424.go +++ b/log/rfc5424.go @@ -73,7 +73,7 @@ func (r RFC5424Hook) Fire(entry *logrus.Entry) (err error) { r.cb.Success() } - return + return err } func NewRFC5424Hook(opts Target) (logrus.Hook, error) { diff --git a/misc/misc.go b/misc/misc.go index 2b23db0b..fa09b639 100644 --- a/misc/misc.go +++ b/misc/misc.go @@ -117,17 +117,17 @@ func HandleContainerGetError(err error) *models.Error { // DiscoverChildPaths return children models.Endpoints given path func DiscoverChildPaths(path string, spec json.RawMessage) (models.Endpoints, error) { - var m map[string]interface{} + var m map[string]any json := jsoniter.ConfigCompatibleWithStandardLibrary err := json.Unmarshal(spec, &m) if err != nil { return nil, err } es := make(models.Endpoints, 0, 1) - paths := m["paths"].(map[string]interface{}) + paths := m["paths"].(map[string]any) for key, value := range paths { - v := value.(map[string]interface{}) - if g, ok := v["get"].(map[string]interface{}); ok { + v := value.(map[string]any) + if g, ok := v["get"].(map[string]any); ok { title := "" if titleInterface, ok := g["summary"]; ok && titleInterface != nil { title = titleInterface.(string) @@ -223,24 +223,11 @@ func GetHTTPStatusFromErr(err error) int { func SetError(code int, msg string) *models.Error { return &models.Error{ - Code: Int64P(code), - Message: StringP(msg), + Code: new(int64(code)), + Message: new(msg), } } -func StringP(s string) *string { - return &s -} - -func Int64P(i int) *int64 { - i64 := int64(i) - return &i64 -} - -func PtrTo[T any](v T) *T { - return &v -} - // extractEnvVar extracts and returns env variable from HAProxy variable // provided in "${SOME_VAR}" format func ExtractEnvVar(pass string) string { diff --git a/operations/acl/create_acl_backend_parameters.go b/operations/acl/create_acl_backend_parameters.go index 4cc2c5db..bc9984e0 100644 --- a/operations/acl/create_acl_backend_parameters.go +++ b/operations/acl/create_acl_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateACLBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateACLBackendParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateACLBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/create_acl_fcgi_app_parameters.go b/operations/acl/create_acl_fcgi_app_parameters.go index b4dc7d85..4e3c9ca1 100644 --- a/operations/acl/create_acl_fcgi_app_parameters.go +++ b/operations/acl/create_acl_fcgi_app_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateACLFCGIAppParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateACLFCGIAppParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateACLFCGIAppParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/create_acl_frontend_parameters.go b/operations/acl/create_acl_frontend_parameters.go index aad64edf..92d8ac3a 100644 --- a/operations/acl/create_acl_frontend_parameters.go +++ b/operations/acl/create_acl_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateACLFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateACLFrontendParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateACLFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/delete_acl_backend_parameters.go b/operations/acl/delete_acl_backend_parameters.go index 0227d37b..6691ab8d 100644 --- a/operations/acl/delete_acl_backend_parameters.go +++ b/operations/acl/delete_acl_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteACLBackendParams creates a new DeleteACLBackendParams object @@ -66,6 +67,7 @@ type DeleteACLBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteACLBackendParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteACLBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/delete_acl_fcgi_app_parameters.go b/operations/acl/delete_acl_fcgi_app_parameters.go index 41120243..484f14d5 100644 --- a/operations/acl/delete_acl_fcgi_app_parameters.go +++ b/operations/acl/delete_acl_fcgi_app_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteACLFCGIAppParams creates a new DeleteACLFCGIAppParams object @@ -66,6 +67,7 @@ type DeleteACLFCGIAppParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteACLFCGIAppParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteACLFCGIAppParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/delete_acl_frontend_parameters.go b/operations/acl/delete_acl_frontend_parameters.go index f05ad3d2..b20e19aa 100644 --- a/operations/acl/delete_acl_frontend_parameters.go +++ b/operations/acl/delete_acl_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteACLFrontendParams creates a new DeleteACLFrontendParams object @@ -66,6 +67,7 @@ type DeleteACLFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteACLFrontendParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteACLFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/get_acl_backend_parameters.go b/operations/acl/get_acl_backend_parameters.go index 34ac388e..3c19dec6 100644 --- a/operations/acl/get_acl_backend_parameters.go +++ b/operations/acl/get_acl_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetACLBackendParams creates a new GetACLBackendParams object @@ -54,6 +55,7 @@ type GetACLBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetACLBackendParams) bindParentName(rawData []string, hasKey bool, form // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetACLBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/get_acl_fcgi_app_parameters.go b/operations/acl/get_acl_fcgi_app_parameters.go index ce5ab160..9db4cb9e 100644 --- a/operations/acl/get_acl_fcgi_app_parameters.go +++ b/operations/acl/get_acl_fcgi_app_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetACLFCGIAppParams creates a new GetACLFCGIAppParams object @@ -54,6 +55,7 @@ type GetACLFCGIAppParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetACLFCGIAppParams) bindParentName(rawData []string, hasKey bool, form // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetACLFCGIAppParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/get_acl_frontend_parameters.go b/operations/acl/get_acl_frontend_parameters.go index 1c850bdd..781b7b0c 100644 --- a/operations/acl/get_acl_frontend_parameters.go +++ b/operations/acl/get_acl_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetACLFrontendParams creates a new GetACLFrontendParams object @@ -54,6 +55,7 @@ type GetACLFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetACLFrontendParams) bindParentName(rawData []string, hasKey bool, for // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetACLFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/get_all_acl_backend_parameters.go b/operations/acl/get_all_acl_backend_parameters.go index afe3db8f..071ef917 100644 --- a/operations/acl/get_all_acl_backend_parameters.go +++ b/operations/acl/get_all_acl_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllACLBackendParams creates a new GetAllACLBackendParams object @@ -52,6 +53,7 @@ type GetAllACLBackendParams struct { ACLName *string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -121,6 +123,20 @@ func (o *GetAllACLBackendParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllACLBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/get_all_acl_fcgi_app_parameters.go b/operations/acl/get_all_acl_fcgi_app_parameters.go index 16e39a18..677b08d8 100644 --- a/operations/acl/get_all_acl_fcgi_app_parameters.go +++ b/operations/acl/get_all_acl_fcgi_app_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllACLFCGIAppParams creates a new GetAllACLFCGIAppParams object @@ -52,6 +53,7 @@ type GetAllACLFCGIAppParams struct { ACLName *string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -121,6 +123,20 @@ func (o *GetAllACLFCGIAppParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllACLFCGIAppParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/get_all_acl_frontend_parameters.go b/operations/acl/get_all_acl_frontend_parameters.go index d3f51e84..3e89c440 100644 --- a/operations/acl/get_all_acl_frontend_parameters.go +++ b/operations/acl/get_all_acl_frontend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllACLFrontendParams creates a new GetAllACLFrontendParams object @@ -52,6 +53,7 @@ type GetAllACLFrontendParams struct { ACLName *string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -121,6 +123,20 @@ func (o *GetAllACLFrontendParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllACLFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/replace_acl_backend_parameters.go b/operations/acl/replace_acl_backend_parameters.go index b0c54444..ec1478d9 100644 --- a/operations/acl/replace_acl_backend_parameters.go +++ b/operations/acl/replace_acl_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceACLBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceACLBackendParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceACLBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/replace_acl_fcgi_app_parameters.go b/operations/acl/replace_acl_fcgi_app_parameters.go index b6ad5b8f..7ef73489 100644 --- a/operations/acl/replace_acl_fcgi_app_parameters.go +++ b/operations/acl/replace_acl_fcgi_app_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceACLFCGIAppParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceACLFCGIAppParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceACLFCGIAppParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/replace_acl_frontend_parameters.go b/operations/acl/replace_acl_frontend_parameters.go index e98e70a4..6124fa81 100644 --- a/operations/acl/replace_acl_frontend_parameters.go +++ b/operations/acl/replace_acl_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceACLFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceACLFrontendParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceACLFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/replace_all_acl_backend_parameters.go b/operations/acl/replace_all_acl_backend_parameters.go index 4a34a42a..56a4018f 100644 --- a/operations/acl/replace_all_acl_backend_parameters.go +++ b/operations/acl/replace_all_acl_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllACLBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllACLBackendParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllACLBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/replace_all_acl_fcgi_app_parameters.go b/operations/acl/replace_all_acl_fcgi_app_parameters.go index c3b0d8d8..3fb88d12 100644 --- a/operations/acl/replace_all_acl_fcgi_app_parameters.go +++ b/operations/acl/replace_all_acl_fcgi_app_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllACLFCGIAppParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllACLFCGIAppParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllACLFCGIAppParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl/replace_all_acl_frontend_parameters.go b/operations/acl/replace_all_acl_frontend_parameters.go index 6bfd0e8c..2bb9aba5 100644 --- a/operations/acl/replace_all_acl_frontend_parameters.go +++ b/operations/acl/replace_all_acl_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllACLFrontendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllACLFrontendParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllACLFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl_runtime/add_payload_runtime_acl_parameters.go b/operations/acl_runtime/add_payload_runtime_acl_parameters.go index c6db445d..f7870474 100644 --- a/operations/acl_runtime/add_payload_runtime_acl_parameters.go +++ b/operations/acl_runtime/add_payload_runtime_acl_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -56,6 +57,7 @@ type AddPayloadRuntimeACLParams struct { Data models.ACLFilesEntries /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -114,5 +116,19 @@ func (o *AddPayloadRuntimeACLParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *AddPayloadRuntimeACLParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl_runtime/delete_services_haproxy_runtime_acls_parent_name_entries_id_parameters.go b/operations/acl_runtime/delete_services_haproxy_runtime_acls_parent_name_entries_id_parameters.go index b621688c..063ae270 100644 --- a/operations/acl_runtime/delete_services_haproxy_runtime_acls_parent_name_entries_id_parameters.go +++ b/operations/acl_runtime/delete_services_haproxy_runtime_acls_parent_name_entries_id_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewDeleteServicesHaproxyRuntimeAclsParentNameEntriesIDParams creates a new DeleteServicesHaproxyRuntimeAclsParentNameEntriesIDParams object @@ -47,11 +48,13 @@ type DeleteServicesHaproxyRuntimeAclsParentNameEntriesIDParams struct { /*File entry ID Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ID string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -92,6 +95,20 @@ func (o *DeleteServicesHaproxyRuntimeAclsParentNameEntriesIDParams) bindID(rawDa // Parameter is provided by construction from the route o.ID = raw + if err := o.validateID(formats); err != nil { + return err + } + + return nil +} + +// validateID carries on validations for parameter ID +func (o *DeleteServicesHaproxyRuntimeAclsParentNameEntriesIDParams) validateID(formats strfmt.Registry) error { + + if err := validate.Pattern("id", "path", o.ID, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } @@ -106,5 +123,19 @@ func (o *DeleteServicesHaproxyRuntimeAclsParentNameEntriesIDParams) bindParentNa // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteServicesHaproxyRuntimeAclsParentNameEntriesIDParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl_runtime/get_services_haproxy_runtime_acls_id_parameters.go b/operations/acl_runtime/get_services_haproxy_runtime_acls_id_parameters.go index e9dfc131..a4bccfea 100644 --- a/operations/acl_runtime/get_services_haproxy_runtime_acls_id_parameters.go +++ b/operations/acl_runtime/get_services_haproxy_runtime_acls_id_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetServicesHaproxyRuntimeAclsIDParams creates a new GetServicesHaproxyRuntimeAclsIDParams object @@ -47,6 +48,7 @@ type GetServicesHaproxyRuntimeAclsIDParams struct { /*ACL file entry ID Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ID string @@ -82,5 +84,19 @@ func (o *GetServicesHaproxyRuntimeAclsIDParams) bindID(rawData []string, hasKey // Parameter is provided by construction from the route o.ID = raw + if err := o.validateID(formats); err != nil { + return err + } + + return nil +} + +// validateID carries on validations for parameter ID +func (o *GetServicesHaproxyRuntimeAclsIDParams) validateID(formats strfmt.Registry) error { + + if err := validate.Pattern("id", "path", o.ID, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl_runtime/get_services_haproxy_runtime_acls_parent_name_entries_id_parameters.go b/operations/acl_runtime/get_services_haproxy_runtime_acls_parent_name_entries_id_parameters.go index d8e86e8e..9b861bb8 100644 --- a/operations/acl_runtime/get_services_haproxy_runtime_acls_parent_name_entries_id_parameters.go +++ b/operations/acl_runtime/get_services_haproxy_runtime_acls_parent_name_entries_id_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetServicesHaproxyRuntimeAclsParentNameEntriesIDParams creates a new GetServicesHaproxyRuntimeAclsParentNameEntriesIDParams object @@ -47,11 +48,13 @@ type GetServicesHaproxyRuntimeAclsParentNameEntriesIDParams struct { /*File entry ID Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ID string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -92,6 +95,20 @@ func (o *GetServicesHaproxyRuntimeAclsParentNameEntriesIDParams) bindID(rawData // Parameter is provided by construction from the route o.ID = raw + if err := o.validateID(formats); err != nil { + return err + } + + return nil +} + +// validateID carries on validations for parameter ID +func (o *GetServicesHaproxyRuntimeAclsParentNameEntriesIDParams) validateID(formats strfmt.Registry) error { + + if err := validate.Pattern("id", "path", o.ID, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } @@ -106,5 +123,19 @@ func (o *GetServicesHaproxyRuntimeAclsParentNameEntriesIDParams) bindParentName( // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetServicesHaproxyRuntimeAclsParentNameEntriesIDParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl_runtime/get_services_haproxy_runtime_acls_parent_name_entries_parameters.go b/operations/acl_runtime/get_services_haproxy_runtime_acls_parent_name_entries_parameters.go index db8ee71b..2fd221be 100644 --- a/operations/acl_runtime/get_services_haproxy_runtime_acls_parent_name_entries_parameters.go +++ b/operations/acl_runtime/get_services_haproxy_runtime_acls_parent_name_entries_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetServicesHaproxyRuntimeAclsParentNameEntriesParams creates a new GetServicesHaproxyRuntimeAclsParentNameEntriesParams object @@ -47,6 +48,7 @@ type GetServicesHaproxyRuntimeAclsParentNameEntriesParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -82,5 +84,19 @@ func (o *GetServicesHaproxyRuntimeAclsParentNameEntriesParams) bindParentName(ra // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetServicesHaproxyRuntimeAclsParentNameEntriesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/acl_runtime/post_services_haproxy_runtime_acls_parent_name_entries_parameters.go b/operations/acl_runtime/post_services_haproxy_runtime_acls_parent_name_entries_parameters.go index ec3501af..015d5a9f 100644 --- a/operations/acl_runtime/post_services_haproxy_runtime_acls_parent_name_entries_parameters.go +++ b/operations/acl_runtime/post_services_haproxy_runtime_acls_parent_name_entries_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -56,6 +57,7 @@ type PostServicesHaproxyRuntimeAclsParentNameEntriesParams struct { Data *models.ACLFileEntry /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -114,5 +116,19 @@ func (o *PostServicesHaproxyRuntimeAclsParentNameEntriesParams) bindParentName(r // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *PostServicesHaproxyRuntimeAclsParentNameEntriesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/backend_switching_rule/create_backend_switching_rule_parameters.go b/operations/backend_switching_rule/create_backend_switching_rule_parameters.go index 4c1370e7..7f1ce97f 100644 --- a/operations/backend_switching_rule/create_backend_switching_rule_parameters.go +++ b/operations/backend_switching_rule/create_backend_switching_rule_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateBackendSwitchingRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateBackendSwitchingRuleParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateBackendSwitchingRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/backend_switching_rule/delete_backend_switching_rule_parameters.go b/operations/backend_switching_rule/delete_backend_switching_rule_parameters.go index 73c9dd82..9fc20cc5 100644 --- a/operations/backend_switching_rule/delete_backend_switching_rule_parameters.go +++ b/operations/backend_switching_rule/delete_backend_switching_rule_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteBackendSwitchingRuleParams creates a new DeleteBackendSwitchingRuleParams object @@ -66,6 +67,7 @@ type DeleteBackendSwitchingRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteBackendSwitchingRuleParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteBackendSwitchingRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/backend_switching_rule/get_backend_switching_rule_parameters.go b/operations/backend_switching_rule/get_backend_switching_rule_parameters.go index d8b2f113..225f93a7 100644 --- a/operations/backend_switching_rule/get_backend_switching_rule_parameters.go +++ b/operations/backend_switching_rule/get_backend_switching_rule_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetBackendSwitchingRuleParams creates a new GetBackendSwitchingRuleParams object @@ -54,6 +55,7 @@ type GetBackendSwitchingRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetBackendSwitchingRuleParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetBackendSwitchingRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/backend_switching_rule/get_backend_switching_rules_parameters.go b/operations/backend_switching_rule/get_backend_switching_rules_parameters.go index a5a4c8ec..2a80982d 100644 --- a/operations/backend_switching_rule/get_backend_switching_rules_parameters.go +++ b/operations/backend_switching_rule/get_backend_switching_rules_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetBackendSwitchingRulesParams creates a new GetBackendSwitchingRulesParams object @@ -48,6 +49,7 @@ type GetBackendSwitchingRulesParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetBackendSwitchingRulesParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetBackendSwitchingRulesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/backend_switching_rule/replace_backend_switching_rule_parameters.go b/operations/backend_switching_rule/replace_backend_switching_rule_parameters.go index 6b471636..37ce9176 100644 --- a/operations/backend_switching_rule/replace_backend_switching_rule_parameters.go +++ b/operations/backend_switching_rule/replace_backend_switching_rule_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceBackendSwitchingRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceBackendSwitchingRuleParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceBackendSwitchingRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/backend_switching_rule/replace_backend_switching_rules_parameters.go b/operations/backend_switching_rule/replace_backend_switching_rules_parameters.go index 9904b2f2..9a9de535 100644 --- a/operations/backend_switching_rule/replace_backend_switching_rules_parameters.go +++ b/operations/backend_switching_rule/replace_backend_switching_rules_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceBackendSwitchingRulesParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceBackendSwitchingRulesParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceBackendSwitchingRulesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/create_bind_frontend_parameters.go b/operations/bind/create_bind_frontend_parameters.go index c4859589..2950d706 100644 --- a/operations/bind/create_bind_frontend_parameters.go +++ b/operations/bind/create_bind_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type CreateBindFrontendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *CreateBindFrontendParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateBindFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/create_bind_log_forward_parameters.go b/operations/bind/create_bind_log_forward_parameters.go index 17e1ee63..a31f5a17 100644 --- a/operations/bind/create_bind_log_forward_parameters.go +++ b/operations/bind/create_bind_log_forward_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type CreateBindLogForwardParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *CreateBindLogForwardParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateBindLogForwardParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/create_bind_peer_parameters.go b/operations/bind/create_bind_peer_parameters.go index 34d1976c..4e2013e2 100644 --- a/operations/bind/create_bind_peer_parameters.go +++ b/operations/bind/create_bind_peer_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type CreateBindPeerParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *CreateBindPeerParams) bindParentName(rawData []string, hasKey bool, for // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateBindPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/delete_bind_frontend_parameters.go b/operations/bind/delete_bind_frontend_parameters.go index d50810b8..fc760fbe 100644 --- a/operations/bind/delete_bind_frontend_parameters.go +++ b/operations/bind/delete_bind_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteBindFrontendParams creates a new DeleteBindFrontendParams object @@ -66,6 +67,7 @@ type DeleteBindFrontendParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -169,6 +171,20 @@ func (o *DeleteBindFrontendParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteBindFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/delete_bind_log_forward_parameters.go b/operations/bind/delete_bind_log_forward_parameters.go index 337ceb87..e36e7bef 100644 --- a/operations/bind/delete_bind_log_forward_parameters.go +++ b/operations/bind/delete_bind_log_forward_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteBindLogForwardParams creates a new DeleteBindLogForwardParams object @@ -66,6 +67,7 @@ type DeleteBindLogForwardParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -169,6 +171,20 @@ func (o *DeleteBindLogForwardParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteBindLogForwardParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/delete_bind_peer_parameters.go b/operations/bind/delete_bind_peer_parameters.go index 9bbfd248..74263b8f 100644 --- a/operations/bind/delete_bind_peer_parameters.go +++ b/operations/bind/delete_bind_peer_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteBindPeerParams creates a new DeleteBindPeerParams object @@ -66,6 +67,7 @@ type DeleteBindPeerParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -169,6 +171,20 @@ func (o *DeleteBindPeerParams) bindParentName(rawData []string, hasKey bool, for // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteBindPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/get_all_bind_frontend_parameters.go b/operations/bind/get_all_bind_frontend_parameters.go index 69fb9cde..e9b6e502 100644 --- a/operations/bind/get_all_bind_frontend_parameters.go +++ b/operations/bind/get_all_bind_frontend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllBindFrontendParams creates a new GetAllBindFrontendParams object @@ -48,6 +49,7 @@ type GetAllBindFrontendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllBindFrontendParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllBindFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/get_all_bind_log_forward_parameters.go b/operations/bind/get_all_bind_log_forward_parameters.go index 1559a030..7ed0968c 100644 --- a/operations/bind/get_all_bind_log_forward_parameters.go +++ b/operations/bind/get_all_bind_log_forward_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllBindLogForwardParams creates a new GetAllBindLogForwardParams object @@ -48,6 +49,7 @@ type GetAllBindLogForwardParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllBindLogForwardParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllBindLogForwardParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/get_all_bind_peer_parameters.go b/operations/bind/get_all_bind_peer_parameters.go index 38fedf4a..0e3c4eef 100644 --- a/operations/bind/get_all_bind_peer_parameters.go +++ b/operations/bind/get_all_bind_peer_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllBindPeerParams creates a new GetAllBindPeerParams object @@ -48,6 +49,7 @@ type GetAllBindPeerParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllBindPeerParams) bindParentName(rawData []string, hasKey bool, for // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllBindPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/get_bind_frontend_parameters.go b/operations/bind/get_bind_frontend_parameters.go index d321c349..6c1ce432 100644 --- a/operations/bind/get_bind_frontend_parameters.go +++ b/operations/bind/get_bind_frontend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetBindFrontendParams creates a new GetBindFrontendParams object @@ -53,6 +54,7 @@ type GetBindFrontendParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -118,6 +120,20 @@ func (o *GetBindFrontendParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetBindFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/get_bind_log_forward_parameters.go b/operations/bind/get_bind_log_forward_parameters.go index d3f4e63f..06f5a992 100644 --- a/operations/bind/get_bind_log_forward_parameters.go +++ b/operations/bind/get_bind_log_forward_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetBindLogForwardParams creates a new GetBindLogForwardParams object @@ -53,6 +54,7 @@ type GetBindLogForwardParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -118,6 +120,20 @@ func (o *GetBindLogForwardParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetBindLogForwardParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/get_bind_peer_parameters.go b/operations/bind/get_bind_peer_parameters.go index 11b4d84d..71f32902 100644 --- a/operations/bind/get_bind_peer_parameters.go +++ b/operations/bind/get_bind_peer_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetBindPeerParams creates a new GetBindPeerParams object @@ -53,6 +54,7 @@ type GetBindPeerParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -118,6 +120,20 @@ func (o *GetBindPeerParams) bindParentName(rawData []string, hasKey bool, format // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetBindPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/replace_bind_frontend_parameters.go b/operations/bind/replace_bind_frontend_parameters.go index eae20d28..9fd3fc85 100644 --- a/operations/bind/replace_bind_frontend_parameters.go +++ b/operations/bind/replace_bind_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceBindFrontendParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -200,6 +202,20 @@ func (o *ReplaceBindFrontendParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceBindFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/replace_bind_log_forward_parameters.go b/operations/bind/replace_bind_log_forward_parameters.go index 1b0316bd..6d106acb 100644 --- a/operations/bind/replace_bind_log_forward_parameters.go +++ b/operations/bind/replace_bind_log_forward_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceBindLogForwardParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -200,6 +202,20 @@ func (o *ReplaceBindLogForwardParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceBindLogForwardParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/bind/replace_bind_peer_parameters.go b/operations/bind/replace_bind_peer_parameters.go index 7553bdef..335b82b8 100644 --- a/operations/bind/replace_bind_peer_parameters.go +++ b/operations/bind/replace_bind_peer_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceBindPeerParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -200,6 +202,20 @@ func (o *ReplaceBindPeerParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceBindPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/configuration/get_h_a_proxy_configuration.go b/operations/configuration/get_h_a_proxy_configuration.go index 13e4369f..725e5fa1 100644 --- a/operations/configuration/get_h_a_proxy_configuration.go +++ b/operations/configuration/get_h_a_proxy_configuration.go @@ -21,14 +21,9 @@ package configuration // Editing this file might prove futile when you re-run the generate command import ( - "context" "net/http" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) // GetHAProxyConfigurationHandlerFunc turns a function with the right signature into a get h a proxy configuration handler @@ -89,59 +84,3 @@ func (o *GetHAProxyConfiguration) ServeHTTP(rw http.ResponseWriter, r *http.Requ o.Context.Respond(rw, r, route.Produces, route, res) } - -// GetHAProxyConfigurationOKBody get h a proxy configuration o k body -// -// swagger:model GetHAProxyConfigurationOKBody -type GetHAProxyConfigurationOKBody struct { - - // data - // Required: true - Data *string `json:"data"` -} - -// Validate validates this get h a proxy configuration o k body -func (o *GetHAProxyConfigurationOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateData(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetHAProxyConfigurationOKBody) validateData(formats strfmt.Registry) error { - - if err := validate.Required("getHAProxyConfigurationOK"+"."+"data", "body", o.Data); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this get h a proxy configuration o k body based on context it is used -func (o *GetHAProxyConfigurationOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *GetHAProxyConfigurationOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *GetHAProxyConfigurationOKBody) UnmarshalBinary(b []byte) error { - var res GetHAProxyConfigurationOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/operations/configuration/get_h_a_proxy_configuration_responses.go b/operations/configuration/get_h_a_proxy_configuration_responses.go index 0c115884..afc4fad5 100644 --- a/operations/configuration/get_h_a_proxy_configuration_responses.go +++ b/operations/configuration/get_h_a_proxy_configuration_responses.go @@ -24,8 +24,6 @@ import ( "net/http" "github.com/go-openapi/runtime" - - "github.com/haproxytech/client-native/v6/models" ) // GetHAProxyConfigurationOKCode is the HTTP code returned for type GetHAProxyConfigurationOK @@ -53,7 +51,7 @@ type GetHAProxyConfigurationOK struct { /* In: Body */ - Payload *GetHAProxyConfigurationOKBody `json:"body,omitempty"` + Payload string `json:"body,omitempty"` } // NewGetHAProxyConfigurationOK creates GetHAProxyConfigurationOK with default headers values @@ -96,13 +94,13 @@ func (o *GetHAProxyConfigurationOK) SetConfigurationVersion(configurationVersion } // WithPayload adds the payload to the get h a proxy configuration o k response -func (o *GetHAProxyConfigurationOK) WithPayload(payload *GetHAProxyConfigurationOKBody) *GetHAProxyConfigurationOK { +func (o *GetHAProxyConfigurationOK) WithPayload(payload string) *GetHAProxyConfigurationOK { o.Payload = payload return o } // SetPayload sets the payload to the get h a proxy configuration o k response -func (o *GetHAProxyConfigurationOK) SetPayload(payload *GetHAProxyConfigurationOKBody) { +func (o *GetHAProxyConfigurationOK) SetPayload(payload string) { o.Payload = payload } @@ -131,11 +129,9 @@ func (o *GetHAProxyConfigurationOK) WriteResponse(rw http.ResponseWriter, produc } rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this } } @@ -154,7 +150,7 @@ type GetHAProxyConfigurationDefault struct { /* In: Body */ - Payload *models.Error `json:"body,omitempty"` + Payload string `json:"body,omitempty"` } // NewGetHAProxyConfigurationDefault creates GetHAProxyConfigurationDefault with default headers values @@ -191,13 +187,13 @@ func (o *GetHAProxyConfigurationDefault) SetConfigurationVersion(configurationVe } // WithPayload adds the payload to the get h a proxy configuration default response -func (o *GetHAProxyConfigurationDefault) WithPayload(payload *models.Error) *GetHAProxyConfigurationDefault { +func (o *GetHAProxyConfigurationDefault) WithPayload(payload string) *GetHAProxyConfigurationDefault { o.Payload = payload return o } // SetPayload sets the payload to the get h a proxy configuration default response -func (o *GetHAProxyConfigurationDefault) SetPayload(payload *models.Error) { +func (o *GetHAProxyConfigurationDefault) SetPayload(payload string) { o.Payload = payload } @@ -212,10 +208,8 @@ func (o *GetHAProxyConfigurationDefault) WriteResponse(rw http.ResponseWriter, p } rw.WriteHeader(o._statusCode) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this } } diff --git a/operations/configuration/post_h_a_proxy_configuration_responses.go b/operations/configuration/post_h_a_proxy_configuration_responses.go index a2593d06..8396d193 100644 --- a/operations/configuration/post_h_a_proxy_configuration_responses.go +++ b/operations/configuration/post_h_a_proxy_configuration_responses.go @@ -24,8 +24,6 @@ import ( "net/http" "github.com/go-openapi/runtime" - - "github.com/haproxytech/client-native/v6/models" ) // PostHAProxyConfigurationCreatedCode is the HTTP code returned for type PostHAProxyConfigurationCreated @@ -285,7 +283,7 @@ type PostHAProxyConfigurationBadRequest struct { /* In: Body */ - Payload *models.Error `json:"body,omitempty"` + Payload string `json:"body,omitempty"` } // NewPostHAProxyConfigurationBadRequest creates PostHAProxyConfigurationBadRequest with default headers values @@ -306,13 +304,13 @@ func (o *PostHAProxyConfigurationBadRequest) SetConfigurationVersion(configurati } // WithPayload adds the payload to the post h a proxy configuration bad request response -func (o *PostHAProxyConfigurationBadRequest) WithPayload(payload *models.Error) *PostHAProxyConfigurationBadRequest { +func (o *PostHAProxyConfigurationBadRequest) WithPayload(payload string) *PostHAProxyConfigurationBadRequest { o.Payload = payload return o } // SetPayload sets the payload to the post h a proxy configuration bad request response -func (o *PostHAProxyConfigurationBadRequest) SetPayload(payload *models.Error) { +func (o *PostHAProxyConfigurationBadRequest) SetPayload(payload string) { o.Payload = payload } @@ -327,11 +325,9 @@ func (o *PostHAProxyConfigurationBadRequest) WriteResponse(rw http.ResponseWrite } rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this } } @@ -350,7 +346,7 @@ type PostHAProxyConfigurationDefault struct { /* In: Body */ - Payload *models.Error `json:"body,omitempty"` + Payload string `json:"body,omitempty"` } // NewPostHAProxyConfigurationDefault creates PostHAProxyConfigurationDefault with default headers values @@ -387,13 +383,13 @@ func (o *PostHAProxyConfigurationDefault) SetConfigurationVersion(configurationV } // WithPayload adds the payload to the post h a proxy configuration default response -func (o *PostHAProxyConfigurationDefault) WithPayload(payload *models.Error) *PostHAProxyConfigurationDefault { +func (o *PostHAProxyConfigurationDefault) WithPayload(payload string) *PostHAProxyConfigurationDefault { o.Payload = payload return o } // SetPayload sets the payload to the post h a proxy configuration default response -func (o *PostHAProxyConfigurationDefault) SetPayload(payload *models.Error) { +func (o *PostHAProxyConfigurationDefault) SetPayload(payload string) { o.Payload = payload } @@ -408,10 +404,8 @@ func (o *PostHAProxyConfigurationDefault) WriteResponse(rw http.ResponseWriter, } rw.WriteHeader(o._statusCode) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this } } diff --git a/operations/data_plane_api.go b/operations/data_plane_api.go index d734ec73..32c18a84 100644 --- a/operations/data_plane_api.go +++ b/operations/data_plane_api.go @@ -119,6 +119,7 @@ func NewDataPlaneAPI(spec *loads.Document) *DataPlaneAPI { BinProducer: runtime.ByteStreamProducer(), JSONProducer: runtime.JSONProducer(), + TxtProducer: runtime.TextProducer(), ACLRuntimeDeleteServicesHaproxyRuntimeAclsParentNameEntriesIDHandler: acl_runtime.DeleteServicesHaproxyRuntimeAclsParentNameEntriesIDHandlerFunc(func(params acl_runtime.DeleteServicesHaproxyRuntimeAclsParentNameEntriesIDParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation acl_runtime.DeleteServicesHaproxyRuntimeAclsParentNameEntriesID has not yet been implemented") @@ -1506,6 +1507,9 @@ type DataPlaneAPI struct { // JSONProducer registers a producer for the following mime types: // - application/json JSONProducer runtime.Producer + // TxtProducer registers a producer for the following mime types: + // - text/plain + TxtProducer runtime.Producer // BasicAuthAuth registers a function that takes username and password and returns a principal // it performs authentication with basic auth @@ -2487,6 +2491,9 @@ func (o *DataPlaneAPI) Validate() error { if o.JSONProducer == nil { unregistered = append(unregistered, "JSONProducer") } + if o.TxtProducer == nil { + unregistered = append(unregistered, "TxtProducer") + } if o.BasicAuthAuth == nil { unregistered = append(unregistered, "BasicAuthAuth") @@ -3886,6 +3893,8 @@ func (o *DataPlaneAPI) ProducersFor(mediaTypes []string) map[string]runtime.Prod result["application/octet-stream"] = o.BinProducer case "application/json": result["application/json"] = o.JSONProducer + case "text/plain": + result["text/plain"] = o.TxtProducer } if p, ok := o.customProducers[mt]; ok { @@ -5743,6 +5752,6 @@ func (o *DataPlaneAPI) AddMiddlewareFor(method, path string, builder middleware. } o.Init() if h, ok := o.handlers[um][path]; ok { - o.handlers[method][path] = builder(h) + o.handlers[um][path] = builder(h) } } diff --git a/operations/declare_capture/create_declare_capture_parameters.go b/operations/declare_capture/create_declare_capture_parameters.go index b0a4af84..933707bf 100644 --- a/operations/declare_capture/create_declare_capture_parameters.go +++ b/operations/declare_capture/create_declare_capture_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateDeclareCaptureParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateDeclareCaptureParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateDeclareCaptureParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/declare_capture/delete_declare_capture_parameters.go b/operations/declare_capture/delete_declare_capture_parameters.go index 979440dc..475f8083 100644 --- a/operations/declare_capture/delete_declare_capture_parameters.go +++ b/operations/declare_capture/delete_declare_capture_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteDeclareCaptureParams creates a new DeleteDeclareCaptureParams object @@ -66,6 +67,7 @@ type DeleteDeclareCaptureParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteDeclareCaptureParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteDeclareCaptureParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/declare_capture/get_declare_capture_parameters.go b/operations/declare_capture/get_declare_capture_parameters.go index 02c47cc4..12ecaec1 100644 --- a/operations/declare_capture/get_declare_capture_parameters.go +++ b/operations/declare_capture/get_declare_capture_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetDeclareCaptureParams creates a new GetDeclareCaptureParams object @@ -54,6 +55,7 @@ type GetDeclareCaptureParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetDeclareCaptureParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetDeclareCaptureParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/declare_capture/get_declare_captures_parameters.go b/operations/declare_capture/get_declare_captures_parameters.go index dbc989fe..fe602124 100644 --- a/operations/declare_capture/get_declare_captures_parameters.go +++ b/operations/declare_capture/get_declare_captures_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetDeclareCapturesParams creates a new GetDeclareCapturesParams object @@ -48,6 +49,7 @@ type GetDeclareCapturesParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetDeclareCapturesParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetDeclareCapturesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/declare_capture/replace_declare_capture_parameters.go b/operations/declare_capture/replace_declare_capture_parameters.go index 604e683c..8296e334 100644 --- a/operations/declare_capture/replace_declare_capture_parameters.go +++ b/operations/declare_capture/replace_declare_capture_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceDeclareCaptureParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceDeclareCaptureParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceDeclareCaptureParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/declare_capture/replace_declare_captures_parameters.go b/operations/declare_capture/replace_declare_captures_parameters.go index 2db19806..4d3a6655 100644 --- a/operations/declare_capture/replace_declare_captures_parameters.go +++ b/operations/declare_capture/replace_declare_captures_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceDeclareCapturesParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceDeclareCapturesParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceDeclareCapturesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/dgram_bind/create_dgram_bind_parameters.go b/operations/dgram_bind/create_dgram_bind_parameters.go index 2678b1e1..73751e37 100644 --- a/operations/dgram_bind/create_dgram_bind_parameters.go +++ b/operations/dgram_bind/create_dgram_bind_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type CreateDgramBindParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *CreateDgramBindParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateDgramBindParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/dgram_bind/delete_dgram_bind_parameters.go b/operations/dgram_bind/delete_dgram_bind_parameters.go index b3995061..55449ba4 100644 --- a/operations/dgram_bind/delete_dgram_bind_parameters.go +++ b/operations/dgram_bind/delete_dgram_bind_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteDgramBindParams creates a new DeleteDgramBindParams object @@ -66,6 +67,7 @@ type DeleteDgramBindParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -169,6 +171,20 @@ func (o *DeleteDgramBindParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteDgramBindParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/dgram_bind/get_dgram_bind_parameters.go b/operations/dgram_bind/get_dgram_bind_parameters.go index 4355ac22..d4fdb9b9 100644 --- a/operations/dgram_bind/get_dgram_bind_parameters.go +++ b/operations/dgram_bind/get_dgram_bind_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetDgramBindParams creates a new GetDgramBindParams object @@ -53,6 +54,7 @@ type GetDgramBindParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -118,6 +120,20 @@ func (o *GetDgramBindParams) bindParentName(rawData []string, hasKey bool, forma // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetDgramBindParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/dgram_bind/get_dgram_binds_parameters.go b/operations/dgram_bind/get_dgram_binds_parameters.go index c37006e9..29403b67 100644 --- a/operations/dgram_bind/get_dgram_binds_parameters.go +++ b/operations/dgram_bind/get_dgram_binds_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetDgramBindsParams creates a new GetDgramBindsParams object @@ -48,6 +49,7 @@ type GetDgramBindsParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetDgramBindsParams) bindParentName(rawData []string, hasKey bool, form // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetDgramBindsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/dgram_bind/replace_dgram_bind_parameters.go b/operations/dgram_bind/replace_dgram_bind_parameters.go index 3f05f62b..6406a75a 100644 --- a/operations/dgram_bind/replace_dgram_bind_parameters.go +++ b/operations/dgram_bind/replace_dgram_bind_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceDgramBindParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -200,6 +202,20 @@ func (o *ReplaceDgramBindParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceDgramBindParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/create_filter_backend_parameters.go b/operations/filter/create_filter_backend_parameters.go index 0e0f6d25..0a181332 100644 --- a/operations/filter/create_filter_backend_parameters.go +++ b/operations/filter/create_filter_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateFilterBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateFilterBackendParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateFilterBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/create_filter_frontend_parameters.go b/operations/filter/create_filter_frontend_parameters.go index f81af086..0be10a07 100644 --- a/operations/filter/create_filter_frontend_parameters.go +++ b/operations/filter/create_filter_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateFilterFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateFilterFrontendParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateFilterFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/delete_filter_backend_parameters.go b/operations/filter/delete_filter_backend_parameters.go index 28e77f9d..72e9b445 100644 --- a/operations/filter/delete_filter_backend_parameters.go +++ b/operations/filter/delete_filter_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteFilterBackendParams creates a new DeleteFilterBackendParams object @@ -66,6 +67,7 @@ type DeleteFilterBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteFilterBackendParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteFilterBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/delete_filter_frontend_parameters.go b/operations/filter/delete_filter_frontend_parameters.go index e7c9af9c..9ced3e6a 100644 --- a/operations/filter/delete_filter_frontend_parameters.go +++ b/operations/filter/delete_filter_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteFilterFrontendParams creates a new DeleteFilterFrontendParams object @@ -66,6 +67,7 @@ type DeleteFilterFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteFilterFrontendParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteFilterFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/get_all_filter_backend_parameters.go b/operations/filter/get_all_filter_backend_parameters.go index 262f48c4..f9872d90 100644 --- a/operations/filter/get_all_filter_backend_parameters.go +++ b/operations/filter/get_all_filter_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllFilterBackendParams creates a new GetAllFilterBackendParams object @@ -48,6 +49,7 @@ type GetAllFilterBackendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllFilterBackendParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllFilterBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/get_all_filter_frontend_parameters.go b/operations/filter/get_all_filter_frontend_parameters.go index f7266252..e139eb6c 100644 --- a/operations/filter/get_all_filter_frontend_parameters.go +++ b/operations/filter/get_all_filter_frontend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllFilterFrontendParams creates a new GetAllFilterFrontendParams object @@ -48,6 +49,7 @@ type GetAllFilterFrontendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllFilterFrontendParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllFilterFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/get_filter_backend_parameters.go b/operations/filter/get_filter_backend_parameters.go index 20342b83..11cb7f4c 100644 --- a/operations/filter/get_filter_backend_parameters.go +++ b/operations/filter/get_filter_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetFilterBackendParams creates a new GetFilterBackendParams object @@ -54,6 +55,7 @@ type GetFilterBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetFilterBackendParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetFilterBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/get_filter_frontend_parameters.go b/operations/filter/get_filter_frontend_parameters.go index 5f5bf3b7..41e19dfb 100644 --- a/operations/filter/get_filter_frontend_parameters.go +++ b/operations/filter/get_filter_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetFilterFrontendParams creates a new GetFilterFrontendParams object @@ -54,6 +55,7 @@ type GetFilterFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetFilterFrontendParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetFilterFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/replace_all_filter_backend_parameters.go b/operations/filter/replace_all_filter_backend_parameters.go index 50d155c4..43be1332 100644 --- a/operations/filter/replace_all_filter_backend_parameters.go +++ b/operations/filter/replace_all_filter_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllFilterBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllFilterBackendParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllFilterBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/replace_all_filter_frontend_parameters.go b/operations/filter/replace_all_filter_frontend_parameters.go index a29bfad9..f4a2f50f 100644 --- a/operations/filter/replace_all_filter_frontend_parameters.go +++ b/operations/filter/replace_all_filter_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllFilterFrontendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllFilterFrontendParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllFilterFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/replace_filter_backend_parameters.go b/operations/filter/replace_filter_backend_parameters.go index 1aed1d8f..bbbdb70d 100644 --- a/operations/filter/replace_filter_backend_parameters.go +++ b/operations/filter/replace_filter_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceFilterBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceFilterBackendParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceFilterBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/filter/replace_filter_frontend_parameters.go b/operations/filter/replace_filter_frontend_parameters.go index f302cb4c..26802732 100644 --- a/operations/filter/replace_filter_frontend_parameters.go +++ b/operations/filter/replace_filter_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceFilterFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceFilterFrontendParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceFilterFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/create_http_after_response_rule_backend_parameters.go b/operations/http_after_response_rule/create_http_after_response_rule_backend_parameters.go index 619314d1..af5eb244 100644 --- a/operations/http_after_response_rule/create_http_after_response_rule_backend_parameters.go +++ b/operations/http_after_response_rule/create_http_after_response_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateHTTPAfterResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateHTTPAfterResponseRuleBackendParams) bindParentName(rawData []stri // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateHTTPAfterResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/create_http_after_response_rule_frontend_parameters.go b/operations/http_after_response_rule/create_http_after_response_rule_frontend_parameters.go index b4c0fec9..67e16791 100644 --- a/operations/http_after_response_rule/create_http_after_response_rule_frontend_parameters.go +++ b/operations/http_after_response_rule/create_http_after_response_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateHTTPAfterResponseRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateHTTPAfterResponseRuleFrontendParams) bindParentName(rawData []str // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateHTTPAfterResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/delete_http_after_response_rule_backend_parameters.go b/operations/http_after_response_rule/delete_http_after_response_rule_backend_parameters.go index 2991d84a..37b51278 100644 --- a/operations/http_after_response_rule/delete_http_after_response_rule_backend_parameters.go +++ b/operations/http_after_response_rule/delete_http_after_response_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteHTTPAfterResponseRuleBackendParams creates a new DeleteHTTPAfterResponseRuleBackendParams object @@ -66,6 +67,7 @@ type DeleteHTTPAfterResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteHTTPAfterResponseRuleBackendParams) bindParentName(rawData []stri // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteHTTPAfterResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/delete_http_after_response_rule_frontend_parameters.go b/operations/http_after_response_rule/delete_http_after_response_rule_frontend_parameters.go index b64c8963..ff43a067 100644 --- a/operations/http_after_response_rule/delete_http_after_response_rule_frontend_parameters.go +++ b/operations/http_after_response_rule/delete_http_after_response_rule_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteHTTPAfterResponseRuleFrontendParams creates a new DeleteHTTPAfterResponseRuleFrontendParams object @@ -66,6 +67,7 @@ type DeleteHTTPAfterResponseRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteHTTPAfterResponseRuleFrontendParams) bindParentName(rawData []str // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteHTTPAfterResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/get_all_http_after_response_rule_backend_parameters.go b/operations/http_after_response_rule/get_all_http_after_response_rule_backend_parameters.go index 2e5fcd45..9b2c09bb 100644 --- a/operations/http_after_response_rule/get_all_http_after_response_rule_backend_parameters.go +++ b/operations/http_after_response_rule/get_all_http_after_response_rule_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllHTTPAfterResponseRuleBackendParams creates a new GetAllHTTPAfterResponseRuleBackendParams object @@ -48,6 +49,7 @@ type GetAllHTTPAfterResponseRuleBackendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllHTTPAfterResponseRuleBackendParams) bindParentName(rawData []stri // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllHTTPAfterResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/get_all_http_after_response_rule_frontend_parameters.go b/operations/http_after_response_rule/get_all_http_after_response_rule_frontend_parameters.go index 1f4ff913..85d074e4 100644 --- a/operations/http_after_response_rule/get_all_http_after_response_rule_frontend_parameters.go +++ b/operations/http_after_response_rule/get_all_http_after_response_rule_frontend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllHTTPAfterResponseRuleFrontendParams creates a new GetAllHTTPAfterResponseRuleFrontendParams object @@ -48,6 +49,7 @@ type GetAllHTTPAfterResponseRuleFrontendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllHTTPAfterResponseRuleFrontendParams) bindParentName(rawData []str // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllHTTPAfterResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/get_http_after_response_rule_backend_parameters.go b/operations/http_after_response_rule/get_http_after_response_rule_backend_parameters.go index a296c30e..8acbb272 100644 --- a/operations/http_after_response_rule/get_http_after_response_rule_backend_parameters.go +++ b/operations/http_after_response_rule/get_http_after_response_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetHTTPAfterResponseRuleBackendParams creates a new GetHTTPAfterResponseRuleBackendParams object @@ -54,6 +55,7 @@ type GetHTTPAfterResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetHTTPAfterResponseRuleBackendParams) bindParentName(rawData []string, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetHTTPAfterResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/get_http_after_response_rule_frontend_parameters.go b/operations/http_after_response_rule/get_http_after_response_rule_frontend_parameters.go index af73db0d..f407266f 100644 --- a/operations/http_after_response_rule/get_http_after_response_rule_frontend_parameters.go +++ b/operations/http_after_response_rule/get_http_after_response_rule_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetHTTPAfterResponseRuleFrontendParams creates a new GetHTTPAfterResponseRuleFrontendParams object @@ -54,6 +55,7 @@ type GetHTTPAfterResponseRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetHTTPAfterResponseRuleFrontendParams) bindParentName(rawData []string // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetHTTPAfterResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/replace_all_http_after_response_rule_backend_parameters.go b/operations/http_after_response_rule/replace_all_http_after_response_rule_backend_parameters.go index 6f98b854..14ca1ad4 100644 --- a/operations/http_after_response_rule/replace_all_http_after_response_rule_backend_parameters.go +++ b/operations/http_after_response_rule/replace_all_http_after_response_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllHTTPAfterResponseRuleBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllHTTPAfterResponseRuleBackendParams) bindParentName(rawData [] // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllHTTPAfterResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/replace_all_http_after_response_rule_frontend_parameters.go b/operations/http_after_response_rule/replace_all_http_after_response_rule_frontend_parameters.go index 8ea77a58..f170a21e 100644 --- a/operations/http_after_response_rule/replace_all_http_after_response_rule_frontend_parameters.go +++ b/operations/http_after_response_rule/replace_all_http_after_response_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllHTTPAfterResponseRuleFrontendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllHTTPAfterResponseRuleFrontendParams) bindParentName(rawData [ // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllHTTPAfterResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/replace_http_after_response_rule_backend_parameters.go b/operations/http_after_response_rule/replace_http_after_response_rule_backend_parameters.go index 477be655..8bf7208e 100644 --- a/operations/http_after_response_rule/replace_http_after_response_rule_backend_parameters.go +++ b/operations/http_after_response_rule/replace_http_after_response_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceHTTPAfterResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceHTTPAfterResponseRuleBackendParams) bindParentName(rawData []str // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceHTTPAfterResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_after_response_rule/replace_http_after_response_rule_frontend_parameters.go b/operations/http_after_response_rule/replace_http_after_response_rule_frontend_parameters.go index d1b4304e..cbf0063d 100644 --- a/operations/http_after_response_rule/replace_http_after_response_rule_frontend_parameters.go +++ b/operations/http_after_response_rule/replace_http_after_response_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceHTTPAfterResponseRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceHTTPAfterResponseRuleFrontendParams) bindParentName(rawData []st // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceHTTPAfterResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/create_http_check_backend_parameters.go b/operations/http_check/create_http_check_backend_parameters.go index 9e7ba597..63f1f9e1 100644 --- a/operations/http_check/create_http_check_backend_parameters.go +++ b/operations/http_check/create_http_check_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateHTTPCheckBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateHTTPCheckBackendParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateHTTPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/create_http_check_defaults_parameters.go b/operations/http_check/create_http_check_defaults_parameters.go index 75b62bed..f237e070 100644 --- a/operations/http_check/create_http_check_defaults_parameters.go +++ b/operations/http_check/create_http_check_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateHTTPCheckDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateHTTPCheckDefaultsParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateHTTPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/delete_http_check_backend_parameters.go b/operations/http_check/delete_http_check_backend_parameters.go index 5255e0e4..0d584fc5 100644 --- a/operations/http_check/delete_http_check_backend_parameters.go +++ b/operations/http_check/delete_http_check_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteHTTPCheckBackendParams creates a new DeleteHTTPCheckBackendParams object @@ -66,6 +67,7 @@ type DeleteHTTPCheckBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteHTTPCheckBackendParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteHTTPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/delete_http_check_defaults_parameters.go b/operations/http_check/delete_http_check_defaults_parameters.go index 46d2fb26..78af4808 100644 --- a/operations/http_check/delete_http_check_defaults_parameters.go +++ b/operations/http_check/delete_http_check_defaults_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteHTTPCheckDefaultsParams creates a new DeleteHTTPCheckDefaultsParams object @@ -66,6 +67,7 @@ type DeleteHTTPCheckDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteHTTPCheckDefaultsParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteHTTPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/get_all_http_check_backend_parameters.go b/operations/http_check/get_all_http_check_backend_parameters.go index 5155ce84..7d6fc82f 100644 --- a/operations/http_check/get_all_http_check_backend_parameters.go +++ b/operations/http_check/get_all_http_check_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllHTTPCheckBackendParams creates a new GetAllHTTPCheckBackendParams object @@ -48,6 +49,7 @@ type GetAllHTTPCheckBackendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllHTTPCheckBackendParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllHTTPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/get_all_http_check_defaults_parameters.go b/operations/http_check/get_all_http_check_defaults_parameters.go index 6e398d48..530043b7 100644 --- a/operations/http_check/get_all_http_check_defaults_parameters.go +++ b/operations/http_check/get_all_http_check_defaults_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllHTTPCheckDefaultsParams creates a new GetAllHTTPCheckDefaultsParams object @@ -48,6 +49,7 @@ type GetAllHTTPCheckDefaultsParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllHTTPCheckDefaultsParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllHTTPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/get_http_check_backend_parameters.go b/operations/http_check/get_http_check_backend_parameters.go index 490eec9a..4641b5a0 100644 --- a/operations/http_check/get_http_check_backend_parameters.go +++ b/operations/http_check/get_http_check_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetHTTPCheckBackendParams creates a new GetHTTPCheckBackendParams object @@ -54,6 +55,7 @@ type GetHTTPCheckBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetHTTPCheckBackendParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetHTTPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/get_http_check_defaults_parameters.go b/operations/http_check/get_http_check_defaults_parameters.go index de85fd3a..659a8b94 100644 --- a/operations/http_check/get_http_check_defaults_parameters.go +++ b/operations/http_check/get_http_check_defaults_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetHTTPCheckDefaultsParams creates a new GetHTTPCheckDefaultsParams object @@ -54,6 +55,7 @@ type GetHTTPCheckDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetHTTPCheckDefaultsParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetHTTPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/replace_all_http_check_backend_parameters.go b/operations/http_check/replace_all_http_check_backend_parameters.go index 3569802c..0de9f464 100644 --- a/operations/http_check/replace_all_http_check_backend_parameters.go +++ b/operations/http_check/replace_all_http_check_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllHTTPCheckBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllHTTPCheckBackendParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllHTTPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/replace_all_http_check_defaults_parameters.go b/operations/http_check/replace_all_http_check_defaults_parameters.go index 0eb7a155..0f9e6d3c 100644 --- a/operations/http_check/replace_all_http_check_defaults_parameters.go +++ b/operations/http_check/replace_all_http_check_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllHTTPCheckDefaultsParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllHTTPCheckDefaultsParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllHTTPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/replace_http_check_backend_parameters.go b/operations/http_check/replace_http_check_backend_parameters.go index 77edcfdb..baf0fe75 100644 --- a/operations/http_check/replace_http_check_backend_parameters.go +++ b/operations/http_check/replace_http_check_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceHTTPCheckBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceHTTPCheckBackendParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceHTTPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_check/replace_http_check_defaults_parameters.go b/operations/http_check/replace_http_check_defaults_parameters.go index 01775240..608c3351 100644 --- a/operations/http_check/replace_http_check_defaults_parameters.go +++ b/operations/http_check/replace_http_check_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceHTTPCheckDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceHTTPCheckDefaultsParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceHTTPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/create_http_error_rule_backend_parameters.go b/operations/http_error_rule/create_http_error_rule_backend_parameters.go index aeb5b09d..460b32c8 100644 --- a/operations/http_error_rule/create_http_error_rule_backend_parameters.go +++ b/operations/http_error_rule/create_http_error_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateHTTPErrorRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateHTTPErrorRuleBackendParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateHTTPErrorRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/create_http_error_rule_defaults_parameters.go b/operations/http_error_rule/create_http_error_rule_defaults_parameters.go index 3c60a513..a3d6f70a 100644 --- a/operations/http_error_rule/create_http_error_rule_defaults_parameters.go +++ b/operations/http_error_rule/create_http_error_rule_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateHTTPErrorRuleDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateHTTPErrorRuleDefaultsParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateHTTPErrorRuleDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/create_http_error_rule_frontend_parameters.go b/operations/http_error_rule/create_http_error_rule_frontend_parameters.go index 29024d0a..8d36bcbd 100644 --- a/operations/http_error_rule/create_http_error_rule_frontend_parameters.go +++ b/operations/http_error_rule/create_http_error_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateHTTPErrorRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateHTTPErrorRuleFrontendParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateHTTPErrorRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/delete_http_error_rule_backend_parameters.go b/operations/http_error_rule/delete_http_error_rule_backend_parameters.go index 47f7a25a..f3dbeeea 100644 --- a/operations/http_error_rule/delete_http_error_rule_backend_parameters.go +++ b/operations/http_error_rule/delete_http_error_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteHTTPErrorRuleBackendParams creates a new DeleteHTTPErrorRuleBackendParams object @@ -66,6 +67,7 @@ type DeleteHTTPErrorRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteHTTPErrorRuleBackendParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteHTTPErrorRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/delete_http_error_rule_defaults_parameters.go b/operations/http_error_rule/delete_http_error_rule_defaults_parameters.go index 93dd1b48..27258d55 100644 --- a/operations/http_error_rule/delete_http_error_rule_defaults_parameters.go +++ b/operations/http_error_rule/delete_http_error_rule_defaults_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteHTTPErrorRuleDefaultsParams creates a new DeleteHTTPErrorRuleDefaultsParams object @@ -66,6 +67,7 @@ type DeleteHTTPErrorRuleDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteHTTPErrorRuleDefaultsParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteHTTPErrorRuleDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/delete_http_error_rule_frontend_parameters.go b/operations/http_error_rule/delete_http_error_rule_frontend_parameters.go index 091a494e..de566e9f 100644 --- a/operations/http_error_rule/delete_http_error_rule_frontend_parameters.go +++ b/operations/http_error_rule/delete_http_error_rule_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteHTTPErrorRuleFrontendParams creates a new DeleteHTTPErrorRuleFrontendParams object @@ -66,6 +67,7 @@ type DeleteHTTPErrorRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteHTTPErrorRuleFrontendParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteHTTPErrorRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/get_all_http_error_rule_backend_parameters.go b/operations/http_error_rule/get_all_http_error_rule_backend_parameters.go index d035242d..d3ca8956 100644 --- a/operations/http_error_rule/get_all_http_error_rule_backend_parameters.go +++ b/operations/http_error_rule/get_all_http_error_rule_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllHTTPErrorRuleBackendParams creates a new GetAllHTTPErrorRuleBackendParams object @@ -48,6 +49,7 @@ type GetAllHTTPErrorRuleBackendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllHTTPErrorRuleBackendParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllHTTPErrorRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/get_all_http_error_rule_defaults_parameters.go b/operations/http_error_rule/get_all_http_error_rule_defaults_parameters.go index 0fef73aa..8cec5c54 100644 --- a/operations/http_error_rule/get_all_http_error_rule_defaults_parameters.go +++ b/operations/http_error_rule/get_all_http_error_rule_defaults_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllHTTPErrorRuleDefaultsParams creates a new GetAllHTTPErrorRuleDefaultsParams object @@ -48,6 +49,7 @@ type GetAllHTTPErrorRuleDefaultsParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllHTTPErrorRuleDefaultsParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllHTTPErrorRuleDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/get_all_http_error_rule_frontend_parameters.go b/operations/http_error_rule/get_all_http_error_rule_frontend_parameters.go index 1ad477c3..67ea2f7a 100644 --- a/operations/http_error_rule/get_all_http_error_rule_frontend_parameters.go +++ b/operations/http_error_rule/get_all_http_error_rule_frontend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllHTTPErrorRuleFrontendParams creates a new GetAllHTTPErrorRuleFrontendParams object @@ -48,6 +49,7 @@ type GetAllHTTPErrorRuleFrontendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllHTTPErrorRuleFrontendParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllHTTPErrorRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/get_http_error_rule_backend_parameters.go b/operations/http_error_rule/get_http_error_rule_backend_parameters.go index e98e511c..e3482ab4 100644 --- a/operations/http_error_rule/get_http_error_rule_backend_parameters.go +++ b/operations/http_error_rule/get_http_error_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetHTTPErrorRuleBackendParams creates a new GetHTTPErrorRuleBackendParams object @@ -54,6 +55,7 @@ type GetHTTPErrorRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetHTTPErrorRuleBackendParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetHTTPErrorRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/get_http_error_rule_defaults_parameters.go b/operations/http_error_rule/get_http_error_rule_defaults_parameters.go index 291419a8..3488327c 100644 --- a/operations/http_error_rule/get_http_error_rule_defaults_parameters.go +++ b/operations/http_error_rule/get_http_error_rule_defaults_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetHTTPErrorRuleDefaultsParams creates a new GetHTTPErrorRuleDefaultsParams object @@ -54,6 +55,7 @@ type GetHTTPErrorRuleDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetHTTPErrorRuleDefaultsParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetHTTPErrorRuleDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/get_http_error_rule_frontend_parameters.go b/operations/http_error_rule/get_http_error_rule_frontend_parameters.go index 9fff8ee0..501ba61c 100644 --- a/operations/http_error_rule/get_http_error_rule_frontend_parameters.go +++ b/operations/http_error_rule/get_http_error_rule_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetHTTPErrorRuleFrontendParams creates a new GetHTTPErrorRuleFrontendParams object @@ -54,6 +55,7 @@ type GetHTTPErrorRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetHTTPErrorRuleFrontendParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetHTTPErrorRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/replace_all_http_error_rule_backend_parameters.go b/operations/http_error_rule/replace_all_http_error_rule_backend_parameters.go index ac8581e9..cb0175d0 100644 --- a/operations/http_error_rule/replace_all_http_error_rule_backend_parameters.go +++ b/operations/http_error_rule/replace_all_http_error_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllHTTPErrorRuleBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllHTTPErrorRuleBackendParams) bindParentName(rawData []string, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllHTTPErrorRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/replace_all_http_error_rule_defaults_parameters.go b/operations/http_error_rule/replace_all_http_error_rule_defaults_parameters.go index 46e22230..3f2b175a 100644 --- a/operations/http_error_rule/replace_all_http_error_rule_defaults_parameters.go +++ b/operations/http_error_rule/replace_all_http_error_rule_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllHTTPErrorRuleDefaultsParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllHTTPErrorRuleDefaultsParams) bindParentName(rawData []string, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllHTTPErrorRuleDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/replace_all_http_error_rule_frontend_parameters.go b/operations/http_error_rule/replace_all_http_error_rule_frontend_parameters.go index e31239a1..22f9b9eb 100644 --- a/operations/http_error_rule/replace_all_http_error_rule_frontend_parameters.go +++ b/operations/http_error_rule/replace_all_http_error_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllHTTPErrorRuleFrontendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllHTTPErrorRuleFrontendParams) bindParentName(rawData []string, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllHTTPErrorRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/replace_http_error_rule_backend_parameters.go b/operations/http_error_rule/replace_http_error_rule_backend_parameters.go index cbb6f4f7..369a8e58 100644 --- a/operations/http_error_rule/replace_http_error_rule_backend_parameters.go +++ b/operations/http_error_rule/replace_http_error_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceHTTPErrorRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceHTTPErrorRuleBackendParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceHTTPErrorRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/replace_http_error_rule_defaults_parameters.go b/operations/http_error_rule/replace_http_error_rule_defaults_parameters.go index 6b883e15..6efba41d 100644 --- a/operations/http_error_rule/replace_http_error_rule_defaults_parameters.go +++ b/operations/http_error_rule/replace_http_error_rule_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceHTTPErrorRuleDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceHTTPErrorRuleDefaultsParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceHTTPErrorRuleDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_error_rule/replace_http_error_rule_frontend_parameters.go b/operations/http_error_rule/replace_http_error_rule_frontend_parameters.go index 2fca35e8..c31306f9 100644 --- a/operations/http_error_rule/replace_http_error_rule_frontend_parameters.go +++ b/operations/http_error_rule/replace_http_error_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceHTTPErrorRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceHTTPErrorRuleFrontendParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceHTTPErrorRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/create_http_request_rule_backend_parameters.go b/operations/http_request_rule/create_http_request_rule_backend_parameters.go index 41a9c904..c4f657c6 100644 --- a/operations/http_request_rule/create_http_request_rule_backend_parameters.go +++ b/operations/http_request_rule/create_http_request_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateHTTPRequestRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateHTTPRequestRuleBackendParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateHTTPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/create_http_request_rule_frontend_parameters.go b/operations/http_request_rule/create_http_request_rule_frontend_parameters.go index f14c1300..2dbec60c 100644 --- a/operations/http_request_rule/create_http_request_rule_frontend_parameters.go +++ b/operations/http_request_rule/create_http_request_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateHTTPRequestRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateHTTPRequestRuleFrontendParams) bindParentName(rawData []string, h // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateHTTPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/delete_http_request_rule_backend_parameters.go b/operations/http_request_rule/delete_http_request_rule_backend_parameters.go index 11d009ad..deb88138 100644 --- a/operations/http_request_rule/delete_http_request_rule_backend_parameters.go +++ b/operations/http_request_rule/delete_http_request_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteHTTPRequestRuleBackendParams creates a new DeleteHTTPRequestRuleBackendParams object @@ -66,6 +67,7 @@ type DeleteHTTPRequestRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteHTTPRequestRuleBackendParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteHTTPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/delete_http_request_rule_frontend_parameters.go b/operations/http_request_rule/delete_http_request_rule_frontend_parameters.go index d020eb92..08258bb8 100644 --- a/operations/http_request_rule/delete_http_request_rule_frontend_parameters.go +++ b/operations/http_request_rule/delete_http_request_rule_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteHTTPRequestRuleFrontendParams creates a new DeleteHTTPRequestRuleFrontendParams object @@ -66,6 +67,7 @@ type DeleteHTTPRequestRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteHTTPRequestRuleFrontendParams) bindParentName(rawData []string, h // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteHTTPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/get_all_http_request_rule_backend_parameters.go b/operations/http_request_rule/get_all_http_request_rule_backend_parameters.go index 79dd9c24..95b385cd 100644 --- a/operations/http_request_rule/get_all_http_request_rule_backend_parameters.go +++ b/operations/http_request_rule/get_all_http_request_rule_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllHTTPRequestRuleBackendParams creates a new GetAllHTTPRequestRuleBackendParams object @@ -48,6 +49,7 @@ type GetAllHTTPRequestRuleBackendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllHTTPRequestRuleBackendParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllHTTPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/get_all_http_request_rule_frontend_parameters.go b/operations/http_request_rule/get_all_http_request_rule_frontend_parameters.go index 3d65849b..42d07fbc 100644 --- a/operations/http_request_rule/get_all_http_request_rule_frontend_parameters.go +++ b/operations/http_request_rule/get_all_http_request_rule_frontend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllHTTPRequestRuleFrontendParams creates a new GetAllHTTPRequestRuleFrontendParams object @@ -48,6 +49,7 @@ type GetAllHTTPRequestRuleFrontendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllHTTPRequestRuleFrontendParams) bindParentName(rawData []string, h // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllHTTPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/get_http_request_rule_backend_parameters.go b/operations/http_request_rule/get_http_request_rule_backend_parameters.go index 84ba784c..31971b57 100644 --- a/operations/http_request_rule/get_http_request_rule_backend_parameters.go +++ b/operations/http_request_rule/get_http_request_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetHTTPRequestRuleBackendParams creates a new GetHTTPRequestRuleBackendParams object @@ -54,6 +55,7 @@ type GetHTTPRequestRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetHTTPRequestRuleBackendParams) bindParentName(rawData []string, hasKe // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetHTTPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/get_http_request_rule_frontend_parameters.go b/operations/http_request_rule/get_http_request_rule_frontend_parameters.go index 1a737167..f0339384 100644 --- a/operations/http_request_rule/get_http_request_rule_frontend_parameters.go +++ b/operations/http_request_rule/get_http_request_rule_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetHTTPRequestRuleFrontendParams creates a new GetHTTPRequestRuleFrontendParams object @@ -54,6 +55,7 @@ type GetHTTPRequestRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetHTTPRequestRuleFrontendParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetHTTPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/replace_all_http_request_rule_backend_parameters.go b/operations/http_request_rule/replace_all_http_request_rule_backend_parameters.go index 9b266644..74b7a9df 100644 --- a/operations/http_request_rule/replace_all_http_request_rule_backend_parameters.go +++ b/operations/http_request_rule/replace_all_http_request_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllHTTPRequestRuleBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllHTTPRequestRuleBackendParams) bindParentName(rawData []string // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllHTTPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/replace_all_http_request_rule_frontend_parameters.go b/operations/http_request_rule/replace_all_http_request_rule_frontend_parameters.go index 44460cf2..ac2cb12a 100644 --- a/operations/http_request_rule/replace_all_http_request_rule_frontend_parameters.go +++ b/operations/http_request_rule/replace_all_http_request_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllHTTPRequestRuleFrontendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllHTTPRequestRuleFrontendParams) bindParentName(rawData []strin // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllHTTPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/replace_http_request_rule_backend_parameters.go b/operations/http_request_rule/replace_http_request_rule_backend_parameters.go index 167200cc..1989031a 100644 --- a/operations/http_request_rule/replace_http_request_rule_backend_parameters.go +++ b/operations/http_request_rule/replace_http_request_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceHTTPRequestRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceHTTPRequestRuleBackendParams) bindParentName(rawData []string, h // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceHTTPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_request_rule/replace_http_request_rule_frontend_parameters.go b/operations/http_request_rule/replace_http_request_rule_frontend_parameters.go index e84ee71f..8d564b42 100644 --- a/operations/http_request_rule/replace_http_request_rule_frontend_parameters.go +++ b/operations/http_request_rule/replace_http_request_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceHTTPRequestRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceHTTPRequestRuleFrontendParams) bindParentName(rawData []string, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceHTTPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/create_http_response_rule_backend_parameters.go b/operations/http_response_rule/create_http_response_rule_backend_parameters.go index ed06a582..cc6f350b 100644 --- a/operations/http_response_rule/create_http_response_rule_backend_parameters.go +++ b/operations/http_response_rule/create_http_response_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateHTTPResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateHTTPResponseRuleBackendParams) bindParentName(rawData []string, h // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateHTTPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/create_http_response_rule_frontend_parameters.go b/operations/http_response_rule/create_http_response_rule_frontend_parameters.go index f700f54c..68340a9c 100644 --- a/operations/http_response_rule/create_http_response_rule_frontend_parameters.go +++ b/operations/http_response_rule/create_http_response_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateHTTPResponseRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateHTTPResponseRuleFrontendParams) bindParentName(rawData []string, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateHTTPResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/delete_http_response_rule_backend_parameters.go b/operations/http_response_rule/delete_http_response_rule_backend_parameters.go index a038ceb2..874bea03 100644 --- a/operations/http_response_rule/delete_http_response_rule_backend_parameters.go +++ b/operations/http_response_rule/delete_http_response_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteHTTPResponseRuleBackendParams creates a new DeleteHTTPResponseRuleBackendParams object @@ -66,6 +67,7 @@ type DeleteHTTPResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteHTTPResponseRuleBackendParams) bindParentName(rawData []string, h // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteHTTPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/delete_http_response_rule_frontend_parameters.go b/operations/http_response_rule/delete_http_response_rule_frontend_parameters.go index ec5b77ee..8b1d456b 100644 --- a/operations/http_response_rule/delete_http_response_rule_frontend_parameters.go +++ b/operations/http_response_rule/delete_http_response_rule_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteHTTPResponseRuleFrontendParams creates a new DeleteHTTPResponseRuleFrontendParams object @@ -66,6 +67,7 @@ type DeleteHTTPResponseRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteHTTPResponseRuleFrontendParams) bindParentName(rawData []string, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteHTTPResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/get_all_http_response_rule_backend_parameters.go b/operations/http_response_rule/get_all_http_response_rule_backend_parameters.go index 4f9d5de5..81a20f3b 100644 --- a/operations/http_response_rule/get_all_http_response_rule_backend_parameters.go +++ b/operations/http_response_rule/get_all_http_response_rule_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllHTTPResponseRuleBackendParams creates a new GetAllHTTPResponseRuleBackendParams object @@ -48,6 +49,7 @@ type GetAllHTTPResponseRuleBackendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllHTTPResponseRuleBackendParams) bindParentName(rawData []string, h // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllHTTPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/get_all_http_response_rule_frontend_parameters.go b/operations/http_response_rule/get_all_http_response_rule_frontend_parameters.go index 0c4a366e..14da2d70 100644 --- a/operations/http_response_rule/get_all_http_response_rule_frontend_parameters.go +++ b/operations/http_response_rule/get_all_http_response_rule_frontend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllHTTPResponseRuleFrontendParams creates a new GetAllHTTPResponseRuleFrontendParams object @@ -48,6 +49,7 @@ type GetAllHTTPResponseRuleFrontendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllHTTPResponseRuleFrontendParams) bindParentName(rawData []string, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllHTTPResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/get_http_response_rule_backend_parameters.go b/operations/http_response_rule/get_http_response_rule_backend_parameters.go index 53be771f..abd155c0 100644 --- a/operations/http_response_rule/get_http_response_rule_backend_parameters.go +++ b/operations/http_response_rule/get_http_response_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetHTTPResponseRuleBackendParams creates a new GetHTTPResponseRuleBackendParams object @@ -54,6 +55,7 @@ type GetHTTPResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetHTTPResponseRuleBackendParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetHTTPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/get_http_response_rule_frontend_parameters.go b/operations/http_response_rule/get_http_response_rule_frontend_parameters.go index 6e9ee92d..15988b64 100644 --- a/operations/http_response_rule/get_http_response_rule_frontend_parameters.go +++ b/operations/http_response_rule/get_http_response_rule_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetHTTPResponseRuleFrontendParams creates a new GetHTTPResponseRuleFrontendParams object @@ -54,6 +55,7 @@ type GetHTTPResponseRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetHTTPResponseRuleFrontendParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetHTTPResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/replace_all_http_response_rule_backend_parameters.go b/operations/http_response_rule/replace_all_http_response_rule_backend_parameters.go index 2ed736be..1b923048 100644 --- a/operations/http_response_rule/replace_all_http_response_rule_backend_parameters.go +++ b/operations/http_response_rule/replace_all_http_response_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllHTTPResponseRuleBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllHTTPResponseRuleBackendParams) bindParentName(rawData []strin // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllHTTPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/replace_all_http_response_rule_frontend_parameters.go b/operations/http_response_rule/replace_all_http_response_rule_frontend_parameters.go index 5b117c23..55d72d0f 100644 --- a/operations/http_response_rule/replace_all_http_response_rule_frontend_parameters.go +++ b/operations/http_response_rule/replace_all_http_response_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllHTTPResponseRuleFrontendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllHTTPResponseRuleFrontendParams) bindParentName(rawData []stri // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllHTTPResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/replace_http_response_rule_backend_parameters.go b/operations/http_response_rule/replace_http_response_rule_backend_parameters.go index 9e7b2038..25739afa 100644 --- a/operations/http_response_rule/replace_http_response_rule_backend_parameters.go +++ b/operations/http_response_rule/replace_http_response_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceHTTPResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceHTTPResponseRuleBackendParams) bindParentName(rawData []string, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceHTTPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/http_response_rule/replace_http_response_rule_frontend_parameters.go b/operations/http_response_rule/replace_http_response_rule_frontend_parameters.go index 0cdab708..d163934a 100644 --- a/operations/http_response_rule/replace_http_response_rule_frontend_parameters.go +++ b/operations/http_response_rule/replace_http_response_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceHTTPResponseRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceHTTPResponseRuleFrontendParams) bindParentName(rawData []string, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceHTTPResponseRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/create_log_target_backend_parameters.go b/operations/log_target/create_log_target_backend_parameters.go index b642be2f..fa5bd648 100644 --- a/operations/log_target/create_log_target_backend_parameters.go +++ b/operations/log_target/create_log_target_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateLogTargetBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateLogTargetBackendParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateLogTargetBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/create_log_target_defaults_parameters.go b/operations/log_target/create_log_target_defaults_parameters.go index be3778fe..cae00239 100644 --- a/operations/log_target/create_log_target_defaults_parameters.go +++ b/operations/log_target/create_log_target_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateLogTargetDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateLogTargetDefaultsParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateLogTargetDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/create_log_target_frontend_parameters.go b/operations/log_target/create_log_target_frontend_parameters.go index a92b211e..16242beb 100644 --- a/operations/log_target/create_log_target_frontend_parameters.go +++ b/operations/log_target/create_log_target_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateLogTargetFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateLogTargetFrontendParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateLogTargetFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/create_log_target_log_forward_parameters.go b/operations/log_target/create_log_target_log_forward_parameters.go index b09d6390..77b44307 100644 --- a/operations/log_target/create_log_target_log_forward_parameters.go +++ b/operations/log_target/create_log_target_log_forward_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateLogTargetLogForwardParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateLogTargetLogForwardParams) bindParentName(rawData []string, hasKe // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateLogTargetLogForwardParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/create_log_target_peer_parameters.go b/operations/log_target/create_log_target_peer_parameters.go index df9ae9b5..1222c3d9 100644 --- a/operations/log_target/create_log_target_peer_parameters.go +++ b/operations/log_target/create_log_target_peer_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateLogTargetPeerParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateLogTargetPeerParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateLogTargetPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/delete_log_target_backend_parameters.go b/operations/log_target/delete_log_target_backend_parameters.go index 332c7854..7d712cef 100644 --- a/operations/log_target/delete_log_target_backend_parameters.go +++ b/operations/log_target/delete_log_target_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteLogTargetBackendParams creates a new DeleteLogTargetBackendParams object @@ -66,6 +67,7 @@ type DeleteLogTargetBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteLogTargetBackendParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteLogTargetBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/delete_log_target_defaults_parameters.go b/operations/log_target/delete_log_target_defaults_parameters.go index f15f4784..bbb16883 100644 --- a/operations/log_target/delete_log_target_defaults_parameters.go +++ b/operations/log_target/delete_log_target_defaults_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteLogTargetDefaultsParams creates a new DeleteLogTargetDefaultsParams object @@ -66,6 +67,7 @@ type DeleteLogTargetDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteLogTargetDefaultsParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteLogTargetDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/delete_log_target_frontend_parameters.go b/operations/log_target/delete_log_target_frontend_parameters.go index 3e346055..ce2560f1 100644 --- a/operations/log_target/delete_log_target_frontend_parameters.go +++ b/operations/log_target/delete_log_target_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteLogTargetFrontendParams creates a new DeleteLogTargetFrontendParams object @@ -66,6 +67,7 @@ type DeleteLogTargetFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteLogTargetFrontendParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteLogTargetFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/delete_log_target_log_forward_parameters.go b/operations/log_target/delete_log_target_log_forward_parameters.go index 14118574..06218c00 100644 --- a/operations/log_target/delete_log_target_log_forward_parameters.go +++ b/operations/log_target/delete_log_target_log_forward_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteLogTargetLogForwardParams creates a new DeleteLogTargetLogForwardParams object @@ -66,6 +67,7 @@ type DeleteLogTargetLogForwardParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteLogTargetLogForwardParams) bindParentName(rawData []string, hasKe // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteLogTargetLogForwardParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/delete_log_target_peer_parameters.go b/operations/log_target/delete_log_target_peer_parameters.go index 9d913948..f2460e69 100644 --- a/operations/log_target/delete_log_target_peer_parameters.go +++ b/operations/log_target/delete_log_target_peer_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteLogTargetPeerParams creates a new DeleteLogTargetPeerParams object @@ -66,6 +67,7 @@ type DeleteLogTargetPeerParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteLogTargetPeerParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteLogTargetPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/get_all_log_target_backend_parameters.go b/operations/log_target/get_all_log_target_backend_parameters.go index b8a6f24c..3e52b153 100644 --- a/operations/log_target/get_all_log_target_backend_parameters.go +++ b/operations/log_target/get_all_log_target_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllLogTargetBackendParams creates a new GetAllLogTargetBackendParams object @@ -48,6 +49,7 @@ type GetAllLogTargetBackendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllLogTargetBackendParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllLogTargetBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/get_all_log_target_defaults_parameters.go b/operations/log_target/get_all_log_target_defaults_parameters.go index 393d187d..467c0430 100644 --- a/operations/log_target/get_all_log_target_defaults_parameters.go +++ b/operations/log_target/get_all_log_target_defaults_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllLogTargetDefaultsParams creates a new GetAllLogTargetDefaultsParams object @@ -48,6 +49,7 @@ type GetAllLogTargetDefaultsParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllLogTargetDefaultsParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllLogTargetDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/get_all_log_target_frontend_parameters.go b/operations/log_target/get_all_log_target_frontend_parameters.go index 3707ca4e..feaa7c93 100644 --- a/operations/log_target/get_all_log_target_frontend_parameters.go +++ b/operations/log_target/get_all_log_target_frontend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllLogTargetFrontendParams creates a new GetAllLogTargetFrontendParams object @@ -48,6 +49,7 @@ type GetAllLogTargetFrontendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllLogTargetFrontendParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllLogTargetFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/get_all_log_target_log_forward_parameters.go b/operations/log_target/get_all_log_target_log_forward_parameters.go index a4fa352a..aeb16fa8 100644 --- a/operations/log_target/get_all_log_target_log_forward_parameters.go +++ b/operations/log_target/get_all_log_target_log_forward_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllLogTargetLogForwardParams creates a new GetAllLogTargetLogForwardParams object @@ -48,6 +49,7 @@ type GetAllLogTargetLogForwardParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllLogTargetLogForwardParams) bindParentName(rawData []string, hasKe // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllLogTargetLogForwardParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/get_all_log_target_peer_parameters.go b/operations/log_target/get_all_log_target_peer_parameters.go index 31c67090..9cba6874 100644 --- a/operations/log_target/get_all_log_target_peer_parameters.go +++ b/operations/log_target/get_all_log_target_peer_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllLogTargetPeerParams creates a new GetAllLogTargetPeerParams object @@ -48,6 +49,7 @@ type GetAllLogTargetPeerParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllLogTargetPeerParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllLogTargetPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/get_log_target_backend_parameters.go b/operations/log_target/get_log_target_backend_parameters.go index 01ea6552..8fe34520 100644 --- a/operations/log_target/get_log_target_backend_parameters.go +++ b/operations/log_target/get_log_target_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetLogTargetBackendParams creates a new GetLogTargetBackendParams object @@ -54,6 +55,7 @@ type GetLogTargetBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetLogTargetBackendParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetLogTargetBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/get_log_target_defaults_parameters.go b/operations/log_target/get_log_target_defaults_parameters.go index f47aaa88..c7b818b0 100644 --- a/operations/log_target/get_log_target_defaults_parameters.go +++ b/operations/log_target/get_log_target_defaults_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetLogTargetDefaultsParams creates a new GetLogTargetDefaultsParams object @@ -54,6 +55,7 @@ type GetLogTargetDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetLogTargetDefaultsParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetLogTargetDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/get_log_target_frontend_parameters.go b/operations/log_target/get_log_target_frontend_parameters.go index 31412579..c83a7f78 100644 --- a/operations/log_target/get_log_target_frontend_parameters.go +++ b/operations/log_target/get_log_target_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetLogTargetFrontendParams creates a new GetLogTargetFrontendParams object @@ -54,6 +55,7 @@ type GetLogTargetFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetLogTargetFrontendParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetLogTargetFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/get_log_target_log_forward_parameters.go b/operations/log_target/get_log_target_log_forward_parameters.go index dfcc8f30..0f4f4d93 100644 --- a/operations/log_target/get_log_target_log_forward_parameters.go +++ b/operations/log_target/get_log_target_log_forward_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetLogTargetLogForwardParams creates a new GetLogTargetLogForwardParams object @@ -54,6 +55,7 @@ type GetLogTargetLogForwardParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetLogTargetLogForwardParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetLogTargetLogForwardParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/get_log_target_peer_parameters.go b/operations/log_target/get_log_target_peer_parameters.go index 27d9a7a4..b5cee8df 100644 --- a/operations/log_target/get_log_target_peer_parameters.go +++ b/operations/log_target/get_log_target_peer_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetLogTargetPeerParams creates a new GetLogTargetPeerParams object @@ -54,6 +55,7 @@ type GetLogTargetPeerParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetLogTargetPeerParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetLogTargetPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/replace_all_log_target_backend_parameters.go b/operations/log_target/replace_all_log_target_backend_parameters.go index ef4dd2f2..18179994 100644 --- a/operations/log_target/replace_all_log_target_backend_parameters.go +++ b/operations/log_target/replace_all_log_target_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllLogTargetBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllLogTargetBackendParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllLogTargetBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/replace_all_log_target_defaults_parameters.go b/operations/log_target/replace_all_log_target_defaults_parameters.go index 3a5c341a..c03bfa8d 100644 --- a/operations/log_target/replace_all_log_target_defaults_parameters.go +++ b/operations/log_target/replace_all_log_target_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllLogTargetDefaultsParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllLogTargetDefaultsParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllLogTargetDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/replace_all_log_target_frontend_parameters.go b/operations/log_target/replace_all_log_target_frontend_parameters.go index f0d87f43..503e859d 100644 --- a/operations/log_target/replace_all_log_target_frontend_parameters.go +++ b/operations/log_target/replace_all_log_target_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllLogTargetFrontendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllLogTargetFrontendParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllLogTargetFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/replace_all_log_target_log_forward_parameters.go b/operations/log_target/replace_all_log_target_log_forward_parameters.go index 39b16410..9f0db41a 100644 --- a/operations/log_target/replace_all_log_target_log_forward_parameters.go +++ b/operations/log_target/replace_all_log_target_log_forward_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllLogTargetLogForwardParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllLogTargetLogForwardParams) bindParentName(rawData []string, h // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllLogTargetLogForwardParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/replace_all_log_target_peer_parameters.go b/operations/log_target/replace_all_log_target_peer_parameters.go index c5ae7f2e..91dc775b 100644 --- a/operations/log_target/replace_all_log_target_peer_parameters.go +++ b/operations/log_target/replace_all_log_target_peer_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllLogTargetPeerParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllLogTargetPeerParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllLogTargetPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/replace_log_target_backend_parameters.go b/operations/log_target/replace_log_target_backend_parameters.go index 41bc5ff0..f008cf82 100644 --- a/operations/log_target/replace_log_target_backend_parameters.go +++ b/operations/log_target/replace_log_target_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceLogTargetBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceLogTargetBackendParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceLogTargetBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/replace_log_target_defaults_parameters.go b/operations/log_target/replace_log_target_defaults_parameters.go index 4236fbdb..e0eecfc8 100644 --- a/operations/log_target/replace_log_target_defaults_parameters.go +++ b/operations/log_target/replace_log_target_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceLogTargetDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceLogTargetDefaultsParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceLogTargetDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/replace_log_target_frontend_parameters.go b/operations/log_target/replace_log_target_frontend_parameters.go index f67f2b9e..486d5452 100644 --- a/operations/log_target/replace_log_target_frontend_parameters.go +++ b/operations/log_target/replace_log_target_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceLogTargetFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceLogTargetFrontendParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceLogTargetFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/replace_log_target_log_forward_parameters.go b/operations/log_target/replace_log_target_log_forward_parameters.go index 6cf285b4..371e3284 100644 --- a/operations/log_target/replace_log_target_log_forward_parameters.go +++ b/operations/log_target/replace_log_target_log_forward_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceLogTargetLogForwardParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceLogTargetLogForwardParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceLogTargetLogForwardParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/log_target/replace_log_target_peer_parameters.go b/operations/log_target/replace_log_target_peer_parameters.go index 1814733a..8de69326 100644 --- a/operations/log_target/replace_log_target_peer_parameters.go +++ b/operations/log_target/replace_log_target_peer_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceLogTargetPeerParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceLogTargetPeerParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceLogTargetPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/maps/add_map_entry_parameters.go b/operations/maps/add_map_entry_parameters.go index 42fe282f..4ca0afcb 100644 --- a/operations/maps/add_map_entry_parameters.go +++ b/operations/maps/add_map_entry_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type AddMapEntryParams struct { ForceSync *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -158,5 +160,19 @@ func (o *AddMapEntryParams) bindParentName(rawData []string, hasKey bool, format // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *AddMapEntryParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/maps/add_payload_runtime_map_parameters.go b/operations/maps/add_payload_runtime_map_parameters.go index 3d7600f5..769a0e79 100644 --- a/operations/maps/add_payload_runtime_map_parameters.go +++ b/operations/maps/add_payload_runtime_map_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type AddPayloadRuntimeMapParams struct { ForceSync *bool /*Map file name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ Name string @@ -158,5 +160,19 @@ func (o *AddPayloadRuntimeMapParams) bindName(rawData []string, hasKey bool, for // Parameter is provided by construction from the route o.Name = raw + if err := o.validateName(formats); err != nil { + return err + } + + return nil +} + +// validateName carries on validations for parameter Name +func (o *AddPayloadRuntimeMapParams) validateName(formats strfmt.Registry) error { + + if err := validate.Pattern("name", "path", o.Name, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/maps/clear_runtime_map_parameters.go b/operations/maps/clear_runtime_map_parameters.go index f7ff5e02..7e1af377 100644 --- a/operations/maps/clear_runtime_map_parameters.go +++ b/operations/maps/clear_runtime_map_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewClearRuntimeMapParams creates a new ClearRuntimeMapParams object @@ -65,6 +66,7 @@ type ClearRuntimeMapParams struct { ForceSync *bool /*Map file name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ Name string @@ -159,5 +161,19 @@ func (o *ClearRuntimeMapParams) bindName(rawData []string, hasKey bool, formats // Parameter is provided by construction from the route o.Name = raw + if err := o.validateName(formats); err != nil { + return err + } + + return nil +} + +// validateName carries on validations for parameter Name +func (o *ClearRuntimeMapParams) validateName(formats strfmt.Registry) error { + + if err := validate.Pattern("name", "path", o.Name, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/maps/delete_runtime_map_entry_parameters.go b/operations/maps/delete_runtime_map_entry_parameters.go index bc360d5d..9e4ee0ee 100644 --- a/operations/maps/delete_runtime_map_entry_parameters.go +++ b/operations/maps/delete_runtime_map_entry_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteRuntimeMapEntryParams creates a new DeleteRuntimeMapEntryParams object @@ -61,11 +62,13 @@ type DeleteRuntimeMapEntryParams struct { ForceSync *bool /*Map id Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ID string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -137,6 +140,20 @@ func (o *DeleteRuntimeMapEntryParams) bindID(rawData []string, hasKey bool, form // Parameter is provided by construction from the route o.ID = raw + if err := o.validateID(formats); err != nil { + return err + } + + return nil +} + +// validateID carries on validations for parameter ID +func (o *DeleteRuntimeMapEntryParams) validateID(formats strfmt.Registry) error { + + if err := validate.Pattern("id", "path", o.ID, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } @@ -151,5 +168,19 @@ func (o *DeleteRuntimeMapEntryParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteRuntimeMapEntryParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/maps/get_one_runtime_map_parameters.go b/operations/maps/get_one_runtime_map_parameters.go index 3805121e..b705bf12 100644 --- a/operations/maps/get_one_runtime_map_parameters.go +++ b/operations/maps/get_one_runtime_map_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetOneRuntimeMapParams creates a new GetOneRuntimeMapParams object @@ -47,6 +48,7 @@ type GetOneRuntimeMapParams struct { /*Map file name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ Name string @@ -82,5 +84,19 @@ func (o *GetOneRuntimeMapParams) bindName(rawData []string, hasKey bool, formats // Parameter is provided by construction from the route o.Name = raw + if err := o.validateName(formats); err != nil { + return err + } + + return nil +} + +// validateName carries on validations for parameter Name +func (o *GetOneRuntimeMapParams) validateName(formats strfmt.Registry) error { + + if err := validate.Pattern("name", "path", o.Name, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/maps/get_runtime_map_entry_parameters.go b/operations/maps/get_runtime_map_entry_parameters.go index 99f67a04..a6ae472c 100644 --- a/operations/maps/get_runtime_map_entry_parameters.go +++ b/operations/maps/get_runtime_map_entry_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetRuntimeMapEntryParams creates a new GetRuntimeMapEntryParams object @@ -47,11 +48,13 @@ type GetRuntimeMapEntryParams struct { /*Map id Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ID string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -92,6 +95,20 @@ func (o *GetRuntimeMapEntryParams) bindID(rawData []string, hasKey bool, formats // Parameter is provided by construction from the route o.ID = raw + if err := o.validateID(formats); err != nil { + return err + } + + return nil +} + +// validateID carries on validations for parameter ID +func (o *GetRuntimeMapEntryParams) validateID(formats strfmt.Registry) error { + + if err := validate.Pattern("id", "path", o.ID, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } @@ -106,5 +123,19 @@ func (o *GetRuntimeMapEntryParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetRuntimeMapEntryParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/maps/replace_runtime_map_entry_parameters.go b/operations/maps/replace_runtime_map_entry_parameters.go index 2c6d3eeb..d46cfb5d 100644 --- a/operations/maps/replace_runtime_map_entry_parameters.go +++ b/operations/maps/replace_runtime_map_entry_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewReplaceRuntimeMapEntryParams creates a new ReplaceRuntimeMapEntryParams object @@ -67,11 +68,13 @@ type ReplaceRuntimeMapEntryParams struct { ForceSync *bool /*Map id Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ID string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -166,6 +169,20 @@ func (o *ReplaceRuntimeMapEntryParams) bindID(rawData []string, hasKey bool, for // Parameter is provided by construction from the route o.ID = raw + if err := o.validateID(formats); err != nil { + return err + } + + return nil +} + +// validateID carries on validations for parameter ID +func (o *ReplaceRuntimeMapEntryParams) validateID(formats strfmt.Registry) error { + + if err := validate.Pattern("id", "path", o.ID, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } @@ -180,5 +197,19 @@ func (o *ReplaceRuntimeMapEntryParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceRuntimeMapEntryParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/maps/show_runtime_map_parameters.go b/operations/maps/show_runtime_map_parameters.go index 1448e28b..a747c5a0 100644 --- a/operations/maps/show_runtime_map_parameters.go +++ b/operations/maps/show_runtime_map_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewShowRuntimeMapParams creates a new ShowRuntimeMapParams object @@ -47,6 +48,7 @@ type ShowRuntimeMapParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -82,5 +84,19 @@ func (o *ShowRuntimeMapParams) bindParentName(rawData []string, hasKey bool, for // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ShowRuntimeMapParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/add_runtime_server_parameters.go b/operations/server/add_runtime_server_parameters.go index 279d8777..94b7b1f2 100644 --- a/operations/server/add_runtime_server_parameters.go +++ b/operations/server/add_runtime_server_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -56,6 +57,7 @@ type AddRuntimeServerParams struct { Data *models.RuntimeAddServer /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -114,5 +116,19 @@ func (o *AddRuntimeServerParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *AddRuntimeServerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/create_server_backend_parameters.go b/operations/server/create_server_backend_parameters.go index b09ed44a..b28f7bda 100644 --- a/operations/server/create_server_backend_parameters.go +++ b/operations/server/create_server_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type CreateServerBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *CreateServerBackendParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateServerBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/create_server_peer_parameters.go b/operations/server/create_server_peer_parameters.go index 2b37d5da..1aed15f1 100644 --- a/operations/server/create_server_peer_parameters.go +++ b/operations/server/create_server_peer_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type CreateServerPeerParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *CreateServerPeerParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateServerPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/create_server_ring_parameters.go b/operations/server/create_server_ring_parameters.go index e3683e1f..1bc6ae44 100644 --- a/operations/server/create_server_ring_parameters.go +++ b/operations/server/create_server_ring_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type CreateServerRingParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *CreateServerRingParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateServerRingParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/delete_runtime_server_parameters.go b/operations/server/delete_runtime_server_parameters.go index ec68099b..0515b863 100644 --- a/operations/server/delete_runtime_server_parameters.go +++ b/operations/server/delete_runtime_server_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewDeleteRuntimeServerParams creates a new DeleteRuntimeServerParams object @@ -47,11 +48,13 @@ type DeleteRuntimeServerParams struct { /*Server name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -92,6 +95,20 @@ func (o *DeleteRuntimeServerParams) bindName(rawData []string, hasKey bool, form // Parameter is provided by construction from the route o.Name = raw + if err := o.validateName(formats); err != nil { + return err + } + + return nil +} + +// validateName carries on validations for parameter Name +func (o *DeleteRuntimeServerParams) validateName(formats strfmt.Registry) error { + + if err := validate.Pattern("name", "path", o.Name, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } @@ -106,5 +123,19 @@ func (o *DeleteRuntimeServerParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteRuntimeServerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/delete_server_backend_parameters.go b/operations/server/delete_server_backend_parameters.go index d6b2c147..9872c57a 100644 --- a/operations/server/delete_server_backend_parameters.go +++ b/operations/server/delete_server_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteServerBackendParams creates a new DeleteServerBackendParams object @@ -66,6 +67,7 @@ type DeleteServerBackendParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -169,6 +171,20 @@ func (o *DeleteServerBackendParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteServerBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/delete_server_peer_parameters.go b/operations/server/delete_server_peer_parameters.go index 82d2f6d9..9145d395 100644 --- a/operations/server/delete_server_peer_parameters.go +++ b/operations/server/delete_server_peer_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteServerPeerParams creates a new DeleteServerPeerParams object @@ -66,6 +67,7 @@ type DeleteServerPeerParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -169,6 +171,20 @@ func (o *DeleteServerPeerParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteServerPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/delete_server_ring_parameters.go b/operations/server/delete_server_ring_parameters.go index 50207734..8fb2fc89 100644 --- a/operations/server/delete_server_ring_parameters.go +++ b/operations/server/delete_server_ring_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteServerRingParams creates a new DeleteServerRingParams object @@ -66,6 +67,7 @@ type DeleteServerRingParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -169,6 +171,20 @@ func (o *DeleteServerRingParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteServerRingParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/get_all_runtime_server_parameters.go b/operations/server/get_all_runtime_server_parameters.go index 3694a36c..7b94f93c 100644 --- a/operations/server/get_all_runtime_server_parameters.go +++ b/operations/server/get_all_runtime_server_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllRuntimeServerParams creates a new GetAllRuntimeServerParams object @@ -47,6 +48,7 @@ type GetAllRuntimeServerParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -82,5 +84,19 @@ func (o *GetAllRuntimeServerParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllRuntimeServerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/get_all_server_backend_parameters.go b/operations/server/get_all_server_backend_parameters.go index 90a9b74a..bae343a5 100644 --- a/operations/server/get_all_server_backend_parameters.go +++ b/operations/server/get_all_server_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllServerBackendParams creates a new GetAllServerBackendParams object @@ -48,6 +49,7 @@ type GetAllServerBackendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllServerBackendParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllServerBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/get_all_server_peer_parameters.go b/operations/server/get_all_server_peer_parameters.go index acad0f2a..bff9e260 100644 --- a/operations/server/get_all_server_peer_parameters.go +++ b/operations/server/get_all_server_peer_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllServerPeerParams creates a new GetAllServerPeerParams object @@ -48,6 +49,7 @@ type GetAllServerPeerParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllServerPeerParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllServerPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/get_all_server_ring_parameters.go b/operations/server/get_all_server_ring_parameters.go index 260cf427..aee35be5 100644 --- a/operations/server/get_all_server_ring_parameters.go +++ b/operations/server/get_all_server_ring_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllServerRingParams creates a new GetAllServerRingParams object @@ -48,6 +49,7 @@ type GetAllServerRingParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllServerRingParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllServerRingParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/get_runtime_server_parameters.go b/operations/server/get_runtime_server_parameters.go index fbf48706..58bec938 100644 --- a/operations/server/get_runtime_server_parameters.go +++ b/operations/server/get_runtime_server_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetRuntimeServerParams creates a new GetRuntimeServerParams object @@ -47,11 +48,13 @@ type GetRuntimeServerParams struct { /*Server name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -92,6 +95,20 @@ func (o *GetRuntimeServerParams) bindName(rawData []string, hasKey bool, formats // Parameter is provided by construction from the route o.Name = raw + if err := o.validateName(formats); err != nil { + return err + } + + return nil +} + +// validateName carries on validations for parameter Name +func (o *GetRuntimeServerParams) validateName(formats strfmt.Registry) error { + + if err := validate.Pattern("name", "path", o.Name, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } @@ -106,5 +123,19 @@ func (o *GetRuntimeServerParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetRuntimeServerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/get_server_backend_parameters.go b/operations/server/get_server_backend_parameters.go index 9db9eae2..df538727 100644 --- a/operations/server/get_server_backend_parameters.go +++ b/operations/server/get_server_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetServerBackendParams creates a new GetServerBackendParams object @@ -53,6 +54,7 @@ type GetServerBackendParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -118,6 +120,20 @@ func (o *GetServerBackendParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetServerBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/get_server_peer_parameters.go b/operations/server/get_server_peer_parameters.go index 314b5649..9cb0bad9 100644 --- a/operations/server/get_server_peer_parameters.go +++ b/operations/server/get_server_peer_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetServerPeerParams creates a new GetServerPeerParams object @@ -53,6 +54,7 @@ type GetServerPeerParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -118,6 +120,20 @@ func (o *GetServerPeerParams) bindParentName(rawData []string, hasKey bool, form // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetServerPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/get_server_ring_parameters.go b/operations/server/get_server_ring_parameters.go index ebf089f3..3116cab4 100644 --- a/operations/server/get_server_ring_parameters.go +++ b/operations/server/get_server_ring_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetServerRingParams creates a new GetServerRingParams object @@ -53,6 +54,7 @@ type GetServerRingParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -118,6 +120,20 @@ func (o *GetServerRingParams) bindParentName(rawData []string, hasKey bool, form // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetServerRingParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/replace_runtime_server_parameters.go b/operations/server/replace_runtime_server_parameters.go index 21fd8a27..12c0d076 100644 --- a/operations/server/replace_runtime_server_parameters.go +++ b/operations/server/replace_runtime_server_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -56,11 +57,13 @@ type ReplaceRuntimeServerParams struct { Data *models.RuntimeServer /*Server name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +127,20 @@ func (o *ReplaceRuntimeServerParams) bindName(rawData []string, hasKey bool, for // Parameter is provided by construction from the route o.Name = raw + if err := o.validateName(formats); err != nil { + return err + } + + return nil +} + +// validateName carries on validations for parameter Name +func (o *ReplaceRuntimeServerParams) validateName(formats strfmt.Registry) error { + + if err := validate.Pattern("name", "path", o.Name, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } @@ -138,5 +155,19 @@ func (o *ReplaceRuntimeServerParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceRuntimeServerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/replace_server_backend_parameters.go b/operations/server/replace_server_backend_parameters.go index 816221fb..b8679871 100644 --- a/operations/server/replace_server_backend_parameters.go +++ b/operations/server/replace_server_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceServerBackendParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -200,6 +202,20 @@ func (o *ReplaceServerBackendParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceServerBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/replace_server_peer_parameters.go b/operations/server/replace_server_peer_parameters.go index 8149b2de..5172a948 100644 --- a/operations/server/replace_server_peer_parameters.go +++ b/operations/server/replace_server_peer_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceServerPeerParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -200,6 +202,20 @@ func (o *ReplaceServerPeerParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceServerPeerParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server/replace_server_ring_parameters.go b/operations/server/replace_server_ring_parameters.go index 542aa0fc..827389f7 100644 --- a/operations/server/replace_server_ring_parameters.go +++ b/operations/server/replace_server_ring_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceServerRingParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -200,6 +202,20 @@ func (o *ReplaceServerRingParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceServerRingParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server_switching_rule/create_server_switching_rule_parameters.go b/operations/server_switching_rule/create_server_switching_rule_parameters.go index d9db693a..2c93d947 100644 --- a/operations/server_switching_rule/create_server_switching_rule_parameters.go +++ b/operations/server_switching_rule/create_server_switching_rule_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateServerSwitchingRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateServerSwitchingRuleParams) bindParentName(rawData []string, hasKe // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateServerSwitchingRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server_switching_rule/delete_server_switching_rule_parameters.go b/operations/server_switching_rule/delete_server_switching_rule_parameters.go index 9524aabf..fe908ee1 100644 --- a/operations/server_switching_rule/delete_server_switching_rule_parameters.go +++ b/operations/server_switching_rule/delete_server_switching_rule_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteServerSwitchingRuleParams creates a new DeleteServerSwitchingRuleParams object @@ -66,6 +67,7 @@ type DeleteServerSwitchingRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteServerSwitchingRuleParams) bindParentName(rawData []string, hasKe // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteServerSwitchingRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server_switching_rule/get_server_switching_rule_parameters.go b/operations/server_switching_rule/get_server_switching_rule_parameters.go index b2060b50..b8eec247 100644 --- a/operations/server_switching_rule/get_server_switching_rule_parameters.go +++ b/operations/server_switching_rule/get_server_switching_rule_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetServerSwitchingRuleParams creates a new GetServerSwitchingRuleParams object @@ -54,6 +55,7 @@ type GetServerSwitchingRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetServerSwitchingRuleParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetServerSwitchingRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server_switching_rule/get_server_switching_rules_parameters.go b/operations/server_switching_rule/get_server_switching_rules_parameters.go index b5ef8ec4..17fd10d9 100644 --- a/operations/server_switching_rule/get_server_switching_rules_parameters.go +++ b/operations/server_switching_rule/get_server_switching_rules_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetServerSwitchingRulesParams creates a new GetServerSwitchingRulesParams object @@ -48,6 +49,7 @@ type GetServerSwitchingRulesParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetServerSwitchingRulesParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetServerSwitchingRulesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server_switching_rule/replace_server_switching_rule_parameters.go b/operations/server_switching_rule/replace_server_switching_rule_parameters.go index 5b138025..c0c922e3 100644 --- a/operations/server_switching_rule/replace_server_switching_rule_parameters.go +++ b/operations/server_switching_rule/replace_server_switching_rule_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceServerSwitchingRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceServerSwitchingRuleParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceServerSwitchingRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server_switching_rule/replace_server_switching_rules_parameters.go b/operations/server_switching_rule/replace_server_switching_rules_parameters.go index 2dcfd584..b34dcc25 100644 --- a/operations/server_switching_rule/replace_server_switching_rules_parameters.go +++ b/operations/server_switching_rule/replace_server_switching_rules_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceServerSwitchingRulesParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceServerSwitchingRulesParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceServerSwitchingRulesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server_template/create_server_template_parameters.go b/operations/server_template/create_server_template_parameters.go index 96e43990..4218d629 100644 --- a/operations/server_template/create_server_template_parameters.go +++ b/operations/server_template/create_server_template_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type CreateServerTemplateParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *CreateServerTemplateParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateServerTemplateParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server_template/delete_server_template_parameters.go b/operations/server_template/delete_server_template_parameters.go index 174599c1..327110c6 100644 --- a/operations/server_template/delete_server_template_parameters.go +++ b/operations/server_template/delete_server_template_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteServerTemplateParams creates a new DeleteServerTemplateParams object @@ -61,6 +62,7 @@ type DeleteServerTemplateParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -155,6 +157,20 @@ func (o *DeleteServerTemplateParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteServerTemplateParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server_template/get_server_template_parameters.go b/operations/server_template/get_server_template_parameters.go index e7925320..c8c59a75 100644 --- a/operations/server_template/get_server_template_parameters.go +++ b/operations/server_template/get_server_template_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetServerTemplateParams creates a new GetServerTemplateParams object @@ -48,6 +49,7 @@ type GetServerTemplateParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -104,6 +106,20 @@ func (o *GetServerTemplateParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetServerTemplateParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server_template/get_server_templates_parameters.go b/operations/server_template/get_server_templates_parameters.go index 06b3a7c3..23952d7c 100644 --- a/operations/server_template/get_server_templates_parameters.go +++ b/operations/server_template/get_server_templates_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetServerTemplatesParams creates a new GetServerTemplatesParams object @@ -48,6 +49,7 @@ type GetServerTemplatesParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetServerTemplatesParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetServerTemplatesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/server_template/replace_server_template_parameters.go b/operations/server_template/replace_server_template_parameters.go index 01aa8802..a4bf1a44 100644 --- a/operations/server_template/replace_server_template_parameters.go +++ b/operations/server_template/replace_server_template_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceServerTemplateParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -186,6 +188,20 @@ func (o *ReplaceServerTemplateParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceServerTemplateParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/create_spoe_agent_parameters.go b/operations/spoe/create_spoe_agent_parameters.go index f5b6011f..034c7994 100644 --- a/operations/spoe/create_spoe_agent_parameters.go +++ b/operations/spoe/create_spoe_agent_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -57,6 +58,7 @@ type CreateSpoeAgentParams struct { Data *models.SpoeAgent /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -145,6 +147,20 @@ func (o *CreateSpoeAgentParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateSpoeAgentParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/create_spoe_group_parameters.go b/operations/spoe/create_spoe_group_parameters.go index 68c6fbd8..74fcea5b 100644 --- a/operations/spoe/create_spoe_group_parameters.go +++ b/operations/spoe/create_spoe_group_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -57,6 +58,7 @@ type CreateSpoeGroupParams struct { Data *models.SpoeGroup /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -145,6 +147,20 @@ func (o *CreateSpoeGroupParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateSpoeGroupParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/create_spoe_message_parameters.go b/operations/spoe/create_spoe_message_parameters.go index e40e8c7f..169f0811 100644 --- a/operations/spoe/create_spoe_message_parameters.go +++ b/operations/spoe/create_spoe_message_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -57,6 +58,7 @@ type CreateSpoeMessageParams struct { Data *models.SpoeMessage /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -145,6 +147,20 @@ func (o *CreateSpoeMessageParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateSpoeMessageParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/create_spoe_scope_parameters.go b/operations/spoe/create_spoe_scope_parameters.go index 271c52db..69685581 100644 --- a/operations/spoe/create_spoe_scope_parameters.go +++ b/operations/spoe/create_spoe_scope_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -57,6 +58,7 @@ type CreateSpoeScopeParams struct { Data models.SpoeScope /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -135,6 +137,20 @@ func (o *CreateSpoeScopeParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateSpoeScopeParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/delete_spoe_agent_parameters.go b/operations/spoe/delete_spoe_agent_parameters.go index edd90454..c4422c59 100644 --- a/operations/spoe/delete_spoe_agent_parameters.go +++ b/operations/spoe/delete_spoe_agent_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteSpoeAgentParams creates a new DeleteSpoeAgentParams object @@ -54,6 +55,7 @@ type DeleteSpoeAgentParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -138,6 +140,20 @@ func (o *DeleteSpoeAgentParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteSpoeAgentParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/delete_spoe_group_parameters.go b/operations/spoe/delete_spoe_group_parameters.go index 640fffbf..316b6da7 100644 --- a/operations/spoe/delete_spoe_group_parameters.go +++ b/operations/spoe/delete_spoe_group_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteSpoeGroupParams creates a new DeleteSpoeGroupParams object @@ -54,6 +55,7 @@ type DeleteSpoeGroupParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -138,6 +140,20 @@ func (o *DeleteSpoeGroupParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteSpoeGroupParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/delete_spoe_message_parameters.go b/operations/spoe/delete_spoe_message_parameters.go index b5d25b11..7b669068 100644 --- a/operations/spoe/delete_spoe_message_parameters.go +++ b/operations/spoe/delete_spoe_message_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteSpoeMessageParams creates a new DeleteSpoeMessageParams object @@ -54,6 +55,7 @@ type DeleteSpoeMessageParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -138,6 +140,20 @@ func (o *DeleteSpoeMessageParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteSpoeMessageParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/delete_spoe_scope_parameters.go b/operations/spoe/delete_spoe_scope_parameters.go index d4a3423b..4d49094e 100644 --- a/operations/spoe/delete_spoe_scope_parameters.go +++ b/operations/spoe/delete_spoe_scope_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteSpoeScopeParams creates a new DeleteSpoeScopeParams object @@ -54,6 +55,7 @@ type DeleteSpoeScopeParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -128,6 +130,20 @@ func (o *DeleteSpoeScopeParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteSpoeScopeParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/get_all_spoe_agent_parameters.go b/operations/spoe/get_all_spoe_agent_parameters.go index 2d3c4e52..423faef3 100644 --- a/operations/spoe/get_all_spoe_agent_parameters.go +++ b/operations/spoe/get_all_spoe_agent_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllSpoeAgentParams creates a new GetAllSpoeAgentParams object @@ -48,6 +49,7 @@ type GetAllSpoeAgentParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -104,6 +106,20 @@ func (o *GetAllSpoeAgentParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllSpoeAgentParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/get_all_spoe_group_parameters.go b/operations/spoe/get_all_spoe_group_parameters.go index 115dc82c..18a0e017 100644 --- a/operations/spoe/get_all_spoe_group_parameters.go +++ b/operations/spoe/get_all_spoe_group_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllSpoeGroupParams creates a new GetAllSpoeGroupParams object @@ -48,6 +49,7 @@ type GetAllSpoeGroupParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -104,6 +106,20 @@ func (o *GetAllSpoeGroupParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllSpoeGroupParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/get_all_spoe_message_parameters.go b/operations/spoe/get_all_spoe_message_parameters.go index 97d1f285..b80f1a53 100644 --- a/operations/spoe/get_all_spoe_message_parameters.go +++ b/operations/spoe/get_all_spoe_message_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllSpoeMessageParams creates a new GetAllSpoeMessageParams object @@ -48,6 +49,7 @@ type GetAllSpoeMessageParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -104,6 +106,20 @@ func (o *GetAllSpoeMessageParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllSpoeMessageParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/get_all_spoe_scope_parameters.go b/operations/spoe/get_all_spoe_scope_parameters.go index 7a59fb33..5e56d058 100644 --- a/operations/spoe/get_all_spoe_scope_parameters.go +++ b/operations/spoe/get_all_spoe_scope_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllSpoeScopeParams creates a new GetAllSpoeScopeParams object @@ -48,6 +49,7 @@ type GetAllSpoeScopeParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllSpoeScopeParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllSpoeScopeParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/get_spoe_agent_parameters.go b/operations/spoe/get_spoe_agent_parameters.go index 1b3115bf..0fba4b05 100644 --- a/operations/spoe/get_spoe_agent_parameters.go +++ b/operations/spoe/get_spoe_agent_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetSpoeAgentParams creates a new GetSpoeAgentParams object @@ -53,6 +54,7 @@ type GetSpoeAgentParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -128,6 +130,20 @@ func (o *GetSpoeAgentParams) bindParentName(rawData []string, hasKey bool, forma // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetSpoeAgentParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/get_spoe_configuration_version_parameters.go b/operations/spoe/get_spoe_configuration_version_parameters.go index b1fe0cb0..ec84d164 100644 --- a/operations/spoe/get_spoe_configuration_version_parameters.go +++ b/operations/spoe/get_spoe_configuration_version_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetSpoeConfigurationVersionParams creates a new GetSpoeConfigurationVersionParams object @@ -48,6 +49,7 @@ type GetSpoeConfigurationVersionParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetSpoeConfigurationVersionParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetSpoeConfigurationVersionParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/get_spoe_group_parameters.go b/operations/spoe/get_spoe_group_parameters.go index e239498b..2790fe56 100644 --- a/operations/spoe/get_spoe_group_parameters.go +++ b/operations/spoe/get_spoe_group_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetSpoeGroupParams creates a new GetSpoeGroupParams object @@ -53,6 +54,7 @@ type GetSpoeGroupParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -128,6 +130,20 @@ func (o *GetSpoeGroupParams) bindParentName(rawData []string, hasKey bool, forma // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetSpoeGroupParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/get_spoe_message_parameters.go b/operations/spoe/get_spoe_message_parameters.go index adc0c956..cad1e323 100644 --- a/operations/spoe/get_spoe_message_parameters.go +++ b/operations/spoe/get_spoe_message_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetSpoeMessageParams creates a new GetSpoeMessageParams object @@ -53,6 +54,7 @@ type GetSpoeMessageParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -128,6 +130,20 @@ func (o *GetSpoeMessageParams) bindParentName(rawData []string, hasKey bool, for // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetSpoeMessageParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/get_spoe_scope_parameters.go b/operations/spoe/get_spoe_scope_parameters.go index 9de86820..53f188e3 100644 --- a/operations/spoe/get_spoe_scope_parameters.go +++ b/operations/spoe/get_spoe_scope_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetSpoeScopeParams creates a new GetSpoeScopeParams object @@ -53,6 +54,7 @@ type GetSpoeScopeParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -118,6 +120,20 @@ func (o *GetSpoeScopeParams) bindParentName(rawData []string, hasKey bool, forma // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetSpoeScopeParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/replace_spoe_agent_parameters.go b/operations/spoe/replace_spoe_agent_parameters.go index c75dd592..fa4dad3a 100644 --- a/operations/spoe/replace_spoe_agent_parameters.go +++ b/operations/spoe/replace_spoe_agent_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -62,6 +63,7 @@ type ReplaceSpoeAgentParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -169,6 +171,20 @@ func (o *ReplaceSpoeAgentParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceSpoeAgentParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/replace_spoe_group_parameters.go b/operations/spoe/replace_spoe_group_parameters.go index 886eb744..80ec1c73 100644 --- a/operations/spoe/replace_spoe_group_parameters.go +++ b/operations/spoe/replace_spoe_group_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -62,6 +63,7 @@ type ReplaceSpoeGroupParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -169,6 +171,20 @@ func (o *ReplaceSpoeGroupParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceSpoeGroupParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe/replace_spoe_message_parameters.go b/operations/spoe/replace_spoe_message_parameters.go index 62ff7eff..0116b744 100644 --- a/operations/spoe/replace_spoe_message_parameters.go +++ b/operations/spoe/replace_spoe_message_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -62,6 +63,7 @@ type ReplaceSpoeMessageParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -169,6 +171,20 @@ func (o *ReplaceSpoeMessageParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceSpoeMessageParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe_transactions/commit_spoe_transaction_parameters.go b/operations/spoe_transactions/commit_spoe_transaction_parameters.go index 4b800638..48e681ce 100644 --- a/operations/spoe_transactions/commit_spoe_transaction_parameters.go +++ b/operations/spoe_transactions/commit_spoe_transaction_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewCommitSpoeTransactionParams creates a new CommitSpoeTransactionParams object @@ -66,6 +67,7 @@ type CommitSpoeTransactionParams struct { ID string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -151,5 +153,19 @@ func (o *CommitSpoeTransactionParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CommitSpoeTransactionParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe_transactions/delete_spoe_transaction_parameters.go b/operations/spoe_transactions/delete_spoe_transaction_parameters.go index 87e2a78f..0966dc70 100644 --- a/operations/spoe_transactions/delete_spoe_transaction_parameters.go +++ b/operations/spoe_transactions/delete_spoe_transaction_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewDeleteSpoeTransactionParams creates a new DeleteSpoeTransactionParams object @@ -52,6 +53,7 @@ type DeleteSpoeTransactionParams struct { ID string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -106,5 +108,19 @@ func (o *DeleteSpoeTransactionParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteSpoeTransactionParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe_transactions/get_all_spoe_transaction_parameters.go b/operations/spoe_transactions/get_all_spoe_transaction_parameters.go index a8f271ce..4235375f 100644 --- a/operations/spoe_transactions/get_all_spoe_transaction_parameters.go +++ b/operations/spoe_transactions/get_all_spoe_transaction_parameters.go @@ -49,6 +49,7 @@ type GetAllSpoeTransactionParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -95,6 +96,20 @@ func (o *GetAllSpoeTransactionParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllSpoeTransactionParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe_transactions/get_spoe_transaction_parameters.go b/operations/spoe_transactions/get_spoe_transaction_parameters.go index 57e33f8d..272d84fa 100644 --- a/operations/spoe_transactions/get_spoe_transaction_parameters.go +++ b/operations/spoe_transactions/get_spoe_transaction_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetSpoeTransactionParams creates a new GetSpoeTransactionParams object @@ -52,6 +53,7 @@ type GetSpoeTransactionParams struct { ID string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -106,5 +108,19 @@ func (o *GetSpoeTransactionParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetSpoeTransactionParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/spoe_transactions/start_spoe_transaction_parameters.go b/operations/spoe_transactions/start_spoe_transaction_parameters.go index 17791634..a441ca9a 100644 --- a/operations/spoe_transactions/start_spoe_transaction_parameters.go +++ b/operations/spoe_transactions/start_spoe_transaction_parameters.go @@ -50,6 +50,7 @@ type StartSpoeTransactionParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -97,6 +98,20 @@ func (o *StartSpoeTransactionParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *StartSpoeTransactionParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/stick_rule/create_stick_rule_parameters.go b/operations/stick_rule/create_stick_rule_parameters.go index e24c1b04..8e988ef9 100644 --- a/operations/stick_rule/create_stick_rule_parameters.go +++ b/operations/stick_rule/create_stick_rule_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateStickRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateStickRuleParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateStickRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/stick_rule/delete_stick_rule_parameters.go b/operations/stick_rule/delete_stick_rule_parameters.go index bff42efe..517757e1 100644 --- a/operations/stick_rule/delete_stick_rule_parameters.go +++ b/operations/stick_rule/delete_stick_rule_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteStickRuleParams creates a new DeleteStickRuleParams object @@ -66,6 +67,7 @@ type DeleteStickRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteStickRuleParams) bindParentName(rawData []string, hasKey bool, fo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteStickRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/stick_rule/get_stick_rule_parameters.go b/operations/stick_rule/get_stick_rule_parameters.go index 952dfd31..0136150c 100644 --- a/operations/stick_rule/get_stick_rule_parameters.go +++ b/operations/stick_rule/get_stick_rule_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetStickRuleParams creates a new GetStickRuleParams object @@ -54,6 +55,7 @@ type GetStickRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetStickRuleParams) bindParentName(rawData []string, hasKey bool, forma // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetStickRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/stick_rule/get_stick_rules_parameters.go b/operations/stick_rule/get_stick_rules_parameters.go index 0e77aeb3..dcf5332a 100644 --- a/operations/stick_rule/get_stick_rules_parameters.go +++ b/operations/stick_rule/get_stick_rules_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetStickRulesParams creates a new GetStickRulesParams object @@ -48,6 +49,7 @@ type GetStickRulesParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetStickRulesParams) bindParentName(rawData []string, hasKey bool, form // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetStickRulesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/stick_rule/replace_stick_rule_parameters.go b/operations/stick_rule/replace_stick_rule_parameters.go index 4bab91a9..57b2e652 100644 --- a/operations/stick_rule/replace_stick_rule_parameters.go +++ b/operations/stick_rule/replace_stick_rule_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceStickRuleParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceStickRuleParams) bindParentName(rawData []string, hasKey bool, f // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceStickRuleParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/stick_rule/replace_stick_rules_parameters.go b/operations/stick_rule/replace_stick_rules_parameters.go index 58ba13f6..6b1c433f 100644 --- a/operations/stick_rule/replace_stick_rules_parameters.go +++ b/operations/stick_rule/replace_stick_rules_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceStickRulesParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceStickRulesParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceStickRulesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/stick_table/get_stick_table_entries_parameters.go b/operations/stick_table/get_stick_table_entries_parameters.go index f214233f..6ab149d1 100644 --- a/operations/stick_table/get_stick_table_entries_parameters.go +++ b/operations/stick_table/get_stick_table_entries_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetStickTableEntriesParams creates a new GetStickTableEntriesParams object @@ -52,10 +53,12 @@ type GetStickTableEntriesParams struct { */ Count *int64 /*A list of filters in format data. separated by comma + Pattern: ^[^\r\n;#]+$ In: query */ Filter *string /*Key which we want the entries for + Pattern: ^[^\r\n;#]+$ In: query */ Key *string @@ -65,6 +68,7 @@ type GetStickTableEntriesParams struct { Offset *int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -149,6 +153,20 @@ func (o *GetStickTableEntriesParams) bindFilter(rawData []string, hasKey bool, f } o.Filter = &raw + if err := o.validateFilter(formats); err != nil { + return err + } + + return nil +} + +// validateFilter carries on validations for parameter Filter +func (o *GetStickTableEntriesParams) validateFilter(formats strfmt.Registry) error { + + if err := validate.Pattern("filter", "query", *o.Filter, `^[^\r\n;#]+$`); err != nil { + return err + } + return nil } @@ -167,6 +185,20 @@ func (o *GetStickTableEntriesParams) bindKey(rawData []string, hasKey bool, form } o.Key = &raw + if err := o.validateKey(formats); err != nil { + return err + } + + return nil +} + +// validateKey carries on validations for parameter Key +func (o *GetStickTableEntriesParams) validateKey(formats strfmt.Registry) error { + + if err := validate.Pattern("key", "query", *o.Key, `^[^\r\n;#]+$`); err != nil { + return err + } + return nil } @@ -204,5 +236,19 @@ func (o *GetStickTableEntriesParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetStickTableEntriesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/stick_table/get_stick_table_parameters.go b/operations/stick_table/get_stick_table_parameters.go index dc7b61e4..ef34e3e8 100644 --- a/operations/stick_table/get_stick_table_parameters.go +++ b/operations/stick_table/get_stick_table_parameters.go @@ -26,6 +26,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetStickTableParams creates a new GetStickTableParams object @@ -47,6 +48,7 @@ type GetStickTableParams struct { /*Stick table name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ Name string @@ -82,5 +84,19 @@ func (o *GetStickTableParams) bindName(rawData []string, hasKey bool, formats st // Parameter is provided by construction from the route o.Name = raw + if err := o.validateName(formats); err != nil { + return err + } + + return nil +} + +// validateName carries on validations for parameter Name +func (o *GetStickTableParams) validateName(formats strfmt.Registry) error { + + if err := validate.Pattern("name", "path", o.Name, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/stick_table/set_stick_table_entries.go b/operations/stick_table/set_stick_table_entries.go index 4520a2f2..dacceead 100644 --- a/operations/stick_table/set_stick_table_entries.go +++ b/operations/stick_table/set_stick_table_entries.go @@ -103,6 +103,7 @@ type SetStickTableEntriesBody struct { // key // Required: true + // Pattern: ^[^\r\n;#]+$ Key *string `json:"key"` } @@ -150,6 +151,10 @@ func (o *SetStickTableEntriesBody) validateKey(formats strfmt.Registry) error { return err } + if err := validate.Pattern("stick_table_entry"+"."+"key", "body", *o.Key, `^[^\r\n;#]+$`); err != nil { + return err + } + return nil } @@ -170,6 +175,7 @@ func (o *SetStickTableEntriesBody) ContextValidate(ctx context.Context, formats func (o *SetStickTableEntriesBody) contextValidateDataType(ctx context.Context, formats strfmt.Registry) error { if o.DataType != nil { + if err := o.DataType.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("stick_table_entry" + "." + "data_type") diff --git a/operations/stick_table/set_stick_table_entries_parameters.go b/operations/stick_table/set_stick_table_entries_parameters.go index f6067e32..47cb3a3a 100644 --- a/operations/stick_table/set_stick_table_entries_parameters.go +++ b/operations/stick_table/set_stick_table_entries_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewSetStickTableEntriesParams creates a new SetStickTableEntriesParams object @@ -48,6 +49,7 @@ type SetStickTableEntriesParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -104,5 +106,19 @@ func (o *SetStickTableEntriesParams) bindParentName(rawData []string, hasKey boo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *SetStickTableEntriesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/storage/create_storage_s_s_l_certificate_parameters.go b/operations/storage/create_storage_s_s_l_certificate_parameters.go index edb4b7f2..b552602d 100644 --- a/operations/storage/create_storage_s_s_l_certificate_parameters.go +++ b/operations/storage/create_storage_s_s_l_certificate_parameters.go @@ -47,10 +47,13 @@ func NewCreateStorageSSLCertificateParams() CreateStorageSSLCertificateParams { // initialize parameters with default values forceReloadDefault = bool(false) + skipReloadDefault = bool(false) ) return CreateStorageSSLCertificateParams{ ForceReload: &forceReloadDefault, + + SkipReload: &skipReloadDefault, } } @@ -72,6 +75,11 @@ type CreateStorageSSLCertificateParams struct { Default: false */ ForceReload *bool + /*If set, no reload will be initiated after update + In: query + Default: false + */ + SkipReload *bool } // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface @@ -108,6 +116,11 @@ func (o *CreateStorageSSLCertificateParams) BindRequest(r *http.Request, route * if err := o.bindForceReload(qForceReload, qhkForceReload, route.Formats); err != nil { res = append(res, err) } + + qSkipReload, qhkSkipReload, _ := qs.GetOK("skip_reload") + if err := o.bindSkipReload(qSkipReload, qhkSkipReload, route.Formats); err != nil { + res = append(res, err) + } if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -144,3 +157,27 @@ func (o *CreateStorageSSLCertificateParams) bindForceReload(rawData []string, ha return nil } + +// bindSkipReload binds and validates parameter SkipReload from query. +func (o *CreateStorageSSLCertificateParams) bindSkipReload(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewCreateStorageSSLCertificateParams() + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("skip_reload", "query", "bool", raw) + } + o.SkipReload = &value + + return nil +} diff --git a/operations/storage/create_storage_s_s_l_certificate_urlbuilder.go b/operations/storage/create_storage_s_s_l_certificate_urlbuilder.go index 88d3a121..63a14ad2 100644 --- a/operations/storage/create_storage_s_s_l_certificate_urlbuilder.go +++ b/operations/storage/create_storage_s_s_l_certificate_urlbuilder.go @@ -31,6 +31,7 @@ import ( // CreateStorageSSLCertificateURL generates an URL for the create storage s s l certificate operation type CreateStorageSSLCertificateURL struct { ForceReload *bool + SkipReload *bool _basePath string // avoid unkeyed usage @@ -74,6 +75,14 @@ func (o *CreateStorageSSLCertificateURL) Build() (*url.URL, error) { qs.Set("force_reload", forceReloadQ) } + var skipReloadQ string + if o.SkipReload != nil { + skipReloadQ = swag.FormatBool(*o.SkipReload) + } + if skipReloadQ != "" { + qs.Set("skip_reload", skipReloadQ) + } + _result.RawQuery = qs.Encode() return &_result, nil diff --git a/operations/storage/replace_storage_general_file_parameters.go b/operations/storage/replace_storage_general_file_parameters.go index 5235a34f..7d0db4c7 100644 --- a/operations/storage/replace_storage_general_file_parameters.go +++ b/operations/storage/replace_storage_general_file_parameters.go @@ -22,6 +22,7 @@ package storage import ( "io" + "mime/multipart" "net/http" "github.com/go-openapi/errors" @@ -31,6 +32,13 @@ import ( "github.com/go-openapi/swag" ) +// ReplaceStorageGeneralFileMaxParseMemory sets the maximum size in bytes for +// the multipart form parser for this operation. +// +// The default value is 32 MB. +// The multipart parser stores up to this + 10MB. +var ReplaceStorageGeneralFileMaxParseMemory int64 = 32 << 20 + // NewReplaceStorageGeneralFileParams creates a new ReplaceStorageGeneralFileParams object // with the default values initialized. func NewReplaceStorageGeneralFileParams() ReplaceStorageGeneralFileParams { @@ -59,11 +67,10 @@ type ReplaceStorageGeneralFileParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` - /* - Required: true - In: body + /*General use file content + In: formData */ - Data string + FileUpload io.ReadCloser /*If set, do a force reload, do not wait for the configured reload-delay. Cannot be used when transaction is specified, as changes in transaction are not applied directly to configuration. In: query Default: false @@ -92,21 +99,23 @@ func (o *ReplaceStorageGeneralFileParams) BindRequest(r *http.Request, route *mi qs := runtime.Values(r.URL.Query()) - if runtime.HasBody(r) { - defer r.Body.Close() - var body string - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("data", "body", "")) - } else { - res = append(res, errors.NewParseError("data", "body", "", err)) - } - } else { - // no validation required on inline body - o.Data = body + if err := r.ParseMultipartForm(ReplaceStorageGeneralFileMaxParseMemory); err != nil { + if err != http.ErrNotMultipart { + return errors.New(400, "%v", err) + } else if err := r.ParseForm(); err != nil { + return errors.New(400, "%v", err) } + } + + fileUpload, fileUploadHeader, err := r.FormFile("file_upload") + if err != nil && err != http.ErrMissingFile { + res = append(res, errors.New(400, "reading file %q failed: %v", "fileUpload", err)) + } else if err == http.ErrMissingFile { + // no-op for missing but optional file parameter + } else if err := o.bindFileUpload(fileUpload, fileUploadHeader); err != nil { + res = append(res, err) } else { - res = append(res, errors.Required("data", "body", "")) + o.FileUpload = &runtime.File{Data: fileUpload, Header: fileUploadHeader} } qForceReload, qhkForceReload, _ := qs.GetOK("force_reload") @@ -129,6 +138,13 @@ func (o *ReplaceStorageGeneralFileParams) BindRequest(r *http.Request, route *mi return nil } +// bindFileUpload binds file parameter FileUpload. +// +// The only supported validations on files are MinLength and MaxLength +func (o *ReplaceStorageGeneralFileParams) bindFileUpload(file multipart.File, header *multipart.FileHeader) error { + return nil +} + // bindForceReload binds and validates parameter ForceReload from query. func (o *ReplaceStorageGeneralFileParams) bindForceReload(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string diff --git a/operations/table/create_table_parameters.go b/operations/table/create_table_parameters.go index 722a4edc..c9822c5c 100644 --- a/operations/table/create_table_parameters.go +++ b/operations/table/create_table_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type CreateTableParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *CreateTableParams) bindParentName(rawData []string, hasKey bool, format // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateTableParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/table/delete_table_parameters.go b/operations/table/delete_table_parameters.go index 6e3a5fc6..42b45dac 100644 --- a/operations/table/delete_table_parameters.go +++ b/operations/table/delete_table_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteTableParams creates a new DeleteTableParams object @@ -66,6 +67,7 @@ type DeleteTableParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -169,6 +171,20 @@ func (o *DeleteTableParams) bindParentName(rawData []string, hasKey bool, format // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteTableParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/table/get_table_parameters.go b/operations/table/get_table_parameters.go index 3e4d1ae9..437ea201 100644 --- a/operations/table/get_table_parameters.go +++ b/operations/table/get_table_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetTableParams creates a new GetTableParams object @@ -53,6 +54,7 @@ type GetTableParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -118,6 +120,20 @@ func (o *GetTableParams) bindParentName(rawData []string, hasKey bool, formats s // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetTableParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/table/get_tables_parameters.go b/operations/table/get_tables_parameters.go index cdf2856d..a1c15173 100644 --- a/operations/table/get_tables_parameters.go +++ b/operations/table/get_tables_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetTablesParams creates a new GetTablesParams object @@ -48,6 +49,7 @@ type GetTablesParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetTablesParams) bindParentName(rawData []string, hasKey bool, formats // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetTablesParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/table/replace_table_parameters.go b/operations/table/replace_table_parameters.go index 257018ce..fc9373e0 100644 --- a/operations/table/replace_table_parameters.go +++ b/operations/table/replace_table_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceTableParams struct { Name string /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -200,6 +202,20 @@ func (o *ReplaceTableParams) bindParentName(rawData []string, hasKey bool, forma // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceTableParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/create_tcp_check_backend_parameters.go b/operations/tcp_check/create_tcp_check_backend_parameters.go index eccb3a07..0170d661 100644 --- a/operations/tcp_check/create_tcp_check_backend_parameters.go +++ b/operations/tcp_check/create_tcp_check_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateTCPCheckBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateTCPCheckBackendParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateTCPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/create_tcp_check_defaults_parameters.go b/operations/tcp_check/create_tcp_check_defaults_parameters.go index 44fb6302..521d6617 100644 --- a/operations/tcp_check/create_tcp_check_defaults_parameters.go +++ b/operations/tcp_check/create_tcp_check_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateTCPCheckDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateTCPCheckDefaultsParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateTCPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/delete_tcp_check_backend_parameters.go b/operations/tcp_check/delete_tcp_check_backend_parameters.go index e3a771cf..a4f1e813 100644 --- a/operations/tcp_check/delete_tcp_check_backend_parameters.go +++ b/operations/tcp_check/delete_tcp_check_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteTCPCheckBackendParams creates a new DeleteTCPCheckBackendParams object @@ -66,6 +67,7 @@ type DeleteTCPCheckBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteTCPCheckBackendParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteTCPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/delete_tcp_check_defaults_parameters.go b/operations/tcp_check/delete_tcp_check_defaults_parameters.go index 16582b44..713482b9 100644 --- a/operations/tcp_check/delete_tcp_check_defaults_parameters.go +++ b/operations/tcp_check/delete_tcp_check_defaults_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteTCPCheckDefaultsParams creates a new DeleteTCPCheckDefaultsParams object @@ -66,6 +67,7 @@ type DeleteTCPCheckDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteTCPCheckDefaultsParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteTCPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/get_all_tcp_check_backend_parameters.go b/operations/tcp_check/get_all_tcp_check_backend_parameters.go index 2871e6f8..8d916238 100644 --- a/operations/tcp_check/get_all_tcp_check_backend_parameters.go +++ b/operations/tcp_check/get_all_tcp_check_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllTCPCheckBackendParams creates a new GetAllTCPCheckBackendParams object @@ -48,6 +49,7 @@ type GetAllTCPCheckBackendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllTCPCheckBackendParams) bindParentName(rawData []string, hasKey bo // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllTCPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/get_all_tcp_check_defaults_parameters.go b/operations/tcp_check/get_all_tcp_check_defaults_parameters.go index 3001d2e3..41f60a29 100644 --- a/operations/tcp_check/get_all_tcp_check_defaults_parameters.go +++ b/operations/tcp_check/get_all_tcp_check_defaults_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllTCPCheckDefaultsParams creates a new GetAllTCPCheckDefaultsParams object @@ -48,6 +49,7 @@ type GetAllTCPCheckDefaultsParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllTCPCheckDefaultsParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllTCPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/get_tcp_check_backend_parameters.go b/operations/tcp_check/get_tcp_check_backend_parameters.go index 499447cc..ffa5cb2f 100644 --- a/operations/tcp_check/get_tcp_check_backend_parameters.go +++ b/operations/tcp_check/get_tcp_check_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetTCPCheckBackendParams creates a new GetTCPCheckBackendParams object @@ -54,6 +55,7 @@ type GetTCPCheckBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetTCPCheckBackendParams) bindParentName(rawData []string, hasKey bool, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetTCPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/get_tcp_check_defaults_parameters.go b/operations/tcp_check/get_tcp_check_defaults_parameters.go index 8ea37fff..a9e4fae5 100644 --- a/operations/tcp_check/get_tcp_check_defaults_parameters.go +++ b/operations/tcp_check/get_tcp_check_defaults_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetTCPCheckDefaultsParams creates a new GetTCPCheckDefaultsParams object @@ -54,6 +55,7 @@ type GetTCPCheckDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetTCPCheckDefaultsParams) bindParentName(rawData []string, hasKey bool // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetTCPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/replace_all_tcp_check_backend_parameters.go b/operations/tcp_check/replace_all_tcp_check_backend_parameters.go index 16c59bed..deadf502 100644 --- a/operations/tcp_check/replace_all_tcp_check_backend_parameters.go +++ b/operations/tcp_check/replace_all_tcp_check_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllTCPCheckBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllTCPCheckBackendParams) bindParentName(rawData []string, hasKe // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllTCPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/replace_all_tcp_check_defaults_parameters.go b/operations/tcp_check/replace_all_tcp_check_defaults_parameters.go index 6bad0a9c..98cd03f1 100644 --- a/operations/tcp_check/replace_all_tcp_check_defaults_parameters.go +++ b/operations/tcp_check/replace_all_tcp_check_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllTCPCheckDefaultsParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllTCPCheckDefaultsParams) bindParentName(rawData []string, hasK // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllTCPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/replace_tcp_check_backend_parameters.go b/operations/tcp_check/replace_tcp_check_backend_parameters.go index 2519c621..5e436eee 100644 --- a/operations/tcp_check/replace_tcp_check_backend_parameters.go +++ b/operations/tcp_check/replace_tcp_check_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceTCPCheckBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceTCPCheckBackendParams) bindParentName(rawData []string, hasKey b // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceTCPCheckBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_check/replace_tcp_check_defaults_parameters.go b/operations/tcp_check/replace_tcp_check_defaults_parameters.go index 9e1bd36b..bbb4f53c 100644 --- a/operations/tcp_check/replace_tcp_check_defaults_parameters.go +++ b/operations/tcp_check/replace_tcp_check_defaults_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceTCPCheckDefaultsParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceTCPCheckDefaultsParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceTCPCheckDefaultsParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/create_tcp_request_rule_backend_parameters.go b/operations/tcp_request_rule/create_tcp_request_rule_backend_parameters.go index d26e46fe..2e8d135b 100644 --- a/operations/tcp_request_rule/create_tcp_request_rule_backend_parameters.go +++ b/operations/tcp_request_rule/create_tcp_request_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateTCPRequestRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateTCPRequestRuleBackendParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateTCPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/create_tcp_request_rule_frontend_parameters.go b/operations/tcp_request_rule/create_tcp_request_rule_frontend_parameters.go index 1bb09dc4..13daf0d8 100644 --- a/operations/tcp_request_rule/create_tcp_request_rule_frontend_parameters.go +++ b/operations/tcp_request_rule/create_tcp_request_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateTCPRequestRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateTCPRequestRuleFrontendParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateTCPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/delete_tcp_request_rule_backend_parameters.go b/operations/tcp_request_rule/delete_tcp_request_rule_backend_parameters.go index a91a9ade..c3ad3589 100644 --- a/operations/tcp_request_rule/delete_tcp_request_rule_backend_parameters.go +++ b/operations/tcp_request_rule/delete_tcp_request_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteTCPRequestRuleBackendParams creates a new DeleteTCPRequestRuleBackendParams object @@ -66,6 +67,7 @@ type DeleteTCPRequestRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteTCPRequestRuleBackendParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteTCPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/delete_tcp_request_rule_frontend_parameters.go b/operations/tcp_request_rule/delete_tcp_request_rule_frontend_parameters.go index f08d511b..a447ba1b 100644 --- a/operations/tcp_request_rule/delete_tcp_request_rule_frontend_parameters.go +++ b/operations/tcp_request_rule/delete_tcp_request_rule_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteTCPRequestRuleFrontendParams creates a new DeleteTCPRequestRuleFrontendParams object @@ -66,6 +67,7 @@ type DeleteTCPRequestRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteTCPRequestRuleFrontendParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteTCPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/get_all_tcp_request_rule_backend_parameters.go b/operations/tcp_request_rule/get_all_tcp_request_rule_backend_parameters.go index 4b5640fb..ddc13b1b 100644 --- a/operations/tcp_request_rule/get_all_tcp_request_rule_backend_parameters.go +++ b/operations/tcp_request_rule/get_all_tcp_request_rule_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllTCPRequestRuleBackendParams creates a new GetAllTCPRequestRuleBackendParams object @@ -48,6 +49,7 @@ type GetAllTCPRequestRuleBackendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllTCPRequestRuleBackendParams) bindParentName(rawData []string, has // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllTCPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/get_all_tcp_request_rule_frontend_parameters.go b/operations/tcp_request_rule/get_all_tcp_request_rule_frontend_parameters.go index 41f2eda9..260567bd 100644 --- a/operations/tcp_request_rule/get_all_tcp_request_rule_frontend_parameters.go +++ b/operations/tcp_request_rule/get_all_tcp_request_rule_frontend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllTCPRequestRuleFrontendParams creates a new GetAllTCPRequestRuleFrontendParams object @@ -48,6 +49,7 @@ type GetAllTCPRequestRuleFrontendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllTCPRequestRuleFrontendParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllTCPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/get_tcp_request_rule_backend_parameters.go b/operations/tcp_request_rule/get_tcp_request_rule_backend_parameters.go index 7eef7832..96eca69a 100644 --- a/operations/tcp_request_rule/get_tcp_request_rule_backend_parameters.go +++ b/operations/tcp_request_rule/get_tcp_request_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetTCPRequestRuleBackendParams creates a new GetTCPRequestRuleBackendParams object @@ -54,6 +55,7 @@ type GetTCPRequestRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetTCPRequestRuleBackendParams) bindParentName(rawData []string, hasKey // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetTCPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/get_tcp_request_rule_frontend_parameters.go b/operations/tcp_request_rule/get_tcp_request_rule_frontend_parameters.go index 96e8b0f6..0b44994c 100644 --- a/operations/tcp_request_rule/get_tcp_request_rule_frontend_parameters.go +++ b/operations/tcp_request_rule/get_tcp_request_rule_frontend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetTCPRequestRuleFrontendParams creates a new GetTCPRequestRuleFrontendParams object @@ -54,6 +55,7 @@ type GetTCPRequestRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetTCPRequestRuleFrontendParams) bindParentName(rawData []string, hasKe // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetTCPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/replace_all_tcp_request_rule_backend_parameters.go b/operations/tcp_request_rule/replace_all_tcp_request_rule_backend_parameters.go index 92bedea6..9868f289 100644 --- a/operations/tcp_request_rule/replace_all_tcp_request_rule_backend_parameters.go +++ b/operations/tcp_request_rule/replace_all_tcp_request_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllTCPRequestRuleBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllTCPRequestRuleBackendParams) bindParentName(rawData []string, // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllTCPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/replace_all_tcp_request_rule_frontend_parameters.go b/operations/tcp_request_rule/replace_all_tcp_request_rule_frontend_parameters.go index 3d386463..22749d09 100644 --- a/operations/tcp_request_rule/replace_all_tcp_request_rule_frontend_parameters.go +++ b/operations/tcp_request_rule/replace_all_tcp_request_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllTCPRequestRuleFrontendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllTCPRequestRuleFrontendParams) bindParentName(rawData []string // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllTCPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/replace_tcp_request_rule_backend_parameters.go b/operations/tcp_request_rule/replace_tcp_request_rule_backend_parameters.go index 4c11e122..546ce8e8 100644 --- a/operations/tcp_request_rule/replace_tcp_request_rule_backend_parameters.go +++ b/operations/tcp_request_rule/replace_tcp_request_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceTCPRequestRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceTCPRequestRuleBackendParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceTCPRequestRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_request_rule/replace_tcp_request_rule_frontend_parameters.go b/operations/tcp_request_rule/replace_tcp_request_rule_frontend_parameters.go index cb1bd52e..143da8d8 100644 --- a/operations/tcp_request_rule/replace_tcp_request_rule_frontend_parameters.go +++ b/operations/tcp_request_rule/replace_tcp_request_rule_frontend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceTCPRequestRuleFrontendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceTCPRequestRuleFrontendParams) bindParentName(rawData []string, h // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceTCPRequestRuleFrontendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_response_rule/create_tcp_response_rule_backend_parameters.go b/operations/tcp_response_rule/create_tcp_response_rule_backend_parameters.go index 1e80ee9c..59a4169e 100644 --- a/operations/tcp_response_rule/create_tcp_response_rule_backend_parameters.go +++ b/operations/tcp_response_rule/create_tcp_response_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type CreateTCPResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *CreateTCPResponseRuleBackendParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *CreateTCPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_response_rule/delete_tcp_response_rule_backend_parameters.go b/operations/tcp_response_rule/delete_tcp_response_rule_backend_parameters.go index 1d5e4f9b..356fce97 100644 --- a/operations/tcp_response_rule/delete_tcp_response_rule_backend_parameters.go +++ b/operations/tcp_response_rule/delete_tcp_response_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewDeleteTCPResponseRuleBackendParams creates a new DeleteTCPResponseRuleBackendParams object @@ -66,6 +67,7 @@ type DeleteTCPResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -174,6 +176,20 @@ func (o *DeleteTCPResponseRuleBackendParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *DeleteTCPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_response_rule/get_all_tcp_response_rule_backend_parameters.go b/operations/tcp_response_rule/get_all_tcp_response_rule_backend_parameters.go index ea8ca33b..a0f6d6a4 100644 --- a/operations/tcp_response_rule/get_all_tcp_response_rule_backend_parameters.go +++ b/operations/tcp_response_rule/get_all_tcp_response_rule_backend_parameters.go @@ -27,6 +27,7 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" ) // NewGetAllTCPResponseRuleBackendParams creates a new GetAllTCPResponseRuleBackendParams object @@ -48,6 +49,7 @@ type GetAllTCPResponseRuleBackendParams struct { /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -94,6 +96,20 @@ func (o *GetAllTCPResponseRuleBackendParams) bindParentName(rawData []string, ha // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetAllTCPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_response_rule/get_tcp_response_rule_backend_parameters.go b/operations/tcp_response_rule/get_tcp_response_rule_backend_parameters.go index 55cc0465..7d3b4441 100644 --- a/operations/tcp_response_rule/get_tcp_response_rule_backend_parameters.go +++ b/operations/tcp_response_rule/get_tcp_response_rule_backend_parameters.go @@ -28,6 +28,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // NewGetTCPResponseRuleBackendParams creates a new GetTCPResponseRuleBackendParams object @@ -54,6 +55,7 @@ type GetTCPResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -124,6 +126,20 @@ func (o *GetTCPResponseRuleBackendParams) bindParentName(rawData []string, hasKe // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *GetTCPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_response_rule/replace_all_tcp_response_rule_backend_parameters.go b/operations/tcp_response_rule/replace_all_tcp_response_rule_backend_parameters.go index eccae8c8..fdba05e5 100644 --- a/operations/tcp_response_rule/replace_all_tcp_response_rule_backend_parameters.go +++ b/operations/tcp_response_rule/replace_all_tcp_response_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -69,6 +70,7 @@ type ReplaceAllTCPResponseRuleBackendParams struct { ForceReload *bool /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -176,6 +178,20 @@ func (o *ReplaceAllTCPResponseRuleBackendParams) bindParentName(rawData []string // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceAllTCPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/operations/tcp_response_rule/replace_tcp_response_rule_backend_parameters.go b/operations/tcp_response_rule/replace_tcp_response_rule_backend_parameters.go index b9141c45..763fc83f 100644 --- a/operations/tcp_response_rule/replace_tcp_response_rule_backend_parameters.go +++ b/operations/tcp_response_rule/replace_tcp_response_rule_backend_parameters.go @@ -29,6 +29,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" "github.com/haproxytech/client-native/v6/models" ) @@ -74,6 +75,7 @@ type ReplaceTCPResponseRuleBackendParams struct { Index int64 /*Parent name Required: true + Pattern: ^[^\r\n<>*;$#&{}"]+$ In: path */ ParentName string @@ -205,6 +207,20 @@ func (o *ReplaceTCPResponseRuleBackendParams) bindParentName(rawData []string, h // Parameter is provided by construction from the route o.ParentName = raw + if err := o.validateParentName(formats); err != nil { + return err + } + + return nil +} + +// validateParentName carries on validations for parameter ParentName +func (o *ReplaceTCPResponseRuleBackendParams) validateParentName(formats strfmt.Registry) error { + + if err := validate.Pattern("parent_name", "path", o.ParentName, `^[^\r\n<>*;$#&{}"]+$`); err != nil { + return err + } + return nil } diff --git a/rate/threshold_limit.go b/rate/threshold_limit.go index c4f8c597..2ced6633 100644 --- a/rate/threshold_limit.go +++ b/rate/threshold_limit.go @@ -23,7 +23,7 @@ func (t *thresholdLimit) LimitReached() (err error) { if t.actual() >= t.limit { err = NewTransactionLimitReachedError(t.limit) } - return + return err } func NewThresholdLimit(limit uint64, actual func() uint64) Threshold { diff --git a/resilient/client.go b/resilient/client.go index 7952b751..bb063168 100644 --- a/resilient/client.go +++ b/resilient/client.go @@ -47,7 +47,7 @@ func (c *Client) Runtime() (runtime.Runtime, error) { } // Now, for let's try to reconfigure once the runtime - cfg, err := c.HAProxyClient.Configuration() + cfg, err := c.Configuration() if err != nil { return nil, err } @@ -63,7 +63,7 @@ func (c *Client) Runtime() (runtime.Runtime, error) { if rnt == nil { return nil, errors.New("retry - unable to configure runtime client") } - c.HAProxyClient.ReplaceRuntime(rnt) + c.ReplaceRuntime(rnt) return c.HAProxyClient.Runtime() } diff --git a/runtime/commands/pprof.go b/runtime/commands/pprof.go index dbfd4994..c5f04ae9 100644 --- a/runtime/commands/pprof.go +++ b/runtime/commands/pprof.go @@ -128,7 +128,7 @@ func (g PProf) Command(cmd []string) (response []byte, err error) { } }() - return []byte(fmt.Sprintf("pprof web started on port %s with duration of %s", cmd[3], sleepTime)), nil + return fmt.Appendf(nil, "pprof web started on port %s with duration of %s", cmd[3], sleepTime), nil case "stop": if stopWebServer != nil { stopWebServer() @@ -184,7 +184,7 @@ func (g PProf) Command(cmd []string) (response []byte, err error) { } }() - return []byte(fmt.Sprintf("CPU Profile with duration of %s", sleepTime)), nil + return fmt.Appendf(nil, "CPU Profile with duration of %s", sleepTime), nil case "stop": if stopCPUProfiling == nil { return []byte(""), errors.New("CPU Profile not running") diff --git a/runtime/commands/stack.go b/runtime/commands/stack.go index e27a3c16..bf56fee9 100644 --- a/runtime/commands/stack.go +++ b/runtime/commands/stack.go @@ -77,7 +77,7 @@ func MakeStackDump() (string, error) { srcLen := 0 pkgLen := 0 for _, bucket := range buckets { - for _, line := range bucket.Signature.Stack.Calls { + for _, line := range bucket.Stack.Calls { if l := len(fmt.Sprintf("%s:%d", line.SrcName, line.Line)); l > srcLen { srcLen = l } @@ -100,16 +100,15 @@ func MakeStackDump() (string, error) { if len(bucket.CreatedBy.Calls) != 0 { extra += fmt.Sprintf(" [Created by %s.%s @ %s:%d]", bucket.CreatedBy.Calls[0].Func.DirName, bucket.CreatedBy.Calls[0].Func.Name, bucket.CreatedBy.Calls[0].SrcName, bucket.CreatedBy.Calls[0].Line) } - result.WriteString(fmt.Sprintf("%d: %s%s\n", len(bucket.IDs), bucket.State, extra)) + fmt.Fprintf(&result, "%d: %s%s\n", len(bucket.IDs), bucket.State, extra) // Print the stack lines. for _, line := range bucket.Stack.Calls { arg := line.Args - result.WriteString(fmt.Sprintf( - " %-*s %-*s %s(%s)\n", + fmt.Fprintf(&result, " %-*s %-*s %s(%s)\n", pkgLen, line.Func.DirName, srcLen, fmt.Sprintf("%s:%d", line.SrcName, line.Line), - line.Func.Name, &arg)) + line.Func.Name, &arg) } if bucket.Stack.Elided { result.WriteString(" (...)\n") diff --git a/server.go b/server.go index 21d19c3b..011b035c 100644 --- a/server.go +++ b/server.go @@ -96,7 +96,7 @@ type Server struct { ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"30s"` httpServerL net.Listener TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"`