diff --git a/.github/workflows/gh_pr_check.yml b/.github/workflows/gh_pr_check.yml
new file mode 100644
index 000000000..f64f2375e
--- /dev/null
+++ b/.github/workflows/gh_pr_check.yml
@@ -0,0 +1,434 @@
+name: "GitHub Pull Requests Checker"
+
+on:
+ issue_comment:
+ types: [created]
+
+concurrency:
+ group: gh_pr_check-${{ github.event.issue.number }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+ pull-requests: read
+ statuses: write
+
+jobs:
+ pr-guard:
+ if: >
+ github.event.issue.pull_request &&
+ contains(fromJSON('["OWNER", "MEMBER"]'), github.event.comment.author_association) &&
+ startsWith(github.event.comment.body, '/pr-check')
+ runs-on: ubuntu-latest
+ steps:
+ - name: Log
+ run: |
+ echo "Triggered by @${{ github.event.comment.user.login }}"
+ echo "On PR #${{ github.event.issue.number }}"
+ - name: Get PR details
+ id: pr_details
+ uses: actions/github-script@v9
+ with:
+ script: |
+ const { data: pr } = await github.rest.pulls.get({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: context.issue.number,
+ });
+ core.setOutput("git_head_repo", pr.head.repo.full_name);
+ core.setOutput("git_head_ref", pr.head.ref);
+ core.setOutput("git_head_sha", pr.head.sha);
+ console.log(`git head repo: ${pr.head.repo.full_name}, ref: ${pr.head.ref}, sha: ${pr.head.sha}`);
+ outputs:
+ git_head_repo: ${{ steps.pr_details.outputs.git_head_repo }}
+ git_head_ref: ${{ steps.pr_details.outputs.git_head_ref }}
+ git_head_sha: ${{ steps.pr_details.outputs.git_head_sha }}
+ no_compile: ${{ contains(github.event.comment.body, '-no-compile') }}
+ no_test: ${{ contains(github.event.comment.body, '-no-test') }}
+ no_lint: ${{ contains(github.event.comment.body, '-no-lint') }}
+
+ compile-build:
+ if: needs.pr-guard.outputs.no_compile != 'true'
+ needs: pr-guard
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest, windows-latest]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - name: Initialize Actions status
+ if: matrix.os == 'ubuntu-latest'
+ uses: actions/github-script@v9
+ with:
+ script: |
+ await github.rest.repos.createCommitStatus({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ sha: "${{ needs.pr-guard.outputs.git_head_sha }}",
+ state: "pending",
+ context: "pr-check/compile-build",
+ description: "Running...",
+ target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
+ });
+
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ ref: refs/pull/${{ github.event.issue.number }}/merge
+ fetch-depth: 1
+ persist-credentials: false
+ submodules: true
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version: 24
+
+ - name: Set up Go
+ uses: actions/setup-go@v6
+ with:
+ go-version-file: "go.mod"
+
+ - name: Check Node.js dependencies
+ run: |
+ npm --prefix=./ui ci
+
+ - name: Build Node.js
+ run: |
+ npm --prefix=./ui run build
+
+ - name: Build Go
+ env:
+ CGO_ENABLED: 0
+ run: |
+ go build -v -ldflags "-s -w" -trimpath -o ./dist/certimate ./
+
+ unit-test:
+ if: needs.pr-guard.outputs.no_test != 'true'
+ needs: pr-guard
+ runs-on: ubuntu-latest
+ steps:
+ - name: Initialize Actions status
+ uses: actions/github-script@v9
+ with:
+ script: |
+ await github.rest.repos.createCommitStatus({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ sha: "${{ needs.pr-guard.outputs.git_head_sha }}",
+ state: "pending",
+ context: "pr-check/unit-test",
+ description: "Running...",
+ target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
+ });
+
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ ref: refs/pull/${{ github.event.issue.number }}/merge
+ fetch-depth: 1
+ persist-credentials: false
+ submodules: true
+
+ - name: Set up Go
+ uses: actions/setup-go@v6
+ with:
+ go-version-file: "go.mod"
+
+ - name: Run Go unit tests
+ id: gotest
+ if: success() || failure()
+ continue-on-error: true
+ run: |
+ # Exclude paths below:
+ EXCLUDES=(
+ "./pkg/core/certmgr/providers-tester/"
+ "./pkg/core/deployer/providers-tester/"
+ "./pkg/core/notifier/providers-tester/"
+ "./pkg/core/purger/providers-tester/"
+ "./pkg/sdk3rd-forked/"
+ )
+
+ GO_PKGS=$(go list -f '{{if or .TestGoFiles .XTestGoFiles}}{{.ImportPath}}{{end}}' ./... | grep -Ev $(IFS='|'; echo "${EXCLUDES[*]}"))
+
+ echo " "
+ echo "Testing packages:"
+ echo "$GO_PKGS"
+ echo " "
+
+ if ! go test -race -v $GO_PKGS; then
+ echo "::error::Failed to run 'go test', please fix the issues." >&2
+ exit 1
+ else
+ go test -tags=tester -c -o /dev/null ./...
+ echo "'go test' passed."
+ fi
+
+ - name: Check state
+ if: always()
+ run: |
+ if [[ "${{ steps.gotest.outcome }}" == "failure" ]]; then
+ echo "::error::Some cases failed."
+ exit 1
+ fi
+
+ lint-format:
+ if: needs.pr-guard.outputs.no_lint != 'true'
+ needs: pr-guard
+ runs-on: ubuntu-latest
+ steps:
+ - name: Initialize Actions status
+ uses: actions/github-script@v9
+ with:
+ script: |
+ await github.rest.repos.createCommitStatus({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ sha: "${{ needs.pr-guard.outputs.git_head_sha }}",
+ state: "pending",
+ context: "pr-check/lint-format",
+ description: "Running...",
+ target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
+ });
+
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ ref: refs/pull/${{ github.event.issue.number }}/merge
+ fetch-depth: 1
+ persist-credentials: false
+ submodules: true
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version: 24
+
+ - name: Set up Go
+ uses: actions/setup-go@v6
+ with:
+ go-version-file: "go.mod"
+
+ # 暂时禁用,避免 Prettier 配置冲突导致检查失败
+ # - name: Run Node.js code linter
+ # id: jslint
+ # if: success() || failure()
+ # continue-on-error: true
+ # run: |
+ # git reset --hard HEAD
+ # git clean -df
+
+ # cd ui
+ # npm ci
+
+ # echo "Running 'eslint' ..."
+ # if ! npx eslint . --quiet; then
+ # echo "::error::'eslint' resulted in changes, please format files and commit them:"
+ # exit 1
+ # else
+ # echo "'eslint' passed."
+ # fi
+
+ - name: Run Node.js code formatter
+ id: jsfmt
+ if: success() || failure()
+ continue-on-error: true
+ run: |
+ git reset --hard HEAD
+ git clean -df
+
+ cd ui
+ npm ci
+
+ echo "Running 'eslint --fix' ..."
+ npx eslint . --fix --output-file=/dev/null
+ if ! git diff --quiet; then
+ echo "::error::'eslint --fix' resulted in changes, please format files and commit them:"
+ git diff --exit-code
+ exit 1
+ else
+ echo "'eslint --fix' passed."
+ fi
+
+ - name: Run Go code linter
+ id: golint
+ if: success() || failure()
+ continue-on-error: true
+ run: |
+ git reset --hard HEAD
+ git clean -df
+
+ # Exclude paths below:
+ EXCLUDES=(
+ "./pkg/sdk3rd-forked/"
+ "./pkg/sdk3rd-trimmed/"
+ )
+
+ GO_MODULE=$(go list -m)
+ GO_PKGS=$(go list ./... | grep -Ev $(IFS='|'; echo "${EXCLUDES[*]}"))
+
+ EXCLUDE_FUNC=()
+ for pkg in ${GO_PKGS}; do
+ pkg_path="./${pkg#$GO_MODULE/}"
+ if [ ! -d "$pkg_path" ]; then
+ EXCLUDE_FUNC+=("$pkg")
+ continue
+ fi
+ if ! grep -RqE '//nolint:(all|govet)' "$pkg_path"/*.go 2>/dev/null; then
+ EXCLUDE_FUNC+=("$pkg")
+ fi
+ done
+
+ GO_PKGS=$(printf '%s\n' "${EXCLUDE_FUNC[@]}")
+ echo " "
+ echo "Linting packages:"
+ echo "$GO_PKGS"
+ echo " "
+
+ echo "Running 'go vet' ..."
+ if ! echo "$GO_PKGS" | xargs go vet; then
+ echo "::error::Failed to run 'go vet', please fix the issues."
+ exit 1
+ else
+ echo "'go vet' passed."
+ fi
+
+ - name: Run Go code formatter
+ id: gofmt
+ if: success() || failure()
+ continue-on-error: true
+ run: |
+ git reset --hard HEAD
+ git clean -df
+
+ go install mvdan.cc/gofumpt@latest
+ gofumpt --version
+
+ # Exclude paths below:
+ EXCLUDES=(
+ "./pkg/sdk3rd-forked/"
+ "./pkg/sdk3rd-trimmed/"
+ )
+
+ EXCLUDE_FUNC=()
+ for ex in "${EXCLUDES[@]}"; do
+ EXCLUDE_FUNC+=(-path "${ex}*" -prune -o)
+ done
+
+ GO_FILES="$(
+ find . \
+ "${EXCLUDE_FUNC[@]}" \
+ -type f -name "*.go" \
+ -print
+ )"
+ echo " "
+ echo "Formatting files:"
+ echo "$GO_FILES"
+ echo " "
+
+ echo "Running 'gofumpt' ..."
+ echo "$GO_FILES" | xargs -d '\n' gofumpt -l -w
+ if ! git diff --quiet; then
+ echo "::error::'gofumpt' resulted in changes, please format files and commit them:"
+ git diff --exit-code
+ exit 1
+ else
+ echo "'gofumpt' passed."
+ fi
+
+ - name: Check state
+ if: always()
+ run: |
+ if [[ "${{ steps.jslint.outcome }}" == "failure" ||
+ "${{ steps.jsfmt.outcome }}" == "failure" ||
+ "${{ steps.golint.outcome }}" == "failure" ||
+ "${{ steps.gofmt.outcome }}" == "failure" ]]; then
+ echo "::error::Some cases failed."
+ exit 1
+ fi
+
+ ending:
+ needs: [pr-guard, compile-build, unit-test, lint-format]
+ if: always() && needs.pr-guard.result == 'success'
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: write
+ statuses: write
+ steps:
+ - name: Compute overall state
+ id: overall_state
+ run: |
+ # 最终状态:
+ # - 任一失败 → failure
+ # - 任一手动取消/超时 → cancelled
+ # - 全部成功 → success
+ RESULTS="${{ needs.compile-build.result }} ${{ needs.unit-test.result }} ${{ needs.lint-format.result }}"
+ if echo "$RESULTS" | grep -q "failure\|error"; then
+ echo "state=failure" >> "$GITHUB_OUTPUT"
+ elif echo "$RESULTS" | grep -q "cancelled"; then
+ echo "state=cancelled" >> "$GITHUB_OUTPUT"
+ else
+ echo "state=success" >> "$GITHUB_OUTPUT"
+ fi
+
+ - name: Set Actions status
+ uses: actions/github-script@v7
+ with:
+ script: |
+ const jobs = [
+ {
+ ctx: "pr-check/compile-build",
+ result: "${{ needs.compile-build.result }}",
+ skipped: "${{ needs.pr-guard.outputs.no_compile }}",
+ },
+ {
+ ctx: "pr-check/unit-test",
+ result: "${{ needs.unit-test.result }}",
+ skipped: "${{ needs.pr-guard.outputs.no_test }}",
+ },
+ {
+ ctx: "pr-check/lint-format",
+ result: "${{ needs.lint-format.result }}",
+ skipped: "${{ needs.pr-guard.outputs.no_lint }}",
+ },
+ ];
+ const states = {
+ "success": "success",
+ "failure": "failure",
+ "cancelled": "error"
+ };
+ for (const j of jobs) {
+ if (j.skipped === "true") continue;
+ const state = states[j.result] || "error";
+ const desc = state === "success" ? "Passed"
+ : state === "failure" ? "Failed"
+ : "Cancelled";
+ await github.rest.repos.createCommitStatus({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ sha: "${{ needs.pr-guard.outputs.git_head_sha }}",
+ state: state,
+ context: j.ctx,
+ description: desc,
+ target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
+ });
+ }
+
+ - name: Create comment
+ uses: actions/github-script@v9
+ with:
+ script: |
+ const stateIcon = "${{ steps.overall_state.outputs.state }}" === "success" ? "✅"
+ : "${{ steps.overall_state.outputs.state }}" === "failure" ? "❌"
+ : "";
+ await github.rest.issues.createComment({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: ${{ github.event.issue.number }},
+ body: stateIcon + "PR check done, overall result: **" + "${{ steps.overall_state.outputs.state }}" + "**\n" +
+ "- _compile-build_: **" + ("${{ needs.pr-guard.outputs.no_compile }}" === "true" ? "skipped" : "${{ needs.compile-build.result }}") + "**\n" +
+ "- _unit-test_: **" + ("${{ needs.pr-guard.outputs.no_test }}" === "true" ? "skipped" : "${{ needs.unit-test.result }}") + "**\n" +
+ "- _lint-format_: **" + ("${{ needs.pr-guard.outputs.no_lint }}" === "true" ? "skipped" : "${{ needs.lint-format.result }}") + "**\n\n" +
+ "Click to [view details](" + `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` + ").",
+ });
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/push_docker_image.yml b/.github/workflows/push_docker_image.yml
index 82f92ceba..6bac97461 100644
--- a/.github/workflows/push_docker_image.yml
+++ b/.github/workflows/push_docker_image.yml
@@ -11,9 +11,9 @@ on:
workflow_dispatch:
inputs:
tag:
- description: "Tag version to be used for Docker image"
+ description: "Existing git tag to build and push (e.g. v0.4.31). Does not move the tag or recreate the GitHub Release."
required: true
- default: "latest"
+ default: "v0.4.31"
jobs:
prepare-ui:
@@ -22,6 +22,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v7
with:
+ ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
fetch-depth: 1
persist-credentials: false
@@ -49,6 +50,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v7
with:
+ ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
fetch-depth: 1
persist-credentials: false
submodules: true
@@ -76,6 +78,8 @@ jobs:
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
+ type=semver,pattern=v{{version}},value=${{ inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' }}
+ type=semver,pattern=v{{major}}.{{minor}},value=${{ inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' }}
- name: Log in to DOCKERHUB
uses: docker/login-action@v4
@@ -104,3 +108,7 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.meta.outputs.tags }}
+ # Aliyun ACR rejects Buildx default provenance attestations
+ # (application/vnd.oci.empty.v1+json).
+ provenance: false
+ sbom: false
diff --git a/.github/workflows/push_docker_image_next.yml b/.github/workflows/push_docker_image_next.yml
index c8ae92f11..438143214 100644
--- a/.github/workflows/push_docker_image_next.yml
+++ b/.github/workflows/push_docker_image_next.yml
@@ -103,3 +103,7 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.meta.outputs.tags }}
+ # Aliyun ACR rejects Buildx default provenance attestations
+ # (application/vnd.oci.empty.v1+json).
+ provenance: false
+ sbom: false
diff --git a/.gitignore b/.gitignore
index 48d1cc9cb..187ba6885 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,7 +14,7 @@ __debug_bin*
.tmp*
vendor
-build
+dist
/certimate
/certimate.exe
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 55e392b42..9e2288559 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -8,6 +8,7 @@
"*.css": "tailwindcss",
"Dockerfile_*": "dockerfile"
},
+ "files.encoding": "utf8",
"go.useLanguageServer": true,
"gopls": {
"formatting.gofumpt": true,
diff --git a/Makefile b/Makefile
index 0ff9fdf30..86b56617d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# 定义变量
BINARY_NAME=certimate
-BUILD_DIR=build
+BUILD_DIR=dist
# 支持的操作系统和架构列表
OS_ARCH=\
diff --git a/README.md b/README.md
index 1e3d82ec3..38f046647 100644
--- a/README.md
+++ b/README.md
@@ -138,12 +138,12 @@ This repository is available under the [MIT License](https://opensource.org/lice
## ⭐ Star History
-Star Certificate on GitHub and be instantly notified of new releases!
+Star Certimate on GitHub and be instantly notified of new releases!
-
-
-
+
+
+
diff --git a/README_zh.md b/README_zh.md
index 199fee7ca..09558e7ed 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -144,8 +144,8 @@ Certimate 遵循 [MIT License](https://opensource.org/licenses/MIT) 开源协议
-
-
-
+
+
+
diff --git a/cmd/version.go b/cmd/version.go
index 8a95d2118..d45ddb196 100644
--- a/cmd/version.go
+++ b/cmd/version.go
@@ -1,4 +1,4 @@
-package cmd
+package cmd
import (
"fmt"
diff --git a/go.mod b/go.mod
index 2198697dc..134a477ca 100644
--- a/go.mod
+++ b/go.mod
@@ -61,7 +61,7 @@ require (
github.com/pavlo-v-chernykh/keystore-go/v4 v4.5.0
github.com/pkg/sftp v1.13.11
github.com/pocketbase/dbx v1.12.0
- github.com/pocketbase/pocketbase v0.39.9
+ github.com/pocketbase/pocketbase v0.39.10
github.com/povsister/scp v0.0.0-20250701154629-777cf82de5df
github.com/pquerna/otp v1.5.0
github.com/samber/lo v1.53.0
@@ -262,7 +262,7 @@ require (
modernc.org/libc v1.74.1 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
- modernc.org/sqlite v1.54.0 // indirect
+ modernc.org/sqlite v1.55.0 // indirect
)
replace gitlab.ecloud.com/ecloud/ecloudsdkcloudcore v1.0.0 => ./pkg/sdk3rd-forked/gitlab.ecloud.com/ecloud/ecloudsdkcloudcore@v1.0.0+mod
diff --git a/go.sum b/go.sum
index 57c0741da..936d9465b 100644
--- a/go.sum
+++ b/go.sum
@@ -763,8 +763,8 @@ github.com/pocketbase/dbx v1.12.0 h1:/oLErM+A0b4xI0PWTGPqSDVjzix48PqI/bng2l0PzoA
github.com/pocketbase/dbx v1.12.0/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs=
github.com/pocketbase/ozzo-validation/v4 v4.3.0 h1:uKBDVma7bZqgR2a6AwE+k9hkuDFfiZMpBHQdZ1z3iQs=
github.com/pocketbase/ozzo-validation/v4 v4.3.0/go.mod h1:6XNjSTw/Jb2F8LOkKO3oyzIWExbrGiYoS4uVxVwz90g=
-github.com/pocketbase/pocketbase v0.39.9 h1:zmrvbWJwBlb+iXst02uD6zNqNpiyG86KtlOJjd+Bhx4=
-github.com/pocketbase/pocketbase v0.39.9/go.mod h1:6l4ZFFa8kNkxLSumxzVm+DtczfUz86Wqow0bQYiXEkQ=
+github.com/pocketbase/pocketbase v0.39.10 h1:2j8TDJRuo3aAC8Y8F9WFux0SwYcxeDCgEYQxxdWkwGE=
+github.com/pocketbase/pocketbase v0.39.10/go.mod h1:tSX3anHQ7Ul6dPV9WhlEc6No1DtklGF69iwnVNW3BEE=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
github.com/povsister/scp v0.0.0-20250701154629-777cf82de5df h1:zEgSHrxo8f6hGG1xCaqunfBq8hlfDmFd1JM0QXiQi7o=
@@ -1497,8 +1497,8 @@ modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg=
modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
-modernc.org/sqlite v1.54.0 h1:JCxR4qwkJvOaqAoYcgDoO25Nc+ROg6EJ2LfBVzdrgog=
-modernc.org/sqlite v1.54.0/go.mod h1:4ntCLuNmnH8+GNqjka1wNg7KJd5/Hi5FYp8K+XQ7GZw=
+modernc.org/sqlite v1.55.0 h1:hIFh0MCH0rGinQ/4KYb5/UbCkRkb+UP+OkLCVWa5MTM=
+modernc.org/sqlite v1.55.0/go.mod h1:4ntCLuNmnH8+GNqjka1wNg7KJd5/Hi5FYp8K+XQ7GZw=
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
diff --git a/internal/acmeaccount/service.go b/internal/acmeaccount/service.go
new file mode 100644
index 000000000..c9da9d2d1
--- /dev/null
+++ b/internal/acmeaccount/service.go
@@ -0,0 +1,119 @@
+package acmeaccount
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/certimate-go/certimate/internal/certacme"
+ "github.com/certimate-go/certimate/internal/domain"
+ "github.com/certimate-go/certimate/internal/domain/dtos"
+)
+
+type acmeAccountRepository interface {
+ List(ctx context.Context, page, perPage int, ca string) ([]*domain.ACMEAccount, int64, error)
+ GetById(ctx context.Context, id string) (*domain.ACMEAccount, error)
+}
+
+type Service struct {
+ repo acmeAccountRepository
+}
+
+func NewService(repo acmeAccountRepository) *Service {
+ return &Service{repo: repo}
+}
+
+func (s *Service) List(ctx context.Context, req *dtos.ACMEAccountListReq) (*dtos.ACMEAccountListResp, error) {
+ page := 1
+ perPage := 15
+ ca := ""
+ if req != nil {
+ page = req.Page
+ perPage = req.PerPage
+ ca = req.CA
+ }
+ if page < 1 {
+ page = 1
+ }
+ if perPage < 1 {
+ perPage = 15
+ }
+ if perPage > 100 {
+ perPage = 100
+ }
+
+ accounts, total, err := s.repo.List(ctx, page, perPage, ca)
+ if err != nil {
+ return nil, fmt.Errorf("failed to list acme accounts: %w", err)
+ }
+
+ items := make([]*dtos.ACMEAccountView, 0, len(accounts))
+ for _, account := range accounts {
+ items = append(items, toView(account))
+ }
+ return &dtos.ACMEAccountListResp{
+ Items: items,
+ TotalItems: total,
+ Page: page,
+ PerPage: perPage,
+ }, nil
+}
+
+func (s *Service) Import(ctx context.Context, req *dtos.ACMEAccountImportReq) (*dtos.ACMEAccountImportResp, error) {
+ if req == nil {
+ return nil, domain.NewError(400, "request body is empty")
+ }
+
+ account, err := certacme.ImportACMEAccount(ctx, &certacme.ImportACMEAccountOptions{
+ CA: req.CA,
+ ACMEDirUrl: req.ACMEDirUrl,
+ PrivateKeyPem: req.PrivateKeyPem,
+ Email: req.Email,
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ return &dtos.ACMEAccountImportResp{Item: toView(account)}, nil
+}
+
+func (s *Service) Export(ctx context.Context, accountId string) (*dtos.ACMEAccountExportResp, error) {
+ if accountId == "" {
+ return nil, domain.NewError(400, "the account id is empty")
+ }
+
+ account, err := s.repo.GetById(ctx, accountId)
+ if err != nil {
+ if domain.IsRecordNotFoundError(err) {
+ return nil, domain.ErrRecordNotFound
+ }
+ return nil, fmt.Errorf("failed to get acme account: %w", err)
+ }
+ if account.PrivateKey == "" {
+ return nil, domain.NewError(404, "private key is empty")
+ }
+
+ return &dtos.ACMEAccountExportResp{PrivateKeyPem: account.PrivateKey}, nil
+}
+
+func (s *Service) Rotate(ctx context.Context, accountId string) (*dtos.ACMEAccountRotateResp, error) {
+ account, err := certacme.RotateACMEAccountKey(ctx, accountId)
+ if err != nil {
+ return nil, err
+ }
+ return &dtos.ACMEAccountRotateResp{Item: toView(account)}, nil
+}
+
+func toView(account *domain.ACMEAccount) *dtos.ACMEAccountView {
+ if account == nil {
+ return nil
+ }
+ return &dtos.ACMEAccountView{
+ Id: account.Id,
+ CA: account.CA,
+ Email: account.Email,
+ ACMEDirectoryUrl: account.ACMEDirectoryUrl,
+ ACMEAccountUrl: account.ACMEAccountUrl,
+ CreatedAt: account.CreatedAt,
+ UpdatedAt: account.UpdatedAt,
+ }
+}
diff --git a/internal/acmeaccount/service_test.go b/internal/acmeaccount/service_test.go
new file mode 100644
index 000000000..b19b969cf
--- /dev/null
+++ b/internal/acmeaccount/service_test.go
@@ -0,0 +1,160 @@
+package acmeaccount
+
+import (
+ "context"
+ "testing"
+ "time"
+
+ "github.com/certimate-go/certimate/internal/domain"
+ "github.com/certimate-go/certimate/internal/domain/dtos"
+)
+
+type mockRepo struct {
+ accounts []*domain.ACMEAccount
+ byID map[string]*domain.ACMEAccount
+ page int
+ perPage int
+ ca string
+}
+
+func (m *mockRepo) List(ctx context.Context, page, perPage int, ca string) ([]*domain.ACMEAccount, int64, error) {
+ m.page = page
+ m.perPage = perPage
+ m.ca = ca
+ filtered := make([]*domain.ACMEAccount, 0)
+ for _, a := range m.accounts {
+ if ca != "" && a.CA != ca {
+ continue
+ }
+ filtered = append(filtered, a)
+ }
+ total := int64(len(filtered))
+ if page < 1 {
+ page = 1
+ }
+ if perPage < 1 {
+ perPage = 15
+ }
+ start := (page - 1) * perPage
+ if start >= len(filtered) {
+ return []*domain.ACMEAccount{}, total, nil
+ }
+ end := start + perPage
+ if end > len(filtered) {
+ end = len(filtered)
+ }
+ return filtered[start:end], total, nil
+}
+
+func (m *mockRepo) GetById(ctx context.Context, id string) (*domain.ACMEAccount, error) {
+ if a, ok := m.byID[id]; ok {
+ return a, nil
+ }
+ return nil, domain.ErrRecordNotFound
+}
+
+func TestList_OmitsPrivateKeyAndPaginates(t *testing.T) {
+ repo := &mockRepo{
+ accounts: []*domain.ACMEAccount{
+ {
+ Meta: domain.Meta{Id: "a1", CreatedAt: time.Now(), UpdatedAt: time.Now()},
+ CA: "letsencrypt",
+ Email: "a@example.com",
+ PrivateKey: "-----BEGIN EC PRIVATE KEY-----\nSECRET\n-----END EC PRIVATE KEY-----",
+ ACMEDirectoryUrl: "https://acme-v02.api.letsencrypt.org/directory",
+ ACMEAccountUrl: "https://acme-v02.api.letsencrypt.org/acme/acct/1",
+ },
+ {
+ Meta: domain.Meta{Id: "a2", CreatedAt: time.Now(), UpdatedAt: time.Now()},
+ CA: "zerossl",
+ Email: "b@example.com",
+ PrivateKey: "SECRET2",
+ ACMEDirectoryUrl: "https://acme.zerossl.com/v2/DV90",
+ ACMEAccountUrl: "https://acme.zerossl.com/v2/DV90/account/2",
+ },
+ },
+ }
+ svc := NewService(repo)
+ resp, err := svc.List(context.Background(), &dtos.ACMEAccountListReq{Page: 1, PerPage: 1})
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(resp.Items) != 1 {
+ t.Fatalf("expected 1 item, got %d", len(resp.Items))
+ }
+ if resp.TotalItems != 2 {
+ t.Fatalf("totalItems = %d", resp.TotalItems)
+ }
+ if resp.Page != 1 || resp.PerPage != 1 {
+ t.Fatalf("page/perPage = %d/%d", resp.Page, resp.PerPage)
+ }
+ if resp.Items[0].Email != "a@example.com" {
+ t.Fatalf("email = %q", resp.Items[0].Email)
+ }
+ if resp.Items[0].Id != "a1" || resp.Items[0].ACMEAccountUrl == "" {
+ t.Fatalf("unexpected view: %+v", resp.Items[0])
+ }
+}
+
+func TestList_FilterByCA(t *testing.T) {
+ repo := &mockRepo{
+ accounts: []*domain.ACMEAccount{
+ {Meta: domain.Meta{Id: "a1"}, CA: "letsencrypt", Email: "a@example.com"},
+ {Meta: domain.Meta{Id: "a2"}, CA: "zerossl", Email: "b@example.com"},
+ },
+ }
+ svc := NewService(repo)
+ resp, err := svc.List(context.Background(), &dtos.ACMEAccountListReq{Page: 1, PerPage: 10, CA: "zerossl"})
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(resp.Items) != 1 || resp.TotalItems != 1 || resp.Items[0].CA != "zerossl" {
+ t.Fatalf("unexpected: %+v total=%d", resp.Items, resp.TotalItems)
+ }
+ if repo.ca != "zerossl" {
+ t.Fatalf("repo ca = %q", repo.ca)
+ }
+}
+
+func TestExport_ReturnsPEM(t *testing.T) {
+ pem := "-----BEGIN EC PRIVATE KEY-----\nTEST\n-----END EC PRIVATE KEY-----"
+ repo := &mockRepo{
+ byID: map[string]*domain.ACMEAccount{
+ "a1": {
+ Meta: domain.Meta{Id: "a1"},
+ PrivateKey: pem,
+ },
+ },
+ }
+ svc := NewService(repo)
+ resp, err := svc.Export(context.Background(), "a1")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if resp.PrivateKeyPem != pem {
+ t.Fatalf("pem mismatch")
+ }
+}
+
+func TestExport_NotFound(t *testing.T) {
+ svc := NewService(&mockRepo{byID: map[string]*domain.ACMEAccount{}})
+ _, err := svc.Export(context.Background(), "missing")
+ if !domain.IsRecordNotFoundError(err) {
+ t.Fatalf("expected not found, got %v", err)
+ }
+}
+
+func TestToView_Nil(t *testing.T) {
+ if toView(nil) != nil {
+ t.Fatal("expected nil")
+ }
+}
+
+func TestImport_NilRequest(t *testing.T) {
+ svc := NewService(&mockRepo{})
+ _, err := svc.Import(context.Background(), nil)
+ if err == nil {
+ t.Fatal("expected error")
+ }
+ _ = &dtos.ACMEAccountImportReq{}
+}
diff --git a/internal/app/app.go b/internal/app/app.go
index 22835d6fb..7ad440f97 100644
--- a/internal/app/app.go
+++ b/internal/app/app.go
@@ -1,7 +1,7 @@
-package app
+package app
const (
AppName = "Certimate"
- AppVersion = "0.4.29"
+ AppVersion = "0.4.31"
AppUserAgent = AppName + "/" + AppVersion
)
diff --git a/internal/certacme/account_import.go b/internal/certacme/account_import.go
new file mode 100644
index 000000000..2af1a2fb3
--- /dev/null
+++ b/internal/certacme/account_import.go
@@ -0,0 +1,173 @@
+package certacme
+
+import (
+ "context"
+ "crypto"
+ "fmt"
+ "strings"
+
+ "github.com/go-acme/lego/v5/acme"
+ "github.com/go-acme/lego/v5/lego"
+
+ "github.com/certimate-go/certimate/internal/app"
+ "github.com/certimate-go/certimate/internal/domain"
+ "github.com/certimate-go/certimate/internal/repository"
+ xcert "github.com/certimate-go/certimate/pkg/utils/cert"
+)
+
+type ImportACMEAccountOptions struct {
+ CA string
+ ACMEDirUrl string
+ PrivateKeyPem string
+ Email string
+}
+
+func ImportACMEAccount(ctx context.Context, opts *ImportACMEAccountOptions) (*ACMEAccount, error) {
+ if opts == nil {
+ return nil, domain.NewError(400, "the import options are nil")
+ }
+ if strings.TrimSpace(opts.CA) == "" {
+ return nil, domain.NewError(400, "the ca is empty")
+ }
+ if strings.TrimSpace(opts.PrivateKeyPem) == "" {
+ return nil, domain.NewError(400, "the private key is empty")
+ }
+
+ dirUrl, err := resolveImportDirectoryURL(opts.CA, opts.ACMEDirUrl)
+ if err != nil {
+ return nil, err
+ }
+
+ privKey, err := xcert.ParsePrivateKeyFromPEM(opts.PrivateKeyPem)
+ if err != nil {
+ return nil, domain.NewError(400, fmt.Sprintf("invalid private key pem: %v", err))
+ }
+ signer, ok := privKey.(crypto.Signer)
+ if !ok {
+ return nil, domain.NewError(400, "private key is not a crypto.Signer")
+ }
+
+ keyPEM, err := xcert.ConvertPrivateKeyToPEM(privKey, false)
+ if err != nil {
+ keyPEM = opts.PrivateKeyPem
+ }
+
+ placeholder := &acme.Account{}
+ tempEmail := strings.TrimSpace(opts.Email)
+ if tempEmail == "" {
+ tempEmail = "import@local"
+ }
+
+ legoUser := &importLegoUser{
+ email: tempEmail,
+ privateKey: signer,
+ registration: &acme.ExtendedAccount{
+ Account: *placeholder,
+ Location: "",
+ },
+ }
+
+ legoCfg := lego.NewConfig(legoUser)
+ legoCfg.UserAgent = app.AppUserAgent
+ legoCfg.CADirURL = dirUrl
+ legoClient, err := lego.NewClient(legoCfg)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create lego client: %w", err)
+ }
+
+ resolved, err := legoClient.Registration.ResolveAccountByKey(ctx)
+ if err != nil {
+ return nil, domain.NewError(404, fmt.Sprintf("failed to resolve acme account by key: %v", err))
+ }
+ if resolved == nil || resolved.Location == "" {
+ return nil, domain.NewError(404, "acme account not found for the given private key")
+ }
+
+ email := extractEmailFromContacts(resolved.Contact)
+ if email == "" {
+ email = strings.TrimSpace(opts.Email)
+ }
+ if email == "" {
+ return nil, domain.NewError(400, "the account has no email contact; please provide an email")
+ }
+
+ accountRepo := repository.NewACMEAccountRepository()
+ existing, err := accountRepo.GetByCAAndAcctUrl(ctx, opts.CA, resolved.Location)
+ if err != nil && !domain.IsRecordNotFoundError(err) {
+ return nil, fmt.Errorf("failed to check existing acme account: %w", err)
+ }
+ if existing != nil {
+ return nil, domain.NewError(409, "acme account already exists")
+ }
+
+ if byEmail, err := accountRepo.GetByCAAndEmail(ctx, opts.CA, dirUrl, email); err == nil && byEmail != nil {
+ if byEmail.ACMEAccountUrl == resolved.Location {
+ return nil, domain.NewError(409, "acme account already exists")
+ }
+ } else if err != nil && !domain.IsRecordNotFoundError(err) {
+ return nil, fmt.Errorf("failed to check existing acme account by email: %w", err)
+ }
+
+ account := &ACMEAccount{
+ CA: opts.CA,
+ Email: email,
+ PrivateKey: keyPEM,
+ ACMEDirectoryUrl: dirUrl,
+ ACMEAccountUrl: resolved.Location,
+ ResourceObject: &resolved.Account,
+ }
+
+ if _, err := accountRepo.Save(ctx, account); err != nil {
+ return nil, fmt.Errorf("failed to save acme account record: %w", err)
+ }
+
+ return account, nil
+}
+
+func resolveImportDirectoryURL(ca, explicitDir string) (string, error) {
+ if strings.TrimSpace(explicitDir) != "" {
+ return strings.TrimSpace(explicitDir), nil
+ }
+
+ provider := domain.CAProviderType(ca)
+ if provider == domain.CAProviderTypeACMECA {
+ return "", domain.NewError(400, "acmeDirUrl is required for custom ACME CA")
+ }
+
+ dirUrl, err := getCADirUrl(provider, nil, "")
+ if err != nil {
+ return "", domain.NewError(400, err.Error())
+ }
+ return dirUrl, nil
+}
+
+func extractEmailFromContacts(contacts []string) string {
+ for _, c := range contacts {
+ c = strings.TrimSpace(c)
+ if strings.HasPrefix(strings.ToLower(c), "mailto:") {
+ email := strings.TrimSpace(c[len("mailto:"):])
+ if email != "" {
+ return email
+ }
+ }
+ }
+ return ""
+}
+
+type importLegoUser struct {
+ email string
+ privateKey crypto.Signer
+ registration *acme.ExtendedAccount
+}
+
+func (u *importLegoUser) GetEmail() string {
+ return u.email
+}
+
+func (u *importLegoUser) GetRegistration() *acme.ExtendedAccount {
+ return u.registration
+}
+
+func (u *importLegoUser) GetPrivateKey() crypto.Signer {
+ return u.privateKey
+}
diff --git a/internal/certacme/account_import_test.go b/internal/certacme/account_import_test.go
new file mode 100644
index 000000000..a08a34e1f
--- /dev/null
+++ b/internal/certacme/account_import_test.go
@@ -0,0 +1,48 @@
+package certacme
+
+import "testing"
+
+func TestExtractEmailFromContacts(t *testing.T) {
+ tests := []struct {
+ name string
+ contacts []string
+ want string
+ }{
+ {"empty", nil, ""},
+ {"mailto", []string{"mailto:user@example.com"}, "user@example.com"},
+ {"mixed", []string{"tel:+1", "mailto:u@x.com"}, "u@x.com"},
+ {"whitespace", []string{" mailto: spaced@x.com "}, "spaced@x.com"},
+ {"no mailto", []string{"user@example.com"}, ""},
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ got := extractEmailFromContacts(tt.contacts)
+ if got != tt.want {
+ t.Fatalf("got %q want %q", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestResolveImportDirectoryURL(t *testing.T) {
+ dir, err := resolveImportDirectoryURL("letsencrypt", "")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if dir != "https://acme-v02.api.letsencrypt.org/directory" {
+ t.Fatalf("dir = %q", dir)
+ }
+
+ dir, err = resolveImportDirectoryURL("letsencrypt", "https://custom.example/directory")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if dir != "https://custom.example/directory" {
+ t.Fatalf("override dir = %q", dir)
+ }
+
+ _, err = resolveImportDirectoryURL("acmeca", "")
+ if err == nil {
+ t.Fatal("expected error for acmeca without dir")
+ }
+}
diff --git a/internal/certacme/account_rotate.go b/internal/certacme/account_rotate.go
new file mode 100644
index 000000000..bdb7115d7
--- /dev/null
+++ b/internal/certacme/account_rotate.go
@@ -0,0 +1,91 @@
+package certacme
+
+import (
+ "context"
+ "crypto/ecdsa"
+ "crypto/elliptic"
+ "crypto/rand"
+ "fmt"
+
+ "github.com/go-acme/lego/v5/acme"
+ "github.com/go-acme/lego/v5/lego"
+
+ "github.com/certimate-go/certimate/internal/app"
+ "github.com/certimate-go/certimate/internal/domain"
+ "github.com/certimate-go/certimate/internal/repository"
+ xcert "github.com/certimate-go/certimate/pkg/utils/cert"
+)
+
+func RotateACMEAccountKey(ctx context.Context, accountId string) (*ACMEAccount, error) {
+ if accountId == "" {
+ return nil, domain.NewError(400, "the account id is empty")
+ }
+
+ accountRepo := repository.NewACMEAccountRepository()
+ account, err := accountRepo.GetById(ctx, accountId)
+ if err != nil {
+ if domain.IsRecordNotFoundError(err) {
+ return nil, domain.ErrRecordNotFound
+ }
+ return nil, fmt.Errorf("failed to get acme account: %w", err)
+ }
+
+ currentKey := account.GetPrivateKey()
+ if currentKey == nil {
+ return nil, domain.NewError(400, "stored private key is invalid or empty")
+ }
+
+ newKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
+ if err != nil {
+ return nil, fmt.Errorf("failed to generate new account key: %w", err)
+ }
+ newKeyPEM, err := xcert.ConvertECPrivateKeyToPEM(newKey, false)
+ if err != nil {
+ return nil, fmt.Errorf("failed to encode new account key: %w", err)
+ }
+
+ reg := account.GetRegistration()
+ if reg == nil || reg.Location == "" {
+ return nil, domain.NewError(400, "account registration location is empty")
+ }
+
+ legoUser := &importLegoUser{
+ email: account.Email,
+ privateKey: currentKey,
+ registration: reg,
+ }
+
+ legoCfg := lego.NewConfig(legoUser)
+ legoCfg.UserAgent = app.AppUserAgent
+ legoCfg.CADirURL = account.ACMEDirectoryUrl
+ legoClient, err := lego.NewClient(legoCfg)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create lego client: %w", err)
+ }
+
+ if err := legoClient.Registration.KeyRollover(ctx, newKey); err != nil {
+ return nil, fmt.Errorf("failed to rollover acme account key: %w", err)
+ }
+
+ legoUser.privateKey = newKey
+ legoUser.registration = &acme.ExtendedAccount{
+ Account: *account.ResourceObject,
+ Location: account.ACMEAccountUrl,
+ }
+ legoCfg2 := lego.NewConfig(legoUser)
+ legoCfg2.UserAgent = app.AppUserAgent
+ legoCfg2.CADirURL = account.ACMEDirectoryUrl
+ legoClient2, err := lego.NewClient(legoCfg2)
+ if err == nil {
+ if refreshed, qerr := legoClient2.Registration.QueryRegistration(ctx); qerr == nil && refreshed != nil {
+ account.ResourceObject = &refreshed.Account
+ }
+ }
+
+ account.PrivateKey = newKeyPEM
+ if _, err := accountRepo.Save(ctx, account); err != nil {
+ return nil, fmt.Errorf("failed to save rotated acme account: %w", err)
+ }
+
+ return account, nil
+}
diff --git a/internal/certacme/client_ari.go b/internal/certacme/client_ari.go
new file mode 100644
index 000000000..16bbac5e0
--- /dev/null
+++ b/internal/certacme/client_ari.go
@@ -0,0 +1,45 @@
+package certacme
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "time"
+
+ "github.com/go-acme/lego/v5/acme/api"
+
+ xcert "github.com/certimate-go/certimate/pkg/utils/cert"
+)
+
+type ARIInfo struct {
+ WindowStart time.Time
+ WindowEnd time.Time
+ NextRefreshAt time.Time
+ Supported bool
+}
+
+func (c *ACMEClient) GetARIInfo(ctx context.Context, certPEM string) (*ARIInfo, error) {
+ if certPEM == "" {
+ return nil, fmt.Errorf("the certificate PEM is empty")
+ }
+
+ certX509, err := xcert.ParseCertificateFromPEM(certPEM)
+ if err != nil {
+ return nil, fmt.Errorf("failed to parse certificate PEM: %w", err)
+ }
+
+ renewalInfo, err := c.client.Certificate.GetRenewalInfo(ctx, certX509)
+ if err != nil {
+ if errors.Is(err, api.ErrNoARI) {
+ return &ARIInfo{Supported: false}, nil
+ }
+ return nil, err
+ }
+
+ return &ARIInfo{
+ WindowStart: renewalInfo.SuggestedWindow.Start,
+ WindowEnd: renewalInfo.SuggestedWindow.End,
+ NextRefreshAt: time.Now().Add(renewalInfo.RetryAfter),
+ Supported: true,
+ }, nil
+}
diff --git a/internal/certacme/client_obtain.go b/internal/certacme/client_obtain.go
index 32c1b6d5f..a1c44692b 100644
--- a/internal/certacme/client_obtain.go
+++ b/internal/certacme/client_obtain.go
@@ -54,6 +54,7 @@ type ObtainCertificateRequest struct {
ACMEProfile string
// ARI 相关
+ DisableARI bool
ARIReplacesAccountUrl string
ARIReplacesCertId string
}
@@ -66,6 +67,8 @@ type ObtainCertificateResponse struct {
PrivateKey string
ACMEAccountUrl string
ACMECertificateUrl string
+ ARIInfo *ARIInfo
+ ARIError string
ARIReplaced bool
}
@@ -183,7 +186,7 @@ func (c *ACMEClient) ObtainCertificate(ctx context.Context, request *ObtainCerti
}
}
- return &ObtainCertificateResponse{
+ obtainResp := &ObtainCertificateResponse{
CAProvider: domain.CAProviderType(c.account.CA),
CSR: strings.TrimSpace(string(resp.CSR)),
FullChainCertificate: strings.TrimSpace(string(resp.Certificate)),
@@ -192,5 +195,16 @@ func (c *ACMEClient) ObtainCertificate(ctx context.Context, request *ObtainCerti
ACMEAccountUrl: c.account.ACMEAccountUrl,
ACMECertificateUrl: resp.CertURL,
ARIReplaced: req.ReplacesCertID != "",
- }, nil
+ }
+
+ if !request.DisableARI {
+ ariInfo, err := c.GetARIInfo(ctx, obtainResp.FullChainCertificate)
+ if err != nil {
+ obtainResp.ARIError = err.Error()
+ } else {
+ obtainResp.ARIInfo = ariInfo
+ }
+ }
+
+ return obtainResp, nil
}
diff --git a/internal/certmgmt/deployers/sp_axisnow.go b/internal/certmgmt/deployers/sp_axisnow.go
new file mode 100644
index 000000000..48d114a1a
--- /dev/null
+++ b/internal/certmgmt/deployers/sp_axisnow.go
@@ -0,0 +1,24 @@
+package deployers
+
+import (
+ "fmt"
+
+ "github.com/certimate-go/certimate/internal/domain"
+ "github.com/certimate-go/certimate/pkg/core"
+ dplyimpl "github.com/certimate-go/certimate/pkg/core/deployer/providers/axisnow"
+ xmaps "github.com/certimate-go/certimate/pkg/utils/maps"
+)
+
+func init() {
+ Registries.MustRegister(domain.DeploymentProviderTypeAxisNow, func(options *ProviderFactoryOptions) (core.Deployer, error) {
+ credentials := domain.AccessConfigForAxisNow{}
+ if err := xmaps.Populate(options.ProviderAccessConfig, &credentials); err != nil {
+ return nil, fmt.Errorf("failed to populate provider access config: %w", err)
+ }
+
+ provider, err := dplyimpl.NewDeployer(&dplyimpl.DeployerConfig{
+ ApiToken: credentials.ApiToken,
+ })
+ return provider, err
+ })
+}
diff --git a/internal/certmgmt/deployers/sp_huaweiibmc.go b/internal/certmgmt/deployers/sp_huaweiibmc.go
new file mode 100644
index 000000000..4029a2ee9
--- /dev/null
+++ b/internal/certmgmt/deployers/sp_huaweiibmc.go
@@ -0,0 +1,27 @@
+package deployers
+
+import (
+ "fmt"
+
+ "github.com/certimate-go/certimate/internal/domain"
+ "github.com/certimate-go/certimate/pkg/core"
+ dplyimpl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweiibmc"
+ xmaps "github.com/certimate-go/certimate/pkg/utils/maps"
+)
+
+func init() {
+ Registries.MustRegister(domain.DeploymentProviderTypeHuaweiIBMC, func(options *ProviderFactoryOptions) (core.Deployer, error) {
+ credentials := domain.AccessConfigForHuaweiIBMC{}
+ if err := xmaps.Populate(options.ProviderAccessConfig, &credentials); err != nil {
+ return nil, fmt.Errorf("failed to populate Huawei iBMC access config: %w", err)
+ }
+ provider, err := dplyimpl.NewDeployer(&dplyimpl.DeployerConfig{
+ Host: credentials.Host,
+ Username: credentials.Username,
+ Password: credentials.Password,
+ AllowInsecureConnections: credentials.AllowInsecureConnections,
+ AutoRestart: xmaps.GetBool(options.ProviderExtendedConfig, "autoRestart"),
+ })
+ return provider, err
+ })
+}
diff --git a/internal/certmgmt/deployers/sp_proxmoxbs.go b/internal/certmgmt/deployers/sp_proxmoxbs.go
new file mode 100644
index 000000000..0d3e99044
--- /dev/null
+++ b/internal/certmgmt/deployers/sp_proxmoxbs.go
@@ -0,0 +1,29 @@
+package deployers
+
+import (
+ "fmt"
+
+ "github.com/certimate-go/certimate/internal/domain"
+ "github.com/certimate-go/certimate/pkg/core"
+ dplyimpl "github.com/certimate-go/certimate/pkg/core/deployer/providers/proxmoxbs"
+ xmaps "github.com/certimate-go/certimate/pkg/utils/maps"
+)
+
+func init() {
+ Registries.MustRegister(domain.DeploymentProviderTypeProxmoxBS, func(options *ProviderFactoryOptions) (core.Deployer, error) {
+ credentials := domain.AccessConfigForProxmoxBS{}
+ if err := xmaps.Populate(options.ProviderAccessConfig, &credentials); err != nil {
+ return nil, fmt.Errorf("failed to populate provider access config: %w", err)
+ }
+
+ provider, err := dplyimpl.NewDeployer(&dplyimpl.DeployerConfig{
+ ServerUrl: credentials.ServerUrl,
+ ApiToken: credentials.ApiToken,
+ ApiTokenSecret: credentials.ApiTokenSecret,
+ AllowInsecureConnections: credentials.AllowInsecureConnections,
+ NodeName: xmaps.GetString(options.ProviderExtendedConfig, "nodeName"),
+ AutoRestart: xmaps.GetBool(options.ProviderExtendedConfig, "autoRestart"),
+ })
+ return provider, err
+ })
+}
diff --git a/internal/certmgmt/deployers/sp_qingcloud_lb.go b/internal/certmgmt/deployers/sp_qingcloud_lb.go
index 10218fb3a..eb30457e7 100644
--- a/internal/certmgmt/deployers/sp_qingcloud_lb.go
+++ b/internal/certmgmt/deployers/sp_qingcloud_lb.go
@@ -17,12 +17,12 @@ func init() {
}
provider, err := dplyimpl.NewDeployer(&dplyimpl.DeployerConfig{
- AccessKeyId: credentials.AccessKeyId,
- SecretAccessKey: credentials.SecretAccessKey,
- ZoneId: xmaps.GetString(options.ProviderExtendedConfig, "zoneId"),
- DeployTarget: xmaps.GetString(options.ProviderExtendedConfig, "deployTarget"),
- LoadbalancerId: xmaps.GetString(options.ProviderExtendedConfig, "loadbalancerId"),
- ListenerId: xmaps.GetString(options.ProviderExtendedConfig, "listenerId"),
+ AccessKeyId: credentials.AccessKeyId,
+ SecretAccessKey: credentials.SecretAccessKey,
+ ZoneId: xmaps.GetString(options.ProviderExtendedConfig, "zoneId"),
+ DeployTarget: xmaps.GetString(options.ProviderExtendedConfig, "deployTarget"),
+ LoadbalancerId: xmaps.GetString(options.ProviderExtendedConfig, "loadbalancerId"),
+ ListenerId: xmaps.GetString(options.ProviderExtendedConfig, "listenerId"),
})
return provider, err
})
diff --git a/internal/domain/access.go b/internal/domain/access.go
index bbe32400d..7abe636bd 100644
--- a/internal/domain/access.go
+++ b/internal/domain/access.go
@@ -87,6 +87,10 @@ type AccessConfigForAWS struct {
SecretAccessKey string `json:"secretAccessKey"`
}
+type AccessConfigForAxisNow struct {
+ ApiToken string `json:"apiToken"`
+}
+
type AccessConfigForAzure struct {
TenantId string `json:"tenantId"`
ClientId string `json:"clientId"`
@@ -344,6 +348,13 @@ type AccessConfigForHuaweiCloud struct {
EnterpriseProjectId string `json:"enterpriseProjectId,omitempty"`
}
+type AccessConfigForHuaweiIBMC struct {
+ Host string `json:"host"`
+ Username string `json:"username"`
+ Password string `json:"password"`
+ AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
+}
+
type AccessConfigForInfomaniak struct {
AccessToken string `json:"accessToken"`
}
@@ -478,10 +489,17 @@ type AccessConfigForPowerDNS struct {
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
}
+type AccessConfigForProxmoxBS struct {
+ ServerUrl string `json:"serverUrl"`
+ ApiToken string `json:"apiToken"`
+ ApiTokenSecret string `json:"apiTokenSecret"`
+ AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
+}
+
type AccessConfigForProxmoxVE struct {
ServerUrl string `json:"serverUrl"`
ApiToken string `json:"apiToken"`
- ApiTokenSecret string `json:"apiTokenSecret,omitempty"`
+ ApiTokenSecret string `json:"apiTokenSecret"`
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
}
diff --git a/internal/domain/dtos/acme_account.go b/internal/domain/dtos/acme_account.go
new file mode 100644
index 000000000..40c0ec77e
--- /dev/null
+++ b/internal/domain/dtos/acme_account.go
@@ -0,0 +1,45 @@
+package dtos
+
+import "time"
+
+type ACMEAccountView struct {
+ Id string `json:"id"`
+ CA string `json:"ca"`
+ Email string `json:"email"`
+ ACMEDirectoryUrl string `json:"acmeDirUrl"`
+ ACMEAccountUrl string `json:"acmeAcctUrl"`
+ CreatedAt time.Time `json:"created"`
+ UpdatedAt time.Time `json:"updated"`
+}
+
+type ACMEAccountListReq struct {
+ Page int `json:"-"`
+ PerPage int `json:"-"`
+ CA string `json:"-"`
+}
+
+type ACMEAccountListResp struct {
+ Items []*ACMEAccountView `json:"items"`
+ TotalItems int64 `json:"totalItems"`
+ Page int `json:"page"`
+ PerPage int `json:"perPage"`
+}
+
+type ACMEAccountImportReq struct {
+ PrivateKeyPem string `json:"privateKeyPem"`
+ CA string `json:"ca"`
+ ACMEDirUrl string `json:"acmeDirUrl,omitempty"`
+ Email string `json:"email,omitempty"`
+}
+
+type ACMEAccountImportResp struct {
+ Item *ACMEAccountView `json:"item"`
+}
+
+type ACMEAccountExportResp struct {
+ PrivateKeyPem string `json:"privateKeyPem"`
+}
+
+type ACMEAccountRotateResp struct {
+ Item *ACMEAccountView `json:"item"`
+}
diff --git a/internal/domain/provider.go b/internal/domain/provider.go
index 0924ea1b6..74e275fb6 100644
--- a/internal/domain/provider.go
+++ b/internal/domain/provider.go
@@ -25,6 +25,7 @@ const (
AccessProviderTypeAPISIX = AccessProviderType("apisix")
AccessProviderTypeArvanCloud = AccessProviderType("arvancloud")
AccessProviderTypeAWS = AccessProviderType("aws")
+ AccessProviderTypeAxisNow = AccessProviderType("axisnow")
AccessProviderTypeAzure = AccessProviderType("azure")
AccessProviderTypeBaiduCloud = AccessProviderType("baiducloud")
AccessProviderTypeBaishan = AccessProviderType("baishan")
@@ -75,6 +76,7 @@ const (
AccessProviderTypeHostingde = AccessProviderType("hostingde")
AccessProviderTypeHostinger = AccessProviderType("hostinger")
AccessProviderTypeHuaweiCloud = AccessProviderType("huaweicloud")
+ AccessProviderTypeHuaweiIBMC = AccessProviderType("huaweiibmc")
AccessProviderTypeInfomaniak = AccessProviderType("infomaniak")
AccessProviderTypeIONOS = AccessProviderType("ionos")
AccessProviderTypeJDCloud = AccessProviderType("jdcloud")
@@ -101,6 +103,7 @@ const (
AccessProviderTypeOVHcloud = AccessProviderType("ovhcloud")
AccessProviderTypePorkbun = AccessProviderType("porkbun")
AccessProviderTypePowerDNS = AccessProviderType("powerdns")
+ AccessProviderTypeProxmoxBS = AccessProviderType("proxmoxbs")
AccessProviderTypeProxmoxVE = AccessProviderType("proxmoxve")
AccessProviderTypeQingCloud = AccessProviderType("qingcloud")
AccessProviderTypeRainYun = AccessProviderType("rainyun")
@@ -339,6 +342,7 @@ const (
DeploymentProviderTypeAWSCloudFront = DeploymentProviderType(AccessProviderTypeAWS + "-cloudfront")
DeploymentProviderTypeAWSIAM = DeploymentProviderType(AccessProviderTypeAWS + "-iam")
DeploymentProviderTypeAWSNLB = DeploymentProviderType(AccessProviderTypeAWS + "-nlb")
+ DeploymentProviderTypeAxisNow = DeploymentProviderType(AccessProviderTypeAxisNow)
DeploymentProviderTypeAzureKeyVault = DeploymentProviderType(AccessProviderTypeAzure + "-keyvault")
DeploymentProviderTypeBaiduCloudAppBLB = DeploymentProviderType(AccessProviderTypeBaiduCloud + "-appblb")
DeploymentProviderTypeBaiduCloudBLB = DeploymentProviderType(AccessProviderTypeBaiduCloud + "-blb")
@@ -389,6 +393,7 @@ const (
DeploymentProviderTypeHuaweiCloudSCM = DeploymentProviderType(AccessProviderTypeHuaweiCloud + "-scm")
DeploymentProviderTypeHuaweiCloudVOD = DeploymentProviderType(AccessProviderTypeHuaweiCloud + "-vod")
DeploymentProviderTypeHuaweiCloudWAF = DeploymentProviderType(AccessProviderTypeHuaweiCloud + "-waf")
+ DeploymentProviderTypeHuaweiIBMC = DeploymentProviderType(AccessProviderTypeHuaweiIBMC)
DeploymentProviderTypeJDCloudALB = DeploymentProviderType(AccessProviderTypeJDCloud + "-alb")
DeploymentProviderTypeJDCloudCDN = DeploymentProviderType(AccessProviderTypeJDCloud + "-cdn")
DeploymentProviderTypeJDCloudLive = DeploymentProviderType(AccessProviderTypeJDCloud + "-live")
@@ -406,6 +411,7 @@ const (
DeploymentProviderTypeNetlify = DeploymentProviderType(AccessProviderTypeNetlify)
DeploymentProviderTypeNginxProxyManager = DeploymentProviderType(AccessProviderTypeNginxProxyManager)
DeploymentProviderTypeOracleCloudCertificatesMgmt = DeploymentProviderType(AccessProviderTypeOracleCloud + "-certificatesmgmt")
+ DeploymentProviderTypeProxmoxBS = DeploymentProviderType(AccessProviderTypeProxmoxBS)
DeploymentProviderTypeProxmoxVE = DeploymentProviderType(AccessProviderTypeProxmoxVE)
DeploymentProviderTypeQingCloudLB = DeploymentProviderType(AccessProviderTypeQingCloud + "-lb")
DeploymentProviderTypeRainYunRCDN = DeploymentProviderType(AccessProviderTypeRainYun + "-rcdn")
diff --git a/internal/repository/acme_account.go b/internal/repository/acme_account.go
index 7c9cfe6b2..8d73d9941 100644
--- a/internal/repository/acme_account.go
+++ b/internal/repository/acme_account.go
@@ -52,6 +52,67 @@ func (r *ACMEAccountRepository) GetByCAAndAcctUrl(ctx context.Context, ca string
return r.castRecordToModel(record)
}
+func (r *ACMEAccountRepository) GetById(ctx context.Context, id string) (*domain.ACMEAccount, error) {
+ record, err := app.GetApp().FindRecordById(domain.CollectionNameACMEAccount, id)
+ if err != nil {
+ if errors.Is(err, sql.ErrNoRows) {
+ return nil, domain.ErrRecordNotFound
+ }
+ return nil, err
+ }
+
+ return r.castRecordToModel(record)
+}
+
+func (r *ACMEAccountRepository) List(ctx context.Context, page, perPage int, ca string) ([]*domain.ACMEAccount, int64, error) {
+ if page < 1 {
+ page = 1
+ }
+ if perPage < 1 {
+ perPage = 15
+ }
+ if perPage > 100 {
+ perPage = 100
+ }
+
+ filter := ""
+ params := dbx.Params{}
+ var countExprs []dbx.Expression
+ if ca != "" {
+ filter = "ca={:ca}"
+ params["ca"] = ca
+ countExprs = append(countExprs, dbx.HashExp{"ca": ca})
+ }
+
+ total, err := app.GetApp().CountRecords(domain.CollectionNameACMEAccount, countExprs...)
+ if err != nil {
+ return nil, 0, err
+ }
+
+ offset := (page - 1) * perPage
+ records, err := app.GetApp().FindRecordsByFilter(
+ domain.CollectionNameACMEAccount,
+ filter,
+ "ca,created",
+ perPage,
+ offset,
+ params,
+ )
+ if err != nil {
+ return nil, 0, err
+ }
+
+ accounts := make([]*domain.ACMEAccount, 0, len(records))
+ for _, record := range records {
+ account, err := r.castRecordToModel(record)
+ if err != nil {
+ return nil, 0, err
+ }
+ accounts = append(accounts, account)
+ }
+ return accounts, total, nil
+}
+
func (r *ACMEAccountRepository) Save(ctx context.Context, acmeAccount *domain.ACMEAccount) (*domain.ACMEAccount, error) {
collection, err := app.GetApp().FindCollectionByNameOrId(domain.CollectionNameACMEAccount)
if err != nil {
diff --git a/internal/rest/handlers/acme_accounts.go b/internal/rest/handlers/acme_accounts.go
new file mode 100644
index 000000000..c1a5dda10
--- /dev/null
+++ b/internal/rest/handlers/acme_accounts.go
@@ -0,0 +1,80 @@
+package handlers
+
+import (
+ "context"
+ "strconv"
+
+ "github.com/pocketbase/pocketbase/core"
+ "github.com/pocketbase/pocketbase/tools/router"
+
+ "github.com/certimate-go/certimate/internal/domain/dtos"
+ "github.com/certimate-go/certimate/internal/rest/resp"
+)
+
+type acmeAccountService interface {
+ List(ctx context.Context, req *dtos.ACMEAccountListReq) (*dtos.ACMEAccountListResp, error)
+ Import(ctx context.Context, req *dtos.ACMEAccountImportReq) (*dtos.ACMEAccountImportResp, error)
+ Export(ctx context.Context, accountId string) (*dtos.ACMEAccountExportResp, error)
+ Rotate(ctx context.Context, accountId string) (*dtos.ACMEAccountRotateResp, error)
+}
+
+type ACMEAccountsHandler struct {
+ service acmeAccountService
+}
+
+func NewACMEAccountsHandler(router *router.RouterGroup[*core.RequestEvent], service acmeAccountService) {
+ handler := &ACMEAccountsHandler{service: service}
+
+ group := router.Group("/acme-accounts")
+ group.GET("", handler.list)
+ group.POST("/import", handler.importAccount)
+ group.POST("/{accountId}/export", handler.exportAccount)
+ group.POST("/{accountId}/rotate", handler.rotateAccount)
+}
+
+func (handler *ACMEAccountsHandler) list(e *core.RequestEvent) error {
+ page, _ := strconv.Atoi(e.Request.URL.Query().Get("page"))
+ perPage, _ := strconv.Atoi(e.Request.URL.Query().Get("perPage"))
+ ca := e.Request.URL.Query().Get("ca")
+
+ res, err := handler.service.List(e.Request.Context(), &dtos.ACMEAccountListReq{
+ Page: page,
+ PerPage: perPage,
+ CA: ca,
+ })
+ if err != nil {
+ return resp.Err(e, err)
+ }
+ return resp.Ok(e, res)
+}
+
+func (handler *ACMEAccountsHandler) importAccount(e *core.RequestEvent) error {
+ req := &dtos.ACMEAccountImportReq{}
+ if err := e.BindBody(req); err != nil {
+ return resp.Err(e, err)
+ }
+
+ res, err := handler.service.Import(e.Request.Context(), req)
+ if err != nil {
+ return resp.Err(e, err)
+ }
+ return resp.Ok(e, res)
+}
+
+func (handler *ACMEAccountsHandler) exportAccount(e *core.RequestEvent) error {
+ accountId := e.Request.PathValue("accountId")
+ res, err := handler.service.Export(e.Request.Context(), accountId)
+ if err != nil {
+ return resp.Err(e, err)
+ }
+ return resp.Ok(e, res)
+}
+
+func (handler *ACMEAccountsHandler) rotateAccount(e *core.RequestEvent) error {
+ accountId := e.Request.PathValue("accountId")
+ res, err := handler.service.Rotate(e.Request.Context(), accountId)
+ if err != nil {
+ return resp.Err(e, err)
+ }
+ return resp.Ok(e, res)
+}
diff --git a/internal/rest/routes/routes.go b/internal/rest/routes/routes.go
index e2eaecf71..22e369ae5 100644
--- a/internal/rest/routes/routes.go
+++ b/internal/rest/routes/routes.go
@@ -5,6 +5,7 @@ import (
"github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/tools/router"
+ "github.com/certimate-go/certimate/internal/acmeaccount"
"github.com/certimate-go/certimate/internal/certificate"
"github.com/certimate-go/certimate/internal/notify"
"github.com/certimate-go/certimate/internal/pluginhost"
@@ -37,6 +38,7 @@ func BindRouter(router *router.Router[*core.RequestEvent]) {
statisticsSvc = statistics.NewStatisticsService(statisticsRepo)
notifySvc = notify.NewNotifyService(accessRepo)
providerSchemaSvc = providerschema.NewProviderSchemaService(providerSchemaRepo)
+ acmeAccountSvc := acmeaccount.NewService(acmeAccountRepo)
group := router.Group("/api")
group.Bind(apis.RequireSuperuserAuth())
@@ -48,4 +50,5 @@ func BindRouter(router *router.Router[*core.RequestEvent]) {
handlers.NewPluginCatalogHandler(group, pluginhost.GlobalCatalog())
handlers.NewPluginAdminHandler(group)
handlers.NewPluginMarketHandler(group, pluginhost.GlobalMarketService())
+ handlers.NewACMEAccountsHandler(group, acmeAccountSvc)
}
diff --git a/internal/settings/pbsettings.go b/internal/settings/pbsettings.go
index 3f09b8efb..c1bf26d92 100644
--- a/internal/settings/pbsettings.go
+++ b/internal/settings/pbsettings.go
@@ -1,4 +1,4 @@
-package settings
+package settings
import (
"github.com/certimate-go/certimate/internal/app"
diff --git a/internal/settings/pbstore.go b/internal/settings/pbstore.go
index e253bdfbc..728bec5d0 100644
--- a/internal/settings/pbstore.go
+++ b/internal/settings/pbstore.go
@@ -1,4 +1,4 @@
-package settings
+package settings
import (
"context"
@@ -17,7 +17,7 @@ func GetGlobalSettingsForSSLProvider() domain.SettingsContentForSSLProvider {
if content == nil {
content = domain.SettingsContent{}
}
- return *(content.(domain.SettingsContent)).AsSSLProvider()
+ return *content.(domain.SettingsContent).AsSSLProvider()
}
func GetGlobalSettingsForPersistence() domain.SettingsContentForPersistence {
@@ -27,7 +27,7 @@ func GetGlobalSettingsForPersistence() domain.SettingsContentForPersistence {
if content == nil {
content = domain.SettingsContent{}
}
- return *(content.(domain.SettingsContent)).AsPersistence()
+ return *content.(domain.SettingsContent).AsPersistence()
}
func registerSettingsStoreByName(settingsName string) error {
diff --git a/internal/settings/settings.go b/internal/settings/settings.go
index 860b8027b..5d31bc5f0 100644
--- a/internal/settings/settings.go
+++ b/internal/settings/settings.go
@@ -1,4 +1,4 @@
-package settings
+package settings
import (
"github.com/certimate-go/certimate/internal/domain"
diff --git a/internal/tools/ftp/file.go b/internal/tools/ftp/file.go
index 3c3269547..e38d7005f 100644
--- a/internal/tools/ftp/file.go
+++ b/internal/tools/ftp/file.go
@@ -1,4 +1,4 @@
-package ftp
+package ftp
import (
"github.com/jlaffaye/ftp"
diff --git a/internal/tools/s3/client.go b/internal/tools/s3/client.go
index 72f38ae6f..1b0c1c7cd 100644
--- a/internal/tools/s3/client.go
+++ b/internal/tools/s3/client.go
@@ -1,4 +1,4 @@
-package s3
+package s3
import (
"bytes"
diff --git a/internal/tools/s3/config.go b/internal/tools/s3/config.go
index 9a26743c2..015601aa0 100644
--- a/internal/tools/s3/config.go
+++ b/internal/tools/s3/config.go
@@ -1,4 +1,4 @@
-package s3
+package s3
const (
SignatureV2 = "v2"
diff --git a/internal/tools/smtp/client.go b/internal/tools/smtp/client.go
index db7a104cb..42e65a02a 100644
--- a/internal/tools/smtp/client.go
+++ b/internal/tools/smtp/client.go
@@ -1,4 +1,4 @@
-package smtp
+package smtp
import (
"context"
diff --git a/internal/tools/smtp/config.go b/internal/tools/smtp/config.go
index 7b66aa458..4bbd77ce5 100644
--- a/internal/tools/smtp/config.go
+++ b/internal/tools/smtp/config.go
@@ -1,4 +1,4 @@
-package smtp
+package smtp
const (
defaultPort int = 25
diff --git a/internal/tools/smtp/message.go b/internal/tools/smtp/message.go
index a06673cf0..45be45702 100644
--- a/internal/tools/smtp/message.go
+++ b/internal/tools/smtp/message.go
@@ -1,4 +1,4 @@
-package smtp
+package smtp
import (
"github.com/wneessen/go-mail"
diff --git a/internal/workflow/engine/deps.go b/internal/workflow/engine/deps.go
index b9f62a32b..2246eddbd 100644
--- a/internal/workflow/engine/deps.go
+++ b/internal/workflow/engine/deps.go
@@ -10,6 +10,10 @@ type accessRepository interface {
GetById(ctx context.Context, id string) (*domain.Access, error)
}
+type acmeAccountRepository interface {
+ GetByCAAndAcctUrl(ctx context.Context, ca string, acctUrl string) (*domain.ACMEAccount, error)
+}
+
type certificateRepository interface {
GetById(ctx context.Context, id string) (*domain.Certificate, error)
GetByWorkflowRunIdAndNodeId(ctx context.Context, workflowRunId string, workflowNodeId string) (*domain.Certificate, error)
diff --git a/internal/workflow/engine/executor_bizapply.go b/internal/workflow/engine/executor_bizapply.go
index 04e6a1105..d3f19d5f8 100644
--- a/internal/workflow/engine/executor_bizapply.go
+++ b/internal/workflow/engine/executor_bizapply.go
@@ -10,7 +10,9 @@ import (
"strings"
"time"
+ "github.com/go-acme/lego/v5/acme"
"github.com/go-acme/lego/v5/acme/api"
+ legocert "github.com/go-acme/lego/v5/certificate"
"github.com/go-acme/lego/v5/lego"
"github.com/samber/lo"
"github.com/xhit/go-str2duration/v2"
@@ -55,6 +57,7 @@ type bizApplyNodeExecutor struct {
nodeExecutor
accessRepo accessRepository
+ acmeAccountRepo acmeAccountRepository
certificateRepo certificateRepository
wfoutputRepo workflowOutputRepository
}
@@ -215,15 +218,31 @@ func (ne *bizApplyNodeExecutor) checkCanSkip(execCtx *NodeExecutionContext, last
return false, "the last requested certificate has been revoked"
}
+ now := time.Now()
+ ariTriggered := false
+ if !thisNodeCfg.DisableARI {
+ ariTriggered = ne.evaluateARI(now, lastCertificate, func() (*certacme.ARIInfo, error) {
+ return ne.getARIInfoForCertificate(execCtx, lastCertificate)
+ })
+ }
+
renewalInterval := time.Duration(thisNodeCfg.SkipBeforeExpiryDays) * time.Hour * 24
expirationTime := time.Until(lastCertificate.ValidityNotAfter)
daysLeft := int(math.Floor(expirationTime.Hours() / 24))
- if expirationTime > renewalInterval {
+ staticTriggered := expirationTime <= renewalInterval
+ if !ariTriggered && !staticTriggered {
daysUntilRenewal := int(math.Ceil((expirationTime - renewalInterval).Hours() / 24))
return true, fmt.Sprintf("the last requested certificate expires in %d day(s), a renewal will be performed when the remaining validity is less than %d day(s), and the next renewal will be in %d day(s)", daysLeft, thisNodeCfg.SkipBeforeExpiryDays, daysUntilRenewal)
}
- return false, fmt.Sprintf("the last requested certificate expires in %d day(s), the renewal window period has been reached", daysLeft)
+ switch {
+ case ariTriggered && staticTriggered:
+ return false, fmt.Sprintf("the last requested certificate expires in %d day(s), renewal triggered by both ARI suggestedWindow and SkipBeforeExpiryDays threshold", daysLeft)
+ case ariTriggered:
+ return false, fmt.Sprintf("the last requested certificate expires in %d day(s), renewal triggered by ARI suggestedWindow", daysLeft)
+ default:
+ return false, fmt.Sprintf("the last requested certificate expires in %d day(s), renewal triggered by SkipBeforeExpiryDays threshold", daysLeft)
+ }
}
return false, ""
@@ -345,6 +364,7 @@ func (ne *bizApplyNodeExecutor) execObtainCertificate(execCtx *NodeExecutionCont
HttpDelayWait: nodeCfg.HttpDelayWait,
PreferredChain: nodeCfg.PreferredChain,
ACMEProfile: nodeCfg.ACMEProfile,
+ DisableARI: nodeCfg.DisableARI,
ARIReplacesAccountUrl: lo.
If(nodeCfg.DisableARI || lastCertificate == nil, "").
ElseF(func() string {
@@ -437,6 +457,61 @@ func (ne *bizApplyNodeExecutor) execObtainCertificate(execCtx *NodeExecutionCont
return obtainResp, nil
}
+func (ne *bizApplyNodeExecutor) getARIInfoForCertificate(execCtx *NodeExecutionContext, certificate *domain.Certificate) (*certacme.ARIInfo, error) {
+ if certificate == nil {
+ return nil, fmt.Errorf("the certificate is nil")
+ }
+ if certificate.ACMEAccountUrl == "" {
+ return nil, fmt.Errorf("the certificate has no ACME account URL")
+ }
+
+ acmeAcct, err := ne.acmeAccountRepo.GetByCAAndAcctUrl(execCtx.Context(), certificate.CA, certificate.ACMEAccountUrl)
+ if err != nil {
+ return nil, fmt.Errorf("failed to get ACME account by URL: %w", err)
+ }
+
+ acmeClient, err := certacme.NewACMEClientWithAccount(acmeAcct)
+ if err != nil {
+ return nil, fmt.Errorf("failed to initialize ACME client: %w", err)
+ }
+
+ return acmeClient.GetARIInfo(execCtx.Context(), certificate.Certificate)
+}
+
+func (ne *bizApplyNodeExecutor) evaluateARI(now time.Time, certificate *domain.Certificate, fetch func() (*certacme.ARIInfo, error)) bool {
+ ariInfo, err := fetch()
+ if err != nil {
+ ne.logger.Warn("could not refresh ARI info", slog.String("certificateId", certificate.Id), slog.Any("error", err))
+ return false
+ }
+
+ if ariInfo == nil || !ariInfo.Supported {
+ return false
+ }
+
+ return shouldRenewByARI(ariInfo.WindowStart, ariInfo.WindowEnd, now)
+}
+
+func shouldRenewByARI(windowStart, windowEnd, now time.Time) bool {
+ if windowStart.IsZero() || windowEnd.IsZero() {
+ return false
+ }
+
+ renewalInfo := &legocert.RenewalInfo{
+ ExtendedRenewalInfo: &acme.ExtendedRenewalInfo{
+ RenewalInfo: acme.RenewalInfo{
+ SuggestedWindow: acme.Window{
+ Start: windowStart,
+ End: windowEnd,
+ },
+ },
+ },
+ }
+ return renewalInfo.ShouldRenewAt(now, 0) != nil ||
+ (!now.Before(windowStart) && !now.After(windowEnd)) ||
+ now.After(windowEnd)
+}
+
func (ne *bizApplyNodeExecutor) setOuputsOfResult(execCtx *NodeExecutionContext, execRes *NodeExecutionResult, certificate *domain.Certificate, persistent bool) {
if certificate != nil {
key := "certificate"
@@ -492,6 +567,7 @@ func newBizApplyNodeExecutor() NodeExecutor {
return &bizApplyNodeExecutor{
nodeExecutor: nodeExecutor{logger: slog.Default()},
accessRepo: repository.NewAccessRepository(),
+ acmeAccountRepo: repository.NewACMEAccountRepository(),
certificateRepo: repository.NewCertificateRepository(),
wfoutputRepo: repository.NewWorkflowOutputRepository(),
}
diff --git a/internal/workflow/engine/executor_bizapply_test.go b/internal/workflow/engine/executor_bizapply_test.go
new file mode 100644
index 000000000..5251103c5
--- /dev/null
+++ b/internal/workflow/engine/executor_bizapply_test.go
@@ -0,0 +1,98 @@
+package engine
+
+import (
+ "errors"
+ "log/slog"
+ "testing"
+ "time"
+
+ "github.com/certimate-go/certimate/internal/certacme"
+ "github.com/certimate-go/certimate/internal/domain"
+)
+
+func TestShouldRenewByARI(t *testing.T) {
+ now := time.Date(2026, 6, 9, 12, 0, 0, 0, time.UTC)
+
+ tests := []struct {
+ name string
+ windowStart time.Time
+ windowEnd time.Time
+ want bool
+ }{
+ {
+ name: "inactive window does not renew",
+ windowStart: now.Add(time.Hour),
+ windowEnd: now.Add(2 * time.Hour),
+ want: false,
+ },
+ {
+ name: "active window renews",
+ windowStart: now.Add(-time.Hour),
+ windowEnd: now.Add(time.Hour),
+ want: true,
+ },
+ {
+ name: "passed window renews",
+ windowStart: now.Add(-2 * time.Hour),
+ windowEnd: now.Add(-time.Hour),
+ want: true,
+ },
+ {
+ name: "zero window does not renew",
+ want: false,
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ if got := shouldRenewByARI(tt.windowStart, tt.windowEnd, now); got != tt.want {
+ t.Fatalf("shouldRenewByARI() = %v, want %v", got, tt.want)
+ }
+ })
+ }
+}
+
+func TestEvaluateARI(t *testing.T) {
+ now := time.Date(2026, 8, 7, 12, 0, 0, 0, time.UTC)
+ ne := &bizApplyNodeExecutor{nodeExecutor: nodeExecutor{logger: slog.Default()}}
+
+ t.Run("supported active window triggers renewal", func(t *testing.T) {
+ fetch := func() (*certacme.ARIInfo, error) {
+ return &certacme.ARIInfo{WindowStart: now.Add(-time.Hour), WindowEnd: now.Add(time.Hour), Supported: true}, nil
+ }
+ if !ne.evaluateARI(now, &domain.Certificate{}, fetch) {
+ t.Fatal("expected ARI renewal within the active window")
+ }
+ })
+
+ t.Run("unsupported CA does not trigger", func(t *testing.T) {
+ fetch := func() (*certacme.ARIInfo, error) {
+ return &certacme.ARIInfo{Supported: false}, nil
+ }
+ if ne.evaluateARI(now, &domain.Certificate{}, fetch) {
+ t.Fatal("expected no ARI renewal when CA is unsupported")
+ }
+ })
+
+ t.Run("fetch error does not trigger and does not block", func(t *testing.T) {
+ fetch := func() (*certacme.ARIInfo, error) {
+ return nil, errors.New("503 service unavailable")
+ }
+ if ne.evaluateARI(now, &domain.Certificate{}, fetch) {
+ t.Fatal("expected no ARI renewal on fetch error")
+ }
+ })
+
+ t.Run("queries every run regardless of past refresh", func(t *testing.T) {
+ calls := 0
+ fetch := func() (*certacme.ARIInfo, error) {
+ calls++
+ return &certacme.ARIInfo{WindowStart: now.Add(-time.Hour), WindowEnd: now.Add(time.Hour), Supported: true}, nil
+ }
+ _ = ne.evaluateARI(now, &domain.Certificate{}, fetch)
+ _ = ne.evaluateARI(now, &domain.Certificate{}, fetch)
+ if calls != 2 {
+ t.Fatalf("expected renewal-info fetched on every run (2 calls), got %d", calls)
+ }
+ })
+}
diff --git a/internal/workflow/pbjob.go b/internal/workflow/pbjob.go
index 6e2e14dcf..806516f36 100644
--- a/internal/workflow/pbjob.go
+++ b/internal/workflow/pbjob.go
@@ -1,4 +1,4 @@
-package workflow
+package workflow
import (
"context"
diff --git a/internal/workflow/service_inst.go b/internal/workflow/service_inst.go
index 1cb827b23..d0337fe76 100644
--- a/internal/workflow/service_inst.go
+++ b/internal/workflow/service_inst.go
@@ -1,4 +1,4 @@
-package workflow
+package workflow
import (
"sync"
diff --git a/internal/workflow/workflow.go b/internal/workflow/workflow.go
index 8048f53dd..3a6c27a7b 100644
--- a/internal/workflow/workflow.go
+++ b/internal/workflow/workflow.go
@@ -1,4 +1,4 @@
-package workflow
+package workflow
import (
"context"
diff --git a/migrations/snaps/v0.3/workflow.go b/migrations/snaps/v0.3/workflow.go
index c741589d8..6ae5f4809 100644
--- a/migrations/snaps/v0.3/workflow.go
+++ b/migrations/snaps/v0.3/workflow.go
@@ -1,4 +1,4 @@
-package snaps
+package snaps
// This is a definition backup of WorkflowNode for v0.3.
type WorkflowNode struct {
diff --git a/pkg/core/certifier.go b/pkg/core/certifier.go
index 1a16ae522..3277d4ea5 100644
--- a/pkg/core/certifier.go
+++ b/pkg/core/certifier.go
@@ -1,4 +1,4 @@
-package core
+package core
import (
"github.com/go-acme/lego/v5/challenge"
diff --git a/pkg/core/certifier/challengers/dns01/cmcccloud/internal/lego.go b/pkg/core/certifier/challengers/dns01/cmcccloud/internal/lego.go
index fa0eaf12f..1429258c9 100644
--- a/pkg/core/certifier/challengers/dns01/cmcccloud/internal/lego.go
+++ b/pkg/core/certifier/challengers/dns01/cmcccloud/internal/lego.go
@@ -1,3 +1,6 @@
+//nolint:composites
+//nolint:govet
+
package internal
import (
diff --git a/pkg/core/certifier/challengers/dns01/linode/internal/lego.go b/pkg/core/certifier/challengers/dns01/linode/internal/lego.go
index 0295855b7..98fa23b78 100644
--- a/pkg/core/certifier/challengers/dns01/linode/internal/lego.go
+++ b/pkg/core/certifier/challengers/dns01/linode/internal/lego.go
@@ -1,4 +1,4 @@
-package internal
+package internal
import (
"context"
@@ -14,7 +14,6 @@ import (
linodesdk "github.com/certimate-go/certimate/pkg/sdk3rd/linode"
)
-// Environment variables names.
const (
envNamespace = "LINODE_"
diff --git a/pkg/core/certifier/challengers/dns01/ucloud/internal/lego.go b/pkg/core/certifier/challengers/dns01/ucloud/internal/lego.go
index 572584239..7aaa51749 100644
--- a/pkg/core/certifier/challengers/dns01/ucloud/internal/lego.go
+++ b/pkg/core/certifier/challengers/dns01/ucloud/internal/lego.go
@@ -1,4 +1,4 @@
-package internal
+package internal
import (
"context"
diff --git a/pkg/core/certmgr/providers/1panel/1panel_test.go b/pkg/core/certmgr/providers-tester/1panel/1panel_test.go
similarity index 78%
rename from pkg/core/certmgr/providers/1panel/1panel_test.go
rename to pkg/core/certmgr/providers-tester/1panel/1panel_test.go
index a8fb4afc2..9e2b32ddb 100644
--- a/pkg/core/certmgr/providers/1panel/1panel_test.go
+++ b/pkg/core/certmgr/providers-tester/1panel/1panel_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package onepanelssl_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/1panel"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("1PANEL_")
+ fp = tester.InitArgs("1PANEL_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./1panel_test.go -args \
+ go test -tags=tester -v ./1panel_test.go -args \
--1PANEL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--1PANEL_TESTKEYPATH="/path/to/your-test-key.pem" \
--1PANEL_SERVERURL="http://127.0.0.1:20410" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/aliyun-cas/aliyun_cas_test.go b/pkg/core/certmgr/providers-tester/aliyun-cas/aliyun_cas_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/aliyun-cas/aliyun_cas_test.go
rename to pkg/core/certmgr/providers-tester/aliyun-cas/aliyun_cas_test.go
index 61eb507f4..7d268a19c 100644
--- a/pkg/core/certmgr/providers/aliyun-cas/aliyun_cas_test.go
+++ b/pkg/core/certmgr/providers-tester/aliyun-cas/aliyun_cas_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyuncas_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/aliyun-cas"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("ALIYUNCAS_")
+ fp = tester.InitArgs("ALIYUNCAS_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_cas_test.go -args \
+ go test -tags=tester -v ./aliyun_cas_test.go -args \
--ALIYUNCAS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNCAS_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNCAS_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/aliyun-slb/aliyun_slb_test.go b/pkg/core/certmgr/providers-tester/aliyun-slb/aliyun_slb_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/aliyun-slb/aliyun_slb_test.go
rename to pkg/core/certmgr/providers-tester/aliyun-slb/aliyun_slb_test.go
index 74567f9f7..aad80d4ab 100644
--- a/pkg/core/certmgr/providers/aliyun-slb/aliyun_slb_test.go
+++ b/pkg/core/certmgr/providers-tester/aliyun-slb/aliyun_slb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunslb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/aliyun-slb"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("ALIYUNSLB_")
+ fp = tester.InitArgs("ALIYUNSLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_slb_test.go -args \
+ go test -tags=tester -v ./aliyun_slb_test.go -args \
--ALIYUNSLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNSLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNSLB_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/aws-acm/aws_acm_test.go b/pkg/core/certmgr/providers-tester/aws-acm/aws_acm_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/aws-acm/aws_acm_test.go
rename to pkg/core/certmgr/providers-tester/aws-acm/aws_acm_test.go
index ca516cef3..77b0f5125 100644
--- a/pkg/core/certmgr/providers/aws-acm/aws_acm_test.go
+++ b/pkg/core/certmgr/providers-tester/aws-acm/aws_acm_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package awsacm_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/aws-acm"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("AWSACM_")
+ fp = tester.InitArgs("AWSACM_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aws_acm_test.go -args \
+ go test -tags=tester -v ./aws_acm_test.go -args \
--AWSACM_TESTCERTPATH="/path/to/your-test-cert.pem" \
--AWSACM_TESTKEYPATH="/path/to/your-test-key.pem" \
--AWSACM_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/aws-iam/aws_iam_test.go b/pkg/core/certmgr/providers-tester/aws-iam/aws_iam_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/aws-iam/aws_iam_test.go
rename to pkg/core/certmgr/providers-tester/aws-iam/aws_iam_test.go
index 0cffd4520..82a1557fa 100644
--- a/pkg/core/certmgr/providers/aws-iam/aws_iam_test.go
+++ b/pkg/core/certmgr/providers-tester/aws-iam/aws_iam_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package awsiam_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/aws-iam"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("AWSIAM_")
+ fp = tester.InitArgs("AWSIAM_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aws_iam_test.go -args \
+ go test -tags=tester -v ./aws_iam_test.go -args \
--AWSIAM_TESTCERTPATH="/path/to/your-test-cert.pem" \
--AWSIAM_TESTKEYPATH="/path/to/your-test-key.pem" \
--AWSIAM_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers-tester/axisnow/axisnow_test.go b/pkg/core/certmgr/providers-tester/axisnow/axisnow_test.go
new file mode 100644
index 000000000..36ed51108
--- /dev/null
+++ b/pkg/core/certmgr/providers-tester/axisnow/axisnow_test.go
@@ -0,0 +1,46 @@
+//go:build tester
+
+package axisnow_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
+ impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/axisnow"
+)
+
+var (
+ fp = tester.InitArgs("AXISNOW_")
+ fTestCertPath string
+ fTestKeyPath string
+ fApiToken string
+)
+
+func init() {
+ fp.DefineString(&fTestCertPath, "TESTCERTPATH")
+ fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
+ fp.DefineString(&fApiToken, "APITOKEN")
+}
+
+/*
+Shell command to run this test:
+
+ go test -tags=tester -v ./axisnow_test.go -args \
+ --AXISNOW_TESTCERTPATH="/path/to/your-test-cert.pem" \
+ --AXISNOW_TESTKEYPATH="/path/to/your-test-key.pem" \
+ --AXISNOW_APITOKEN="your-api-token"
+*/
+func TestProvider(t *testing.T) {
+ fp.Parse()
+
+ t.Run("Upload", func(t *testing.T) {
+ provider, err := impl.NewCertmgr(&impl.CertmgrConfig{
+ ApiToken: fApiToken,
+ })
+ require.NoError(t, err)
+
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ })
+}
diff --git a/pkg/core/certmgr/providers/azure-keyvault/azure_keyvault_test.go b/pkg/core/certmgr/providers-tester/azure-keyvault/azure_keyvault_test.go
similarity index 82%
rename from pkg/core/certmgr/providers/azure-keyvault/azure_keyvault_test.go
rename to pkg/core/certmgr/providers-tester/azure-keyvault/azure_keyvault_test.go
index eac69b0a2..1a94b414b 100644
--- a/pkg/core/certmgr/providers/azure-keyvault/azure_keyvault_test.go
+++ b/pkg/core/certmgr/providers-tester/azure-keyvault/azure_keyvault_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package azurekeyvault_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/azure-keyvault"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("AZUREKEYVAULT_")
+ fp = tester.InitArgs("AZUREKEYVAULT_")
fTestCertPath string
fTestKeyPath string
fTenantId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./azure_keyvault_test.go -args \
+ go test -tags=tester -v ./azure_keyvault_test.go -args \
--AZUREKEYVAULT_TESTCERTPATH="/path/to/your-test-cert.pem" \
--AZUREKEYVAULT_TESTKEYPATH="/path/to/your-test-key.pem" \
--AZUREKEYVAULT_TENANTID="your-tenant-id" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/baiducloud-cert/baiducloud_cert_test.go b/pkg/core/certmgr/providers-tester/baiducloud-cert/baiducloud_cert_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/baiducloud-cert/baiducloud_cert_test.go
rename to pkg/core/certmgr/providers-tester/baiducloud-cert/baiducloud_cert_test.go
index 6f014c2f9..9ae067b0c 100644
--- a/pkg/core/certmgr/providers/baiducloud-cert/baiducloud_cert_test.go
+++ b/pkg/core/certmgr/providers-tester/baiducloud-cert/baiducloud_cert_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baiducloudcert_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/baiducloud-cert"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("BAIDUCLOUDCERT_")
+ fp = tester.InitArgs("BAIDUCLOUDCERT_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baiducloud_cert_test.go -args \
+ go test -tags=tester -v ./baiducloud_cert_test.go -args \
--BAIDUCLOUDCERT_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAIDUCLOUDCERT_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAIDUCLOUDCERT_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/baishan-cdn/baishan_cdn_test.go b/pkg/core/certmgr/providers-tester/baishan-cdn/baishan_cdn_test.go
similarity index 72%
rename from pkg/core/certmgr/providers/baishan-cdn/baishan_cdn_test.go
rename to pkg/core/certmgr/providers-tester/baishan-cdn/baishan_cdn_test.go
index b39395524..ffd129c59 100644
--- a/pkg/core/certmgr/providers/baishan-cdn/baishan_cdn_test.go
+++ b/pkg/core/certmgr/providers-tester/baishan-cdn/baishan_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baishancdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/baishan-cdn"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("BAISHANCDN_")
+ fp = tester.InitArgs("BAISHANCDN_")
fTestCertPath string
fTestKeyPath string
fApiToken string
@@ -25,7 +27,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baishan_cdn_test.go -args \
+ go test -tags=tester -v ./baishan_cdn_test.go -args \
--BAISHANCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAISHANCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAISHANCDN_APITOKEN="your-api-token"
@@ -39,6 +41,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/byteplus-cdn/byteplus_cdn_test.go b/pkg/core/certmgr/providers-tester/byteplus-cdn/byteplus_cdn_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/byteplus-cdn/byteplus_cdn_test.go
rename to pkg/core/certmgr/providers-tester/byteplus-cdn/byteplus_cdn_test.go
index fa44ae37a..76a60e180 100644
--- a/pkg/core/certmgr/providers/byteplus-cdn/byteplus_cdn_test.go
+++ b/pkg/core/certmgr/providers-tester/byteplus-cdn/byteplus_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package bytepluscdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/byteplus-cdn"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("BYTEPLUSCDN_")
+ fp = tester.InitArgs("BYTEPLUSCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./byteplus_cdn_test.go -args \
+ go test -tags=tester -v ./byteplus_cdn_test.go -args \
--BYTEPLUSCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BYTEPLUSCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--BYTEPLUSCDN_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/byteplus-certcenter/byteplus_certcenter_test.go b/pkg/core/certmgr/providers-tester/byteplus-certcenter/byteplus_certcenter_test.go
similarity index 76%
rename from pkg/core/certmgr/providers/byteplus-certcenter/byteplus_certcenter_test.go
rename to pkg/core/certmgr/providers-tester/byteplus-certcenter/byteplus_certcenter_test.go
index 1a4cb30cd..7b8e7cfe0 100644
--- a/pkg/core/certmgr/providers/byteplus-certcenter/byteplus_certcenter_test.go
+++ b/pkg/core/certmgr/providers-tester/byteplus-certcenter/byteplus_certcenter_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package bytepluscertcenter_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/byteplus-certcenter"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("BYTEPLUSCERTCENTER_")
+ fp = tester.InitArgs("BYTEPLUSCERTCENTER_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./byteplus_certcenter_test.go -args \
+ go test -tags=tester -v ./byteplus_certcenter_test.go -args \
--BYTEPLUSCERTCENTER_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BYTEPLUSCERTCENTER_TESTKEYPATH="/path/to/your-test-key.pem" \
--BYTEPLUSCERTCENTER_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/byteplus-medialive/byteplus_medialive_test.go b/pkg/core/certmgr/providers-tester/byteplus-medialive/byteplus_medialive_test.go
similarity index 76%
rename from pkg/core/certmgr/providers/byteplus-medialive/byteplus_medialive_test.go
rename to pkg/core/certmgr/providers-tester/byteplus-medialive/byteplus_medialive_test.go
index 1a24127b8..fb4acca41 100644
--- a/pkg/core/certmgr/providers/byteplus-medialive/byteplus_medialive_test.go
+++ b/pkg/core/certmgr/providers-tester/byteplus-medialive/byteplus_medialive_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package byteplusmedialive_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/byteplus-medialive"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("BYTEPLUSMEDIALIVE_")
+ fp = tester.InitArgs("BYTEPLUSMEDIALIVE_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./byteplus_medialive_test.go -args \
+ go test -tags=tester -v ./byteplus_medialive_test.go -args \
--BYTEPLUSMEDIALIVE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BYTEPLUSMEDIALIVE_TESTKEYPATH="/path/to/your-test-key.pem" \
--BYTEPLUSMEDIALIVE_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/cmcccloud-vlb/cmcccloud_vlb_test.go b/pkg/core/certmgr/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/cmcccloud-vlb/cmcccloud_vlb_test.go
rename to pkg/core/certmgr/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go
index 45e52b47f..d3b40604e 100644
--- a/pkg/core/certmgr/providers/cmcccloud-vlb/cmcccloud_vlb_test.go
+++ b/pkg/core/certmgr/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package cmcccloudvlb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/cmcccloud-vlb"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("CMCCCLOUDVLB_")
+ fp = tester.InitArgs("CMCCCLOUDVLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./cmcccloud_vlb_test.go -args \
+ go test -tags=tester -v ./cmcccloud_vlb_test.go -args \
--CMCCCLOUDVLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CMCCCLOUDVLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--CMCCCLOUDVLB_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/ctcccloud-ao/ctcccloud_ao_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/ctcccloud-ao/ctcccloud_ao_test.go
rename to pkg/core/certmgr/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go
index 2be59f21f..93220f278 100644
--- a/pkg/core/certmgr/providers/ctcccloud-ao/ctcccloud_ao_test.go
+++ b/pkg/core/certmgr/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudao_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-ao"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("CTCCCLOUDAO_")
+ fp = tester.InitArgs("CTCCCLOUDAO_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_ao_test.go -args \
+ go test -tags=tester -v ./ctcccloud_ao_test.go -args \
--CTCCCLOUDAO_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDAO_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDAO_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/ctcccloud-cdn/ctcccloud_cdn_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/ctcccloud-cdn/ctcccloud_cdn_test.go
rename to pkg/core/certmgr/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go
index d821b0cff..cbdb451d7 100644
--- a/pkg/core/certmgr/providers/ctcccloud-cdn/ctcccloud_cdn_test.go
+++ b/pkg/core/certmgr/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudcdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-cdn"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("CTCCCLOUDCDN_")
+ fp = tester.InitArgs("CTCCCLOUDCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_cdn_test.go -args \
+ go test -tags=tester -v ./ctcccloud_cdn_test.go -args \
--CTCCCLOUDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDCDN_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/ctcccloud-cms/ctcccloud_cms_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/ctcccloud-cms/ctcccloud_cms_test.go
rename to pkg/core/certmgr/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go
index 83bad09db..d6b420265 100644
--- a/pkg/core/certmgr/providers/ctcccloud-cms/ctcccloud_cms_test.go
+++ b/pkg/core/certmgr/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudcms_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-cms"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("CTCCCLOUDCMS_")
+ fp = tester.InitArgs("CTCCCLOUDCMS_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_cms_test.go -args \
+ go test -tags=tester -v ./ctcccloud_cms_test.go -args \
--CTCCCLOUDCMS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDCMS_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDCMS_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/ctcccloud-elb/ctcccloud_elb_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/ctcccloud-elb/ctcccloud_elb_test.go
rename to pkg/core/certmgr/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go
index 4dcc1cd2e..87b98e93f 100644
--- a/pkg/core/certmgr/providers/ctcccloud-elb/ctcccloud_elb_test.go
+++ b/pkg/core/certmgr/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudelb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-elb"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("CTCCCLOUDELB_")
+ fp = tester.InitArgs("CTCCCLOUDELB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_elb_test.go -args \
+ go test -tags=tester -v ./ctcccloud_elb_test.go -args \
--CTCCCLOUDELB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDELB_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDELB_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/ctcccloud-icdn/ctcccloud_icdn_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/ctcccloud-icdn/ctcccloud_icdn_test.go
rename to pkg/core/certmgr/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go
index e85d0e232..7e2d64898 100644
--- a/pkg/core/certmgr/providers/ctcccloud-icdn/ctcccloud_icdn_test.go
+++ b/pkg/core/certmgr/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudicdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-icdn"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("CTCCCLOUDICDN_")
+ fp = tester.InitArgs("CTCCCLOUDICDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_icdn_test.go -args \
+ go test -tags=tester -v ./ctcccloud_icdn_test.go -args \
--CTCCCLOUDICDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDICDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDICDN_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go b/pkg/core/certmgr/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go
rename to pkg/core/certmgr/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go
index 44f5b709b..3774e37b4 100644
--- a/pkg/core/certmgr/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go
+++ b/pkg/core/certmgr/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudlvdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ctcccloud-lvdn"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("CTCCCLOUDLVDN_")
+ fp = tester.InitArgs("CTCCCLOUDLVDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_lvdn_test.go -args \
+ go test -tags=tester -v ./ctcccloud_lvdn_test.go -args \
--CTCCCLOUDLVDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDLVDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDLVDN_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/digitalocean-certificate/digitalocean_certificate_test.go b/pkg/core/certmgr/providers-tester/digitalocean-certificate/digitalocean_certificate_test.go
similarity index 73%
rename from pkg/core/certmgr/providers/digitalocean-certificate/digitalocean_certificate_test.go
rename to pkg/core/certmgr/providers-tester/digitalocean-certificate/digitalocean_certificate_test.go
index 297635d96..bb3c4d7e9 100644
--- a/pkg/core/certmgr/providers/digitalocean-certificate/digitalocean_certificate_test.go
+++ b/pkg/core/certmgr/providers-tester/digitalocean-certificate/digitalocean_certificate_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package digitaloceancertificate_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/digitalocean-certificate"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("DIGITALOCEANCERTIFICATE_")
+ fp = tester.InitArgs("DIGITALOCEANCERTIFICATE_")
fTestCertPath string
fTestKeyPath string
fAccessToken string
@@ -25,7 +27,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./digitalocean_certificate_test.go -args \
+ go test -tags=tester -v ./digitalocean_certificate_test.go -args \
--DIGITALOCEANCERTIFICATE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--DIGITALOCEANCERTIFICATE_TESTKEYPATH="/path/to/your-test-key.pem" \
--DIGITALOCEANCERTIFICATE_ACCESSTOKEN="your-access-token"
@@ -39,6 +41,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers-tester/dogecloud/dogecloud_test.go b/pkg/core/certmgr/providers-tester/dogecloud/dogecloud_test.go
new file mode 100644
index 000000000..550dcc817
--- /dev/null
+++ b/pkg/core/certmgr/providers-tester/dogecloud/dogecloud_test.go
@@ -0,0 +1,50 @@
+//go:build tester
+
+package dogecloud_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
+ impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/dogecloud"
+)
+
+var (
+ fp = tester.InitArgs("DOGECLOUD_")
+ fTestCertPath string
+ fTestKeyPath string
+ fAccessKey string
+ fSecretKey string
+)
+
+func init() {
+ fp.DefineString(&fTestCertPath, "TESTCERTPATH")
+ fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
+ fp.DefineString(&fAccessKey, "ACCESSKEY")
+ fp.DefineString(&fSecretKey, "SECRETKEY")
+}
+
+/*
+Shell command to run this test:
+
+ go test -tags=tester -v ./dogecloud_test.go -args \
+ --DOGECLOUD_TESTCERTPATH="/path/to/your-test-cert.pem" \
+ --DOGECLOUD_TESTKEYPATH="/path/to/your-test-key.pem" \
+ --DOGECLOUD_ACCESSKEY="your-access-key" \
+ --DOGECLOUD_SECRETKEY="your-secret-key"
+*/
+func TestProvider(t *testing.T) {
+ fp.Parse()
+
+ t.Run("Upload", func(t *testing.T) {
+ provider, err := impl.NewCertmgr(&impl.CertmgrConfig{
+ AccessKey: fAccessKey,
+ SecretKey: fSecretKey,
+ })
+ require.NoError(t, err)
+
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ })
+}
diff --git a/pkg/core/certmgr/providers/dokploy/dokploy_test.go b/pkg/core/certmgr/providers-tester/dokploy/dokploy_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/dokploy/dokploy_test.go
rename to pkg/core/certmgr/providers-tester/dokploy/dokploy_test.go
index 307e904b6..df84a8765 100644
--- a/pkg/core/certmgr/providers/dokploy/dokploy_test.go
+++ b/pkg/core/certmgr/providers-tester/dokploy/dokploy_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package dokploy_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/dokploy"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("DOKPLOY_")
+ fp = tester.InitArgs("DOKPLOY_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./dokploy_test.go -args \
+ go test -tags=tester -v ./dokploy_test.go -args \
--DOKPLOY_TESTCERTPATH="/path/to/your-test-cert.pem" \
--DOKPLOY_TESTKEYPATH="/path/to/your-test-key.pem" \
--DOKPLOY_SERVERURL="http://127.0.0.1:3000" \
@@ -44,6 +46,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/gcore-cdn/gcore_cdn_test.go b/pkg/core/certmgr/providers-tester/gcore-cdn/gcore_cdn_test.go
similarity index 72%
rename from pkg/core/certmgr/providers/gcore-cdn/gcore_cdn_test.go
rename to pkg/core/certmgr/providers-tester/gcore-cdn/gcore_cdn_test.go
index 2474fc742..750904ccb 100644
--- a/pkg/core/certmgr/providers/gcore-cdn/gcore_cdn_test.go
+++ b/pkg/core/certmgr/providers-tester/gcore-cdn/gcore_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package gcorecdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/gcore-cdn"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("GCORECDN_")
+ fp = tester.InitArgs("GCORECDN_")
fTestCertPath string
fTestKeyPath string
fApiToken string
@@ -25,7 +27,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./gcore_cdn_test.go -args \
+ go test -tags=tester -v ./gcore_cdn_test.go -args \
--GCORECDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--GCORECDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--GCORECDN_APITOKEN="your-api-token"
@@ -39,6 +41,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go b/pkg/core/certmgr/providers-tester/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go
rename to pkg/core/certmgr/providers-tester/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go
index 63d80f092..41da54d36 100644
--- a/pkg/core/certmgr/providers/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go
+++ b/pkg/core/certmgr/providers-tester/googlecloud-certificatemanager/googlecloud_certificatemanager_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package googlecloudcertificatemanager_test
import (
@@ -6,12 +8,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/googlecloud-certificatemanager"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("GOOGLECLOUDCERTIFICATEMANAGER_")
+ fp = tester.InitArgs("GOOGLECLOUDCERTIFICATEMANAGER_")
fTestCertPath string
fTestKeyPath string
fProjectId string
@@ -28,7 +30,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./googlecloud_certificatemanager_test.go -args \
+ go test -tags=tester -v ./googlecloud_certificatemanager_test.go -args \
--GOOGLECLOUDCERTIFICATEMANAGER_TESTCERTPATH="/path/to/your-test-cert.pem" \
--GOOGLECLOUDCERTIFICATEMANAGER_TESTKEYPATH="/path/to/your-test-key.pem" \
--GOOGLECLOUDCERTIFICATEMANAGER_PROJECTID="your-project-id" \
@@ -49,6 +51,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/huaweicloud-elb/huaweicloud_elb_test.go b/pkg/core/certmgr/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/huaweicloud-elb/huaweicloud_elb_test.go
rename to pkg/core/certmgr/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go
index ce063c7c3..9cbb4f642 100644
--- a/pkg/core/certmgr/providers/huaweicloud-elb/huaweicloud_elb_test.go
+++ b/pkg/core/certmgr/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package huaweicloudelb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/huaweicloud-elb"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("HUAWEICLOUDELB_")
+ fp = tester.InitArgs("HUAWEICLOUDELB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./huaweicloud_elb_test.go -args \
+ go test -tags=tester -v ./huaweicloud_elb_test.go -args \
--HUAWEICLOUDELB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--HUAWEICLOUDELB_TESTKEYPATH="/path/to/your-test-key.pem" \
--HUAWEICLOUDELB_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/huaweicloud-scm/huaweicloud_scm_test.go b/pkg/core/certmgr/providers-tester/huaweicloud-scm/huaweicloud_scm_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/huaweicloud-scm/huaweicloud_scm_test.go
rename to pkg/core/certmgr/providers-tester/huaweicloud-scm/huaweicloud_scm_test.go
index b0fdedb37..b42eaead9 100644
--- a/pkg/core/certmgr/providers/huaweicloud-scm/huaweicloud_scm_test.go
+++ b/pkg/core/certmgr/providers-tester/huaweicloud-scm/huaweicloud_scm_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package huaweicloudscm_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/huaweicloud-scm"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("HUAWEICLOUDSCM_")
+ fp = tester.InitArgs("HUAWEICLOUDSCM_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./huaweicloud_scm_test.go -args \
+ go test -tags=tester -v ./huaweicloud_scm_test.go -args \
--HUAWEICLOUDSCM_TESTCERTPATH="/path/to/your-test-cert.pem" \
--HUAWEICLOUDSCM_TESTKEYPATH="/path/to/your-test-key.pem" \
--HUAWEICLOUDSCM_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/huaweicloud-waf/huaweicloud_waf_test.go b/pkg/core/certmgr/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/huaweicloud-waf/huaweicloud_waf_test.go
rename to pkg/core/certmgr/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go
index 4f3f45d04..028aa261d 100644
--- a/pkg/core/certmgr/providers/huaweicloud-waf/huaweicloud_waf_test.go
+++ b/pkg/core/certmgr/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package huaweicloudwaf_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/huaweicloud-waf"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("HUAWEICLOUDWAF_")
+ fp = tester.InitArgs("HUAWEICLOUDWAF_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./huaweicloud_waf_test.go -args \
+ go test -tags=tester -v ./huaweicloud_waf_test.go -args \
--HUAWEICLOUDWAF_TESTCERTPATH="/path/to/your-test-cert.pem" \
--HUAWEICLOUDWAF_TESTKEYPATH="/path/to/your-test-key.pem" \
--HUAWEICLOUDWAF_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/jdcloud-ssl/jdcloud_ssl_test.go b/pkg/core/certmgr/providers-tester/jdcloud-ssl/jdcloud_ssl_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/jdcloud-ssl/jdcloud_ssl_test.go
rename to pkg/core/certmgr/providers-tester/jdcloud-ssl/jdcloud_ssl_test.go
index 0f987b9be..d4705f175 100644
--- a/pkg/core/certmgr/providers/jdcloud-ssl/jdcloud_ssl_test.go
+++ b/pkg/core/certmgr/providers-tester/jdcloud-ssl/jdcloud_ssl_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package jdcloudssl_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/jdcloud-ssl"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("JDCLOUDSSL_")
+ fp = tester.InitArgs("JDCLOUDSSL_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./jdcloud_ssl_test.go -args \
+ go test -tags=tester -v ./jdcloud_ssl_test.go -args \
--JDCLOUDSSL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--JDCLOUDSSL_TESTKEYPATH="/path/to/your-test-key.pem" \
--JDCLOUDSSL_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/ksyun-kcm/ksyun_kcm_test.go b/pkg/core/certmgr/providers-tester/ksyun-kcm/ksyun_kcm_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/ksyun-kcm/ksyun_kcm_test.go
rename to pkg/core/certmgr/providers-tester/ksyun-kcm/ksyun_kcm_test.go
index 2ce2e7f67..b6b937b1b 100644
--- a/pkg/core/certmgr/providers/ksyun-kcm/ksyun_kcm_test.go
+++ b/pkg/core/certmgr/providers-tester/ksyun-kcm/ksyun_kcm_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ksyunkcm_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ksyun-kcm"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("KSYUNKCM_")
+ fp = tester.InitArgs("KSYUNKCM_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ksyun_kcm_test.go -args \
+ go test -tags=tester -v ./ksyun_kcm_test.go -args \
--KSYUNKCM_TESTCERTPATH="/path/to/your-test-cert.pem" \
--KSYUNKCM_TESTKEYPATH="/path/to/your-test-key.pem" \
--KSYUNKCM_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/ksyun-slb/ksyun_slb_test.go b/pkg/core/certmgr/providers-tester/ksyun-slb/ksyun_slb_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/ksyun-slb/ksyun_slb_test.go
rename to pkg/core/certmgr/providers-tester/ksyun-slb/ksyun_slb_test.go
index e140788a8..56de89645 100644
--- a/pkg/core/certmgr/providers/ksyun-slb/ksyun_slb_test.go
+++ b/pkg/core/certmgr/providers-tester/ksyun-slb/ksyun_slb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ksyunslb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ksyun-slb"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("KSYUNSLB_")
+ fp = tester.InitArgs("KSYUNSLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ksyun_slb_test.go -args \
+ go test -tags=tester -v ./ksyun_slb_test.go -args \
--KSYUNSLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--KSYUNSLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--KSYUNSLB_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/nginxproxymanager/nginxproxymanager_test.go b/pkg/core/certmgr/providers-tester/nginxproxymanager/nginxproxymanager_test.go
similarity index 80%
rename from pkg/core/certmgr/providers/nginxproxymanager/nginxproxymanager_test.go
rename to pkg/core/certmgr/providers-tester/nginxproxymanager/nginxproxymanager_test.go
index b06dc8950..04d435bad 100644
--- a/pkg/core/certmgr/providers/nginxproxymanager/nginxproxymanager_test.go
+++ b/pkg/core/certmgr/providers-tester/nginxproxymanager/nginxproxymanager_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package nginxproxymanager_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/nginxproxymanager"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("NGINXPROXYMANAGER_")
+ fp = tester.InitArgs("NGINXPROXYMANAGER_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./nginxproxymanager_test.go -args \
+ go test -tags=tester -v ./nginxproxymanager_test.go -args \
--NGINXPROXYMANAGER_TESTCERTPATH="/path/to/your-test-cert.pem" \
--NGINXPROXYMANAGER_TESTKEYPATH="/path/to/your-test-key.pem" \
--NGINXPROXYMANAGER_SERVERURL="http://127.0.0.1:81" \
@@ -49,6 +51,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go b/pkg/core/certmgr/providers-tester/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go
similarity index 85%
rename from pkg/core/certmgr/providers/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go
rename to pkg/core/certmgr/providers-tester/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go
index 59d979bd3..eecc8d270 100644
--- a/pkg/core/certmgr/providers/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go
+++ b/pkg/core/certmgr/providers-tester/oraclecloud-certificatesmgmt/oraclecloud_certificatesmgmt_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package oraclecloudcertificatesmgmt_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/oraclecloud-certificatesmgmt"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("ORACLECLOUDCERTIFICATESMGMT_")
+ fp = tester.InitArgs("ORACLECLOUDCERTIFICATESMGMT_")
fTestCertPath string
fTestKeyPath string
fPrivateKey string
@@ -35,7 +37,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./oraclecloud_certificatesmgmt_test.go -args \
+ go test -tags=tester -v ./oraclecloud_certificatesmgmt_test.go -args \
--ORACLECLOUDCERTIFICATESMGMT_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ORACLECLOUDCERTIFICATESMGMT_TESTKEYPATH="/path/to/your-test-key.pem" \
--ORACLECLOUDCERTIFICATESMGMT_PRIVATEKEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----" \
@@ -60,6 +62,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/qingcloud-lb/qingcloud_lb_test.go b/pkg/core/certmgr/providers-tester/qingcloud-lb/qingcloud_lb_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/qingcloud-lb/qingcloud_lb_test.go
rename to pkg/core/certmgr/providers-tester/qingcloud-lb/qingcloud_lb_test.go
index f8f9a6ac4..6008c5a7a 100644
--- a/pkg/core/certmgr/providers/qingcloud-lb/qingcloud_lb_test.go
+++ b/pkg/core/certmgr/providers-tester/qingcloud-lb/qingcloud_lb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package qingcloudlb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/qingcloud-lb"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("QINGCLOUDLB_")
+ fp = tester.InitArgs("QINGCLOUDLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./qingcloud_lb_test.go -args \
+ go test -tags=tester -v ./qingcloud_lb_test.go -args \
--QINGCLOUDLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--QINGCLOUDLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--QINGCLOUDLB_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers-tester/qiniu-sslcert/qiniu_sslcert_test.go b/pkg/core/certmgr/providers-tester/qiniu-sslcert/qiniu_sslcert_test.go
new file mode 100644
index 000000000..f6355ba71
--- /dev/null
+++ b/pkg/core/certmgr/providers-tester/qiniu-sslcert/qiniu_sslcert_test.go
@@ -0,0 +1,50 @@
+//go:build tester
+
+package qiniusslcert_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
+ impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/qiniu-sslcert"
+)
+
+var (
+ fp = tester.InitArgs("QINIUSSLCERT_")
+ fTestCertPath string
+ fTestKeyPath string
+ fAccessKey string
+ fSecretKey string
+)
+
+func init() {
+ fp.DefineString(&fTestCertPath, "TESTCERTPATH")
+ fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
+ fp.DefineString(&fAccessKey, "ACCESSKEY")
+ fp.DefineString(&fSecretKey, "SECRETKEY")
+}
+
+/*
+Shell command to run this test:
+
+ go test -tags=tester -v ./qiniu_sslcert_test.go -args \
+ --QINIUSSLCERT_TESTCERTPATH="/path/to/your-test-cert.pem" \
+ --QINIUSSLCERT_TESTKEYPATH="/path/to/your-test-key.pem" \
+ --QINIUSSLCERT_ACCESSKEY="your-access-key" \
+ --QINIUSSLCERT_SECRETKEY="your-secret-key"
+*/
+func TestProvider(t *testing.T) {
+ fp.Parse()
+
+ t.Run("Upload", func(t *testing.T) {
+ provider, err := impl.NewCertmgr(&impl.CertmgrConfig{
+ AccessKey: fAccessKey,
+ SecretKey: fSecretKey,
+ })
+ require.NoError(t, err)
+
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ })
+}
diff --git a/pkg/core/certmgr/providers/rainyun-sslcenter/rainyun_sslcenter_test.go b/pkg/core/certmgr/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go
similarity index 72%
rename from pkg/core/certmgr/providers/rainyun-sslcenter/rainyun_sslcenter_test.go
rename to pkg/core/certmgr/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go
index 164bb3844..ef3073f35 100644
--- a/pkg/core/certmgr/providers/rainyun-sslcenter/rainyun_sslcenter_test.go
+++ b/pkg/core/certmgr/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package rainyunsslcenter_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/rainyun-sslcenter"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("RAINYUNSSLCENTER_")
+ fp = tester.InitArgs("RAINYUNSSLCENTER_")
fTestCertPath string
fTestKeyPath string
fApiKey string
@@ -25,7 +27,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./rainyun_sslcenter_test.go -args \
+ go test -tags=tester -v ./rainyun_sslcenter_test.go -args \
--RAINYUNSSLCENTER_TESTCERTPATH="/path/to/your-test-cert.pem" \
--RAINYUNSSLCENTER_TESTKEYPATH="/path/to/your-test-key.pem" \
--RAINYUNSSLCENTER_APIKEY="your-api-key"
@@ -39,6 +41,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/tencentcloud-gaap/tencentcloud_gaap_test.go b/pkg/core/certmgr/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go
similarity index 75%
rename from pkg/core/certmgr/providers/tencentcloud-gaap/tencentcloud_gaap_test.go
rename to pkg/core/certmgr/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go
index 256aa70de..da09babef 100644
--- a/pkg/core/certmgr/providers/tencentcloud-gaap/tencentcloud_gaap_test.go
+++ b/pkg/core/certmgr/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudgaap_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/tencentcloud-gaap"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("TENCENTCLOUDGAAP_")
+ fp = tester.InitArgs("TENCENTCLOUDGAAP_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_gaap_test.go -args \
+ go test -tags=tester -v ./tencentcloud_gaap_test.go -args \
--TENCENTCLOUDGAAP_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDGAAP_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDGAAP_SECRETID="your-secret-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/tencentcloud-ssl/tencentcloud_ssl_test.go b/pkg/core/certmgr/providers-tester/tencentcloud-ssl/tencentcloud_ssl_test.go
similarity index 75%
rename from pkg/core/certmgr/providers/tencentcloud-ssl/tencentcloud_ssl_test.go
rename to pkg/core/certmgr/providers-tester/tencentcloud-ssl/tencentcloud_ssl_test.go
index 665230f1a..cf32955ca 100644
--- a/pkg/core/certmgr/providers/tencentcloud-ssl/tencentcloud_ssl_test.go
+++ b/pkg/core/certmgr/providers-tester/tencentcloud-ssl/tencentcloud_ssl_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudssl_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/tencentcloud-ssl"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("TENCENTCLOUDSSL_")
+ fp = tester.InitArgs("TENCENTCLOUDSSL_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_ssl_test.go -args \
+ go test -tags=tester -v ./tencentcloud_ssl_test.go -args \
--TENCENTCLOUDSSL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDSSL_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDSSL_SECRETID="your-secret-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/tencentcloud-tse/tencentcloud_tse_test.go b/pkg/core/certmgr/providers-tester/tencentcloud-tse/tencentcloud_tse_test.go
similarity index 81%
rename from pkg/core/certmgr/providers/tencentcloud-tse/tencentcloud_tse_test.go
rename to pkg/core/certmgr/providers-tester/tencentcloud-tse/tencentcloud_tse_test.go
index 32a91271b..8af8bb2f2 100644
--- a/pkg/core/certmgr/providers/tencentcloud-tse/tencentcloud_tse_test.go
+++ b/pkg/core/certmgr/providers-tester/tencentcloud-tse/tencentcloud_tse_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudtse_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/tencentcloud-tse"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("TENCENTCLOUDTSE_")
+ fp = tester.InitArgs("TENCENTCLOUDTSE_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_tse_test.go -args \
+ go test -tags=tester -v ./tencentcloud_tse_test.go -args \
--TENCENTCLOUDTSE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDTSE_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDTSE_SECRETID="your-secret-id" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/testing/testing.go b/pkg/core/certmgr/providers-tester/tester.go
similarity index 57%
rename from pkg/core/certmgr/testing/testing.go
rename to pkg/core/certmgr/providers-tester/tester.go
index cf26b9add..04488ec0d 100644
--- a/pkg/core/certmgr/testing/testing.go
+++ b/pkg/core/certmgr/providers-tester/tester.go
@@ -1,4 +1,6 @@
-package testing
+//go:build tester
+
+package tester
import (
"context"
@@ -13,33 +15,33 @@ import (
"github.com/certimate-go/certimate/pkg/core/certmgr"
)
-type TestUploadArgs struct {
+type UploadInput struct {
CertPath string
KeyPath string
}
-func TestUpload(t *testing.T, testProvider certmgr.Provider, testArgs TestUploadArgs) {
- if _, err := os.Stat(testArgs.CertPath); os.IsNotExist(err) {
+func Upload(t *testing.T, provider certmgr.Provider, input UploadInput) {
+ if _, err := os.Stat(input.CertPath); os.IsNotExist(err) {
t.Errorf("err: test cert file not exist")
return
}
- if _, err := os.Stat(testArgs.KeyPath); os.IsNotExist(err) {
+ if _, err := os.Stat(input.KeyPath); os.IsNotExist(err) {
t.Errorf("err: test privkey file not exist")
return
}
ctx := context.Background()
- certData, _ := os.ReadFile(testArgs.CertPath)
- privkeyData, _ := os.ReadFile(testArgs.KeyPath)
+ certData, _ := os.ReadFile(input.CertPath)
+ privkeyData, _ := os.ReadFile(input.KeyPath)
assert.NotNil(t, certData)
assert.NotNil(t, privkeyData)
logger := slog.Default()
logger.Enabled(ctx, slog.LevelDebug)
- testProvider.SetLogger(logger)
+ provider.SetLogger(logger)
- res, err := testProvider.Upload(ctx, string(certData), string(privkeyData))
+ res, err := provider.Upload(ctx, string(certData), string(privkeyData))
require.NoError(t, err)
require.NotNil(t, res)
diff --git a/pkg/core/certmgr/providers-tester/tester_args.go b/pkg/core/certmgr/providers-tester/tester_args.go
new file mode 100644
index 000000000..110391f3d
--- /dev/null
+++ b/pkg/core/certmgr/providers-tester/tester_args.go
@@ -0,0 +1,11 @@
+//go:build tester
+
+package tester
+
+import (
+ "github.com/certimate-go/certimate/pkg/core/internal/testing"
+)
+
+func InitArgs(prefix string) testing.ArgsParser {
+ return testing.InitArgs(prefix)
+}
diff --git a/pkg/core/certmgr/providers/ucloud-ulb/ucloud_ulb_test.go b/pkg/core/certmgr/providers-tester/ucloud-ulb/ucloud_ulb_test.go
similarity index 78%
rename from pkg/core/certmgr/providers/ucloud-ulb/ucloud_ulb_test.go
rename to pkg/core/certmgr/providers-tester/ucloud-ulb/ucloud_ulb_test.go
index e936db871..c4c4da7a5 100644
--- a/pkg/core/certmgr/providers/ucloud-ulb/ucloud_ulb_test.go
+++ b/pkg/core/certmgr/providers-tester/ucloud-ulb/ucloud_ulb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ucloudulb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ucloud-ulb"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("UCLOUDULB_")
+ fp = tester.InitArgs("UCLOUDULB_")
fTestCertPath string
fTestKeyPath string
fPrivateKey string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ucloud_ulb_test.go -args \
+ go test -tags=tester -v ./ucloud_ulb_test.go -args \
--UCLOUDULB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UCLOUDULB_TESTKEYPATH="/path/to/your-test-key.pem" \
--UCLOUDULB_PRIVATEKEY="your-private-key" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/ucloud-upathx/ucloud_upathx_test.go b/pkg/core/certmgr/providers-tester/ucloud-upathx/ucloud_upathx_test.go
similarity index 76%
rename from pkg/core/certmgr/providers/ucloud-upathx/ucloud_upathx_test.go
rename to pkg/core/certmgr/providers-tester/ucloud-upathx/ucloud_upathx_test.go
index 54acc18d6..75526d5d1 100644
--- a/pkg/core/certmgr/providers/ucloud-upathx/ucloud_upathx_test.go
+++ b/pkg/core/certmgr/providers-tester/ucloud-upathx/ucloud_upathx_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ucloudulb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ucloud-upathx"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("UCLOUDUPATHX_")
+ fp = tester.InitArgs("UCLOUDUPATHX_")
fTestCertPath string
fTestKeyPath string
fPrivateKey string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ucloud_upathx_test.go -args \
+ go test -tags=tester -v ./ucloud_upathx_test.go -args \
--UCLOUDUPATHX_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UCLOUDUPATHX_TESTKEYPATH="/path/to/your-test-key.pem" \
--UCLOUDUPATHX_PRIVATEKEY="your-private-key" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/ucloud-ussl/ucloud_ussl_test.go b/pkg/core/certmgr/providers-tester/ucloud-ussl/ucloud_ussl_test.go
similarity index 76%
rename from pkg/core/certmgr/providers/ucloud-ussl/ucloud_ussl_test.go
rename to pkg/core/certmgr/providers-tester/ucloud-ussl/ucloud_ussl_test.go
index e98b66b1d..7baeb6b8c 100644
--- a/pkg/core/certmgr/providers/ucloud-ussl/ucloud_ussl_test.go
+++ b/pkg/core/certmgr/providers-tester/ucloud-ussl/ucloud_ussl_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ucloudussl_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/ucloud-ussl"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("UCLOUDUSSL_")
+ fp = tester.InitArgs("UCLOUDUSSL_")
fTestCertPath string
fTestKeyPath string
fPrivateKey string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ucloud_ussl_test.go -args \
+ go test -tags=tester -v ./ucloud_ussl_test.go -args \
--UCLOUDUSSL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UCLOUDUSSL_TESTKEYPATH="/path/to/your-test-key.pem" \
--UCLOUDUSSL_PRIVATEKEY="your-private-key" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/upyun-ssl/upyun_ssl_test.go b/pkg/core/certmgr/providers-tester/upyun-ssl/upyun_ssl_test.go
similarity index 75%
rename from pkg/core/certmgr/providers/upyun-ssl/upyun_ssl_test.go
rename to pkg/core/certmgr/providers-tester/upyun-ssl/upyun_ssl_test.go
index 0e74a066d..f865563e5 100644
--- a/pkg/core/certmgr/providers/upyun-ssl/upyun_ssl_test.go
+++ b/pkg/core/certmgr/providers-tester/upyun-ssl/upyun_ssl_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package upyunssl_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/upyun-ssl"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("UPYUNSSL_")
+ fp = tester.InitArgs("UPYUNSSL_")
fTestCertPath string
fTestKeyPath string
fUsername string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./upyun_ssl_test.go -args \
+ go test -tags=tester -v ./upyun_ssl_test.go -args \
--UPYUNSSL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UPYUNSSL_TESTKEYPATH="/path/to/your-test-key.pem" \
--UPYUNSSL_USERNAME="your-username" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/volcengine-cdn/volcengine_cdn_test.go b/pkg/core/certmgr/providers-tester/volcengine-cdn/volcengine_cdn_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/volcengine-cdn/volcengine_cdn_test.go
rename to pkg/core/certmgr/providers-tester/volcengine-cdn/volcengine_cdn_test.go
index cf6cf8225..41c264664 100644
--- a/pkg/core/certmgr/providers/volcengine-cdn/volcengine_cdn_test.go
+++ b/pkg/core/certmgr/providers-tester/volcengine-cdn/volcengine_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcenginecdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/volcengine-cdn"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("VOLCENGINECDN_")
+ fp = tester.InitArgs("VOLCENGINECDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_cdn_test.go -args \
+ go test -tags=tester -v ./volcengine_cdn_test.go -args \
--VOLCENGINECDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINECDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINECDN_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/volcengine-certcenter/volcengine_certcenter_test.go b/pkg/core/certmgr/providers-tester/volcengine-certcenter/volcengine_certcenter_test.go
similarity index 76%
rename from pkg/core/certmgr/providers/volcengine-certcenter/volcengine_certcenter_test.go
rename to pkg/core/certmgr/providers-tester/volcengine-certcenter/volcengine_certcenter_test.go
index c661d7eab..8812265a8 100644
--- a/pkg/core/certmgr/providers/volcengine-certcenter/volcengine_certcenter_test.go
+++ b/pkg/core/certmgr/providers-tester/volcengine-certcenter/volcengine_certcenter_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcenginecertcenter_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/volcengine-certcenter"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("VOLCENGINECERTCENTER_")
+ fp = tester.InitArgs("VOLCENGINECERTCENTER_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_certcenter_test.go -args \
+ go test -tags=tester -v ./volcengine_certcenter_test.go -args \
--VOLCENGINECERTCENTER_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINECERTCENTER_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINECERTCENTER_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/volcengine-live/volcengine_live_test.go b/pkg/core/certmgr/providers-tester/volcengine-live/volcengine_live_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/volcengine-live/volcengine_live_test.go
rename to pkg/core/certmgr/providers-tester/volcengine-live/volcengine_live_test.go
index 32e9e89ad..2e9e2030f 100644
--- a/pkg/core/certmgr/providers/volcengine-live/volcengine_live_test.go
+++ b/pkg/core/certmgr/providers-tester/volcengine-live/volcengine_live_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcenginelive_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/volcengine-live"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("VOLCENGINELIVE_")
+ fp = tester.InitArgs("VOLCENGINELIVE_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_live_test.go -args \
+ go test -tags=tester -v ./volcengine_live_test.go -args \
--VOLCENGINELIVE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINELIVE_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINELIVE_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/wangsu-certificate/wangsu_certificate_test.go b/pkg/core/certmgr/providers-tester/wangsu-certificate/wangsu_certificate_test.go
similarity index 76%
rename from pkg/core/certmgr/providers/wangsu-certificate/wangsu_certificate_test.go
rename to pkg/core/certmgr/providers-tester/wangsu-certificate/wangsu_certificate_test.go
index 053fd96f7..ff4d74c75 100644
--- a/pkg/core/certmgr/providers/wangsu-certificate/wangsu_certificate_test.go
+++ b/pkg/core/certmgr/providers-tester/wangsu-certificate/wangsu_certificate_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package wangsucertificate_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/wangsu-certificate"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("WANGSUCERTIFICATE_")
+ fp = tester.InitArgs("WANGSUCERTIFICATE_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./wangsu_certificate_test.go -args \
+ go test -tags=tester -v ./wangsu_certificate_test.go -args \
--WANGSUCERTIFICATE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--WANGSUCERTIFICATE_TESTKEYPATH="/path/to/your-test-key.pem" \
--WANGSUCERTIFICATE_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go b/pkg/core/certmgr/providers-tester/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go
similarity index 79%
rename from pkg/core/certmgr/providers/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go
rename to pkg/core/certmgr/providers-tester/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go
index 7903a41ff..70f59c46f 100644
--- a/pkg/core/certmgr/providers/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go
+++ b/pkg/core/certmgr/providers-tester/yandexcloud-certificatemanager/yandexcloud_certificatemanager_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package yandexcloudcertificatemanager_test
import (
@@ -6,12 +8,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/yandexcloud-certificatemanager"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("YANDEXCLOUDCERTIFICATEMANAGER_")
+ fp = tester.InitArgs("YANDEXCLOUDCERTIFICATEMANAGER_")
fTestCertPath string
fTestKeyPath string
fFolderId string
@@ -28,7 +30,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./yandexcloud_certificatemanager_test.go -args \
+ go test -tags=tester -v ./yandexcloud_certificatemanager_test.go -args \
--YANDEXCLOUDCERTIFICATEMANAGER_TESTCERTPATH="/path/to/your-test-cert.pem" \
--YANDEXCLOUDCERTIFICATEMANAGER_TESTKEYPATH="/path/to/your-test-key.pem" \
--YANDEXCLOUDCERTIFICATEMANAGER_FOLDERID="your-folder-id" \
@@ -49,6 +51,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/zenlayer-cdn/zenlayer_cdn_test.go b/pkg/core/certmgr/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/zenlayer-cdn/zenlayer_cdn_test.go
rename to pkg/core/certmgr/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go
index 3b0f0d1f5..c9a5fd936 100644
--- a/pkg/core/certmgr/providers/zenlayer-cdn/zenlayer_cdn_test.go
+++ b/pkg/core/certmgr/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package zenlayercdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/zenlayer-cdn"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("ZENLAYERCDN_")
+ fp = tester.InitArgs("ZENLAYERCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./zenlayer_cdn_test.go -args \
+ go test -tags=tester -v ./zenlayer_cdn_test.go -args \
--ZENLAYERCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ZENLAYERCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--ZENLAYERCDN_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/zenlayer-ga/zenlayer_ga_test.go b/pkg/core/certmgr/providers-tester/zenlayer-ga/zenlayer_ga_test.go
similarity index 77%
rename from pkg/core/certmgr/providers/zenlayer-ga/zenlayer_ga_test.go
rename to pkg/core/certmgr/providers-tester/zenlayer-ga/zenlayer_ga_test.go
index 392ada54b..7d5997059 100644
--- a/pkg/core/certmgr/providers/zenlayer-ga/zenlayer_ga_test.go
+++ b/pkg/core/certmgr/providers-tester/zenlayer-ga/zenlayer_ga_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package zenlayerga_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/certmgr/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/zenlayer-ga"
- it "github.com/certimate-go/certimate/pkg/core/certmgr/testing"
)
var (
- fp = it.Args("ZENLAYERGA_")
+ fp = tester.InitArgs("ZENLAYERGA_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./zenlayer_ga_test.go -args \
+ go test -tags=tester -v ./zenlayer_ga_test.go -args \
--ZENLAYERGA_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ZENLAYERGA_TESTKEYPATH="/path/to/your-test-key.pem" \
--ZENLAYERGA_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestUpload(t, provider, it.TestUploadArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Upload(t, provider, tester.UploadInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/certmgr/providers/axisnow/axisnow.go b/pkg/core/certmgr/providers/axisnow/axisnow.go
new file mode 100644
index 000000000..92ceaefed
--- /dev/null
+++ b/pkg/core/certmgr/providers/axisnow/axisnow.go
@@ -0,0 +1,138 @@
+package axisnow
+
+import (
+ "context"
+ "fmt"
+ "log/slog"
+ "time"
+
+ "github.com/samber/lo"
+
+ "github.com/certimate-go/certimate/pkg/core"
+ axisnowsdk "github.com/certimate-go/certimate/pkg/sdk3rd/axisnow"
+ xcert "github.com/certimate-go/certimate/pkg/utils/cert"
+)
+
+type (
+ Provider = core.Certmgr
+ UploadResult = core.CertmgrUploadResult
+ ReplaceResult = core.CertmgrReplaceResult
+)
+
+type CertmgrConfig struct {
+ // AxisNow API 令牌。
+ ApiToken string `json:"apiToken"`
+}
+
+type Certmgr struct {
+ config *CertmgrConfig
+ logger *slog.Logger
+ sdkClient *axisnowsdk.Client
+}
+
+var _ Provider = (*Certmgr)(nil)
+
+func NewCertmgr(config *CertmgrConfig) (*Certmgr, error) {
+ if config == nil {
+ return nil, fmt.Errorf("the configuration of the certmgr provider is nil")
+ }
+
+ client, err := createSDKClient(config.ApiToken)
+ if err != nil {
+ return nil, fmt.Errorf("could not create client: %w", err)
+ }
+
+ return &Certmgr{
+ config: config,
+ logger: slog.Default(),
+ sdkClient: client,
+ }, nil
+}
+
+func (c *Certmgr) SetLogger(logger *slog.Logger) {
+ if logger == nil {
+ c.logger = slog.New(slog.DiscardHandler)
+ } else {
+ c.logger = logger
+ }
+}
+
+func (c *Certmgr) Upload(ctx context.Context, certPEM, privkeyPEM string) (*UploadResult, error) {
+ // 查询证书列表,避免重复上传
+ // REF: https://developers.axisnow.io/api-reference/main/client/v1/#/operations/certificate-setting-list-certificates
+ listCertificatesPage := 1
+ listCertificatesPerPage := 100
+ for {
+ select {
+ case <-ctx.Done():
+ return nil, ctx.Err()
+ default:
+ }
+
+ listCertificatesReq := &axisnowsdk.ListCertificatesRequest{
+ Page: lo.ToPtr(listCertificatesPage),
+ PerPage: lo.ToPtr(listCertificatesPerPage),
+ }
+ listCertificatesResp, err := c.sdkClient.ListCertificatesWithContext(ctx, listCertificatesReq)
+ c.logger.Debug("sdk request 'Certificates.ListCertificates'", slog.Any("request", listCertificatesReq), slog.Any("response", listCertificatesResp))
+ if err != nil {
+ return nil, fmt.Errorf("failed to execute sdk request 'Certificates.ListCertificates': %w", err)
+ } else {
+ if listCertificatesResp.Results == nil {
+ break
+ }
+
+ for _, certItem := range listCertificatesResp.Results {
+ if xcert.EqualCertificatesFromPEM(certPEM, certItem.Certificate) {
+ // 如果已存在相同证书,直接返回
+ c.logger.Info("ssl certificate already exists")
+ return &UploadResult{
+ CertId: certItem.UUID,
+ CertName: certItem.Name,
+ }, nil
+ }
+ }
+
+ if len(listCertificatesResp.Results) < listCertificatesPerPage ||
+ (listCertificatesResp.ResultInfo != nil && listCertificatesPage*listCertificatesPerPage >= listCertificatesResp.ResultInfo.TotalCount) {
+ break
+ }
+
+ listCertificatesPage++
+ }
+ }
+
+ // 添加证书
+ // REF: https://developers.axisnow.io/api-reference/main/client/v1/#/operations/certificate-setting-add-certificate
+ addCertificateReq := &axisnowsdk.AddCertificateRequest{
+ Type: lo.ToPtr("upload"),
+ Name: lo.ToPtr(fmt.Sprintf("certimate-%d", time.Now().UnixMilli())),
+ Certificate: lo.ToPtr(certPEM),
+ PrivateKey: lo.ToPtr(privkeyPEM),
+ }
+ addCertificateResp, err := c.sdkClient.AddCertificateWithContext(ctx, addCertificateReq)
+ c.logger.Debug("sdk request 'Certificates.AddCertificate'", slog.Any("request", addCertificateReq), slog.Any("response", addCertificateResp))
+ if err != nil {
+ return nil, fmt.Errorf("failed to execute sdk request 'Certificates.AddCertificate': %w", err)
+ }
+
+ return &UploadResult{
+ CertId: addCertificateResp.Result.UUID,
+ CertName: addCertificateResp.Result.Name,
+ }, nil
+}
+
+func (c *Certmgr) Replace(ctx context.Context, certIdOrName string, certPEM, privkeyPEM string) (*ReplaceResult, error) {
+ return nil, core.ErrUnsupported
+}
+
+func createSDKClient(apiToken string) (*axisnowsdk.Client, error) {
+ client, err := axisnowsdk.NewClient(
+ axisnowsdk.WithApiToken(apiToken),
+ )
+ if err != nil {
+ return nil, err
+ }
+
+ return client, nil
+}
diff --git a/pkg/core/certmgr/providers/cmcccloud-vlb/cmcccloud_vlb.go b/pkg/core/certmgr/providers/cmcccloud-vlb/cmcccloud_vlb.go
index 430a39880..c074244dd 100644
--- a/pkg/core/certmgr/providers/cmcccloud-vlb/cmcccloud_vlb.go
+++ b/pkg/core/certmgr/providers/cmcccloud-vlb/cmcccloud_vlb.go
@@ -1,3 +1,6 @@
+//nolint:composites
+//nolint:govet
+
package cmcccloudvlb
import (
diff --git a/pkg/core/certmgr/testing/args.go b/pkg/core/certmgr/testing/args.go
deleted file mode 100644
index 077fd3fa6..000000000
--- a/pkg/core/certmgr/testing/args.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package testing
-
-import (
- "github.com/certimate-go/certimate/pkg/core/internal/testing"
-)
-
-func Args(prefix string) testing.ArgsParser {
- return testing.Args(prefix)
-}
diff --git a/pkg/core/deployer/providers/1panel-console/1panel_console_test.go b/pkg/core/deployer/providers-tester/1panel-console/1panel_console_test.go
similarity index 79%
rename from pkg/core/deployer/providers/1panel-console/1panel_console_test.go
rename to pkg/core/deployer/providers-tester/1panel-console/1panel_console_test.go
index 651ea4601..ccd217b74 100644
--- a/pkg/core/deployer/providers/1panel-console/1panel_console_test.go
+++ b/pkg/core/deployer/providers-tester/1panel-console/1panel_console_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package onepanelconsole_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/1panel-console"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("1PANELCONSOLE_")
+ fp = tester.InitArgs("1PANELCONSOLE_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./1panel_console_test.go -args \
+ go test -tags=tester -v ./1panel_console_test.go -args \
--1PANELCONSOLE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--1PANELCONSOLE_TESTKEYPATH="/path/to/your-test-key.pem" \
--1PANELCONSOLE_SERVERURL="http://127.0.0.1:20410" \
@@ -49,6 +51,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/1panel/1panel_test.go b/pkg/core/deployer/providers-tester/1panel/1panel_test.go
similarity index 83%
rename from pkg/core/deployer/providers/1panel/1panel_test.go
rename to pkg/core/deployer/providers-tester/1panel/1panel_test.go
index f91245264..b4da2b683 100644
--- a/pkg/core/deployer/providers/1panel/1panel_test.go
+++ b/pkg/core/deployer/providers-tester/1panel/1panel_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package onepanel_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/1panel"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("1PANEL_")
+ fp = tester.InitArgs("1PANEL_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./1panel_test.go -args \
+ go test -tags=tester -v ./1panel_test.go -args \
--1PANEL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--1PANEL_TESTKEYPATH="/path/to/your-test-key.pem" \
--1PANEL_SERVERURL="http://127.0.0.1:20410" \
@@ -57,7 +59,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToCertificate", func(t *testing.T) {
@@ -71,6 +73,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-alb/aliyun_alb_test.go b/pkg/core/deployer/providers-tester/aliyun-alb/aliyun_alb_test.go
similarity index 83%
rename from pkg/core/deployer/providers/aliyun-alb/aliyun_alb_test.go
rename to pkg/core/deployer/providers-tester/aliyun-alb/aliyun_alb_test.go
index 3e9eb25d1..c7579fbd4 100644
--- a/pkg/core/deployer/providers/aliyun-alb/aliyun_alb_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-alb/aliyun_alb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunalb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-alb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNALB_")
+ fp = tester.InitArgs("ALIYUNALB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -35,7 +37,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_alb_test.go -args \
+ go test -tags=tester -v ./aliyun_alb_test.go -args \
--ALIYUNALB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNALB_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNALB_ACCESSKEYID="your-access-key-id" \
@@ -59,7 +61,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToListener", func(t *testing.T) {
@@ -73,6 +75,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-apigw/aliyun_apigw_test.go b/pkg/core/deployer/providers-tester/aliyun-apigw/aliyun_apigw_test.go
similarity index 85%
rename from pkg/core/deployer/providers/aliyun-apigw/aliyun_apigw_test.go
rename to pkg/core/deployer/providers-tester/aliyun-apigw/aliyun_apigw_test.go
index 6e1901daa..41283e607 100644
--- a/pkg/core/deployer/providers/aliyun-apigw/aliyun_apigw_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-apigw/aliyun_apigw_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunapigw_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-apigw"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNAPIGW_")
+ fp = tester.InitArgs("ALIYUNAPIGW_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -37,7 +39,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_apigw_test.go -args \
+ go test -tags=tester -v ./aliyun_apigw_test.go -args \
--ALIYUNAPIGW_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNAPIGW_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNAPIGW_ACCESSKEYID="your-access-key-id" \
@@ -64,6 +66,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-cdn/aliyun_cdn_test.go b/pkg/core/deployer/providers-tester/aliyun-cdn/aliyun_cdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/aliyun-cdn/aliyun_cdn_test.go
rename to pkg/core/deployer/providers-tester/aliyun-cdn/aliyun_cdn_test.go
index eb5e96763..249a70594 100644
--- a/pkg/core/deployer/providers/aliyun-cdn/aliyun_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-cdn/aliyun_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyuncdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNCDN_")
+ fp = tester.InitArgs("ALIYUNCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_cdn_test.go -args \
+ go test -tags=tester -v ./aliyun_cdn_test.go -args \
--ALIYUNCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNCDN_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-clb/aliyun_clb_test.go b/pkg/core/deployer/providers-tester/aliyun-clb/aliyun_clb_test.go
similarity index 83%
rename from pkg/core/deployer/providers/aliyun-clb/aliyun_clb_test.go
rename to pkg/core/deployer/providers-tester/aliyun-clb/aliyun_clb_test.go
index 696581ef0..719c8cbfa 100644
--- a/pkg/core/deployer/providers/aliyun-clb/aliyun_clb_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-clb/aliyun_clb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunclb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-clb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNCLB_")
+ fp = tester.InitArgs("ALIYUNCLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -35,7 +37,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_clb_test.go -args \
+ go test -tags=tester -v ./aliyun_clb_test.go -args \
--ALIYUNCLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNCLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNCLB_ACCESSKEYID="your-access-key-id" \
@@ -59,7 +61,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToListener", func(t *testing.T) {
@@ -74,6 +76,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-dcdn/aliyun_dcdn_test.go b/pkg/core/deployer/providers-tester/aliyun-dcdn/aliyun_dcdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/aliyun-dcdn/aliyun_dcdn_test.go
rename to pkg/core/deployer/providers-tester/aliyun-dcdn/aliyun_dcdn_test.go
index 0eae4fcac..fbe6d6c9e 100644
--- a/pkg/core/deployer/providers/aliyun-dcdn/aliyun_dcdn_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-dcdn/aliyun_dcdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyundcdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-dcdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNDCDN_")
+ fp = tester.InitArgs("ALIYUNDCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_dcdn_test.go -args \
+ go test -tags=tester -v ./aliyun_dcdn_test.go -args \
--ALIYUNDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNDCDN_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-ddospro/aliyun_ddospro_test.go b/pkg/core/deployer/providers-tester/aliyun-ddospro/aliyun_ddospro_test.go
similarity index 81%
rename from pkg/core/deployer/providers/aliyun-ddospro/aliyun_ddospro_test.go
rename to pkg/core/deployer/providers-tester/aliyun-ddospro/aliyun_ddospro_test.go
index a18058490..a1e39b414 100644
--- a/pkg/core/deployer/providers/aliyun-ddospro/aliyun_ddospro_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-ddospro/aliyun_ddospro_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunddospro_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-ddospro"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNDDOSPRO_")
+ fp = tester.InitArgs("ALIYUNDDOSPRO_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_ddospro_test.go -args \
+ go test -tags=tester -v ./aliyun_ddospro_test.go -args \
--ALIYUNDDOSPRO_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNDDOSPRO_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNDDOSPRO_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-esa-saas/aliyun_esasaas_test.go b/pkg/core/deployer/providers-tester/aliyun-esa-saas/aliyun_esasaas_test.go
similarity index 82%
rename from pkg/core/deployer/providers/aliyun-esa-saas/aliyun_esasaas_test.go
rename to pkg/core/deployer/providers-tester/aliyun-esa-saas/aliyun_esasaas_test.go
index abf4ba7bb..62f54cd54 100644
--- a/pkg/core/deployer/providers/aliyun-esa-saas/aliyun_esasaas_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-esa-saas/aliyun_esasaas_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunesasaas_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-esa-saas"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNESASAAS_")
+ fp = tester.InitArgs("ALIYUNESASAAS_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_esasaas_test.go -args \
+ go test -tags=tester -v ./aliyun_esasaas_test.go -args \
--ALIYUNESASAAS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNESASAAS_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNESASAAS_ACCESSKEYID="your-access-key-id" \
@@ -56,6 +58,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-esa/aliyun_esa_test.go b/pkg/core/deployer/providers-tester/aliyun-esa/aliyun_esa_test.go
similarity index 80%
rename from pkg/core/deployer/providers/aliyun-esa/aliyun_esa_test.go
rename to pkg/core/deployer/providers-tester/aliyun-esa/aliyun_esa_test.go
index 618bf8748..6b23270fe 100644
--- a/pkg/core/deployer/providers/aliyun-esa/aliyun_esa_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-esa/aliyun_esa_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunesa_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-esa"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNESA_")
+ fp = tester.InitArgs("ALIYUNESA_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_esa_test.go -args \
+ go test -tags=tester -v ./aliyun_esa_test.go -args \
--ALIYUNESA_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNESA_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNESA_ACCESSKEYID="your-access-key-id" \
@@ -51,6 +53,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-fc/aliyun_fc_test.go b/pkg/core/deployer/providers-tester/aliyun-fc/aliyun_fc_test.go
similarity index 81%
rename from pkg/core/deployer/providers/aliyun-fc/aliyun_fc_test.go
rename to pkg/core/deployer/providers-tester/aliyun-fc/aliyun_fc_test.go
index cbd477662..56f3cf2c5 100644
--- a/pkg/core/deployer/providers/aliyun-fc/aliyun_fc_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-fc/aliyun_fc_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunfc_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-fc"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNFC_")
+ fp = tester.InitArgs("ALIYUNFC_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_fc_test.go -args \
+ go test -tags=tester -v ./aliyun_fc_test.go -args \
--ALIYUNFC_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNFC_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNFC_ACCESSKEYID="your-access-key-id" \
@@ -53,6 +55,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-ga/aliyun_ga_test.go b/pkg/core/deployer/providers-tester/aliyun-ga/aliyun_ga_test.go
similarity index 82%
rename from pkg/core/deployer/providers/aliyun-ga/aliyun_ga_test.go
rename to pkg/core/deployer/providers-tester/aliyun-ga/aliyun_ga_test.go
index a1e9f1a22..7f91bfbeb 100644
--- a/pkg/core/deployer/providers/aliyun-ga/aliyun_ga_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-ga/aliyun_ga_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunga_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-ga"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNGA_")
+ fp = tester.InitArgs("ALIYUNGA_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_ga_test.go -args \
+ go test -tags=tester -v ./aliyun_ga_test.go -args \
--ALIYUNGA_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNGA_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNGA_ACCESSKEYID="your-access-key-id" \
@@ -55,7 +57,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToListener", func(t *testing.T) {
@@ -68,6 +70,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-live/aliyun_live_test.go b/pkg/core/deployer/providers-tester/aliyun-live/aliyun_live_test.go
similarity index 81%
rename from pkg/core/deployer/providers/aliyun-live/aliyun_live_test.go
rename to pkg/core/deployer/providers-tester/aliyun-live/aliyun_live_test.go
index c159a7c32..2a72b2d7b 100644
--- a/pkg/core/deployer/providers/aliyun-live/aliyun_live_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-live/aliyun_live_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunlive_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-live"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNLIVE_")
+ fp = tester.InitArgs("ALIYUNLIVE_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_live_test.go -args \
+ go test -tags=tester -v ./aliyun_live_test.go -args \
--ALIYUNLIVE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNLIVE_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNLIVE_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-nlb/aliyun_nlb_test.go b/pkg/core/deployer/providers-tester/aliyun-nlb/aliyun_nlb_test.go
similarity index 82%
rename from pkg/core/deployer/providers/aliyun-nlb/aliyun_nlb_test.go
rename to pkg/core/deployer/providers-tester/aliyun-nlb/aliyun_nlb_test.go
index 2f68d6405..d7e6d63d8 100644
--- a/pkg/core/deployer/providers/aliyun-nlb/aliyun_nlb_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-nlb/aliyun_nlb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunnlb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-nlb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNNLB_")
+ fp = tester.InitArgs("ALIYUNNLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_nlb_test.go -args \
+ go test -tags=tester -v ./aliyun_nlb_test.go -args \
--ALIYUNNLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNNLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNNLB_ACCESSKEYID="your-access-key-id" \
@@ -55,7 +57,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToListener", func(t *testing.T) {
@@ -68,6 +70,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-oss/aliyun_oss_test.go b/pkg/core/deployer/providers-tester/aliyun-oss/aliyun_oss_test.go
similarity index 82%
rename from pkg/core/deployer/providers/aliyun-oss/aliyun_oss_test.go
rename to pkg/core/deployer/providers-tester/aliyun-oss/aliyun_oss_test.go
index 8e886ef96..9992fe5a5 100644
--- a/pkg/core/deployer/providers/aliyun-oss/aliyun_oss_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-oss/aliyun_oss_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunoss_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-oss"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNOSS_")
+ fp = tester.InitArgs("ALIYUNOSS_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_oss_test.go -args \
+ go test -tags=tester -v ./aliyun_oss_test.go -args \
--ALIYUNOSS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNOSS_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNOSS_ACCESSKEYID="your-access-key-id" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-vod/aliyun_vod_test.go b/pkg/core/deployer/providers-tester/aliyun-vod/aliyun_vod_test.go
similarity index 81%
rename from pkg/core/deployer/providers/aliyun-vod/aliyun_vod_test.go
rename to pkg/core/deployer/providers-tester/aliyun-vod/aliyun_vod_test.go
index f37197a90..28a53cbcd 100644
--- a/pkg/core/deployer/providers/aliyun-vod/aliyun_vod_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-vod/aliyun_vod_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunvod_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-vod"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNVOD_")
+ fp = tester.InitArgs("ALIYUNVOD_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_vod_test.go -args \
+ go test -tags=tester -v ./aliyun_vod_test.go -args \
--ALIYUNVOD_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNVOD_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNVOD_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aliyun-waf/aliyun_waf_test.go b/pkg/core/deployer/providers-tester/aliyun-waf/aliyun_waf_test.go
similarity index 81%
rename from pkg/core/deployer/providers/aliyun-waf/aliyun_waf_test.go
rename to pkg/core/deployer/providers-tester/aliyun-waf/aliyun_waf_test.go
index 56e655091..5b72eb37d 100644
--- a/pkg/core/deployer/providers/aliyun-waf/aliyun_waf_test.go
+++ b/pkg/core/deployer/providers-tester/aliyun-waf/aliyun_waf_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package aliyunwaf_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aliyun-waf"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ALIYUNWAF_")
+ fp = tester.InitArgs("ALIYUNWAF_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aliyun_waf_test.go -args \
+ go test -tags=tester -v ./aliyun_waf_test.go -args \
--ALIYUNWAF_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ALIYUNWAF_TESTKEYPATH="/path/to/your-test-key.pem" \
--ALIYUNWAF_ACCESSKEYID="your-access-key-id" \
@@ -51,6 +53,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/apisix/apisix_test.go b/pkg/core/deployer/providers-tester/apisix/apisix_test.go
similarity index 80%
rename from pkg/core/deployer/providers/apisix/apisix_test.go
rename to pkg/core/deployer/providers-tester/apisix/apisix_test.go
index 61d14d103..beafd51d0 100644
--- a/pkg/core/deployer/providers/apisix/apisix_test.go
+++ b/pkg/core/deployer/providers-tester/apisix/apisix_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package apisix_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/apisix"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("APISIX_")
+ fp = tester.InitArgs("APISIX_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./apisix_test.go -args \
+ go test -tags=tester -v ./apisix_test.go -args \
--APISIX_TESTCERTPATH="/path/to/your-test-cert.pem" \
--APISIX_TESTKEYPATH="/path/to/your-test-key.pem" \
--APISIX_SERVERURL="http://127.0.0.1:9080" \
@@ -49,6 +51,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aws-alb/aws_alb_test.go b/pkg/core/deployer/providers-tester/aws-alb/aws_alb_test.go
similarity index 83%
rename from pkg/core/deployer/providers/aws-alb/aws_alb_test.go
rename to pkg/core/deployer/providers-tester/aws-alb/aws_alb_test.go
index d5ca6b1ed..25963208b 100644
--- a/pkg/core/deployer/providers/aws-alb/aws_alb_test.go
+++ b/pkg/core/deployer/providers-tester/aws-alb/aws_alb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package awsalb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-alb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("AWSALB_")
+ fp = tester.InitArgs("AWSALB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aws_alb_test.go -args \
+ go test -tags=tester -v ./aws_alb_test.go -args \
--AWSALB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--AWSALB_TESTKEYPATH="/path/to/your-test-key.pem" \
--AWSALB_ACCESSKEYID="your-access-key-id" \
@@ -56,6 +58,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aws-amplify/aws_amplify_test.go b/pkg/core/deployer/providers-tester/aws-amplify/aws_amplify_test.go
similarity index 82%
rename from pkg/core/deployer/providers/aws-amplify/aws_amplify_test.go
rename to pkg/core/deployer/providers-tester/aws-amplify/aws_amplify_test.go
index b8f461bdb..e4d1041da 100644
--- a/pkg/core/deployer/providers/aws-amplify/aws_amplify_test.go
+++ b/pkg/core/deployer/providers-tester/aws-amplify/aws_amplify_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package awsamplify_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-amplify"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("AWSAMPLIFY_")
+ fp = tester.InitArgs("AWSAMPLIFY_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aws_amplify_test.go -args \
+ go test -tags=tester -v ./aws_amplify_test.go -args \
--AWSAMPLIFY_TESTCERTPATH="/path/to/your-test-cert.pem" \
--AWSAMPLIFY_TESTKEYPATH="/path/to/your-test-key.pem" \
--AWSAMPLIFY_ACCESSKEYID="your-access-key-id" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aws-apigateway/aws_apigateway_test.go b/pkg/core/deployer/providers-tester/aws-apigateway/aws_apigateway_test.go
similarity index 81%
rename from pkg/core/deployer/providers/aws-apigateway/aws_apigateway_test.go
rename to pkg/core/deployer/providers-tester/aws-apigateway/aws_apigateway_test.go
index 8b483a981..a8e87ec28 100644
--- a/pkg/core/deployer/providers/aws-apigateway/aws_apigateway_test.go
+++ b/pkg/core/deployer/providers-tester/aws-apigateway/aws_apigateway_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package awsapigateway_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-apigateway"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("AWSAPIGATEWAY_")
+ fp = tester.InitArgs("AWSAPIGATEWAY_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aws_apigateway_test.go -args \
+ go test -tags=tester -v ./aws_apigateway_test.go -args \
--AWSAPIGATEWAY_TESTCERTPATH="/path/to/your-test-cert.pem" \
--AWSAPIGATEWAY_TESTKEYPATH="/path/to/your-test-key.pem" \
--AWSAPIGATEWAY_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aws-clb/aws_clb_test.go b/pkg/core/deployer/providers-tester/aws-clb/aws_clb_test.go
similarity index 83%
rename from pkg/core/deployer/providers/aws-clb/aws_clb_test.go
rename to pkg/core/deployer/providers-tester/aws-clb/aws_clb_test.go
index 44957cf3e..4eb72ad7c 100644
--- a/pkg/core/deployer/providers/aws-clb/aws_clb_test.go
+++ b/pkg/core/deployer/providers-tester/aws-clb/aws_clb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package awsclb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-clb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("AWSCLB_")
+ fp = tester.InitArgs("AWSCLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aws_clb_test.go -args \
+ go test -tags=tester -v ./aws_clb_test.go -args \
--AWSCLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--AWSCLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--AWSCLB_ACCESSKEYID="your-access-key-id" \
@@ -56,6 +58,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aws-cloudfront/aws_cloudfront_test.go b/pkg/core/deployer/providers-tester/aws-cloudfront/aws_cloudfront_test.go
similarity index 81%
rename from pkg/core/deployer/providers/aws-cloudfront/aws_cloudfront_test.go
rename to pkg/core/deployer/providers-tester/aws-cloudfront/aws_cloudfront_test.go
index 7fa8ca992..6a10ca8c6 100644
--- a/pkg/core/deployer/providers/aws-cloudfront/aws_cloudfront_test.go
+++ b/pkg/core/deployer/providers-tester/aws-cloudfront/aws_cloudfront_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package awscloudfront_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-cloudfront"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("AWSCLOUDFRONT_")
+ fp = tester.InitArgs("AWSCLOUDFRONT_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aws_cloudfront_test.go -args \
+ go test -tags=tester -v ./aws_cloudfront_test.go -args \
--AWSCLOUDFRONT_TESTCERTPATH="/path/to/your-test-cert.pem" \
--AWSCLOUDFRONT_TESTKEYPATH="/path/to/your-test-key.pem" \
--AWSCLOUDFRONT_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/aws-nlb/aws_nlb_test.go b/pkg/core/deployer/providers-tester/aws-nlb/aws_nlb_test.go
similarity index 83%
rename from pkg/core/deployer/providers/aws-nlb/aws_nlb_test.go
rename to pkg/core/deployer/providers-tester/aws-nlb/aws_nlb_test.go
index 624ecc8ca..39a0182f6 100644
--- a/pkg/core/deployer/providers/aws-nlb/aws_nlb_test.go
+++ b/pkg/core/deployer/providers-tester/aws-nlb/aws_nlb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package awsnlb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/aws-nlb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("AWSNLB_")
+ fp = tester.InitArgs("AWSNLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./aws_nlb_test.go -args \
+ go test -tags=tester -v ./aws_nlb_test.go -args \
--AWSNLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--AWSNLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--AWSNLB_ACCESSKEYID="your-access-key-id" \
@@ -56,6 +58,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/baiducloud-appblb/baiducloud_appblb_test.go b/pkg/core/deployer/providers-tester/baiducloud-appblb/baiducloud_appblb_test.go
similarity index 83%
rename from pkg/core/deployer/providers/baiducloud-appblb/baiducloud_appblb_test.go
rename to pkg/core/deployer/providers-tester/baiducloud-appblb/baiducloud_appblb_test.go
index 559d5d36d..804cad0df 100644
--- a/pkg/core/deployer/providers/baiducloud-appblb/baiducloud_appblb_test.go
+++ b/pkg/core/deployer/providers-tester/baiducloud-appblb/baiducloud_appblb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baiducloudappblb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baiducloud-appblb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BAIDUCLOUDAPPBLB_")
+ fp = tester.InitArgs("BAIDUCLOUDAPPBLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baiducloud_appblb_test.go -args \
+ go test -tags=tester -v ./baiducloud_appblb_test.go -args \
--BAIDUCLOUDAPPBLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAIDUCLOUDAPPBLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAIDUCLOUDAPPBLB_ACCESSKEYID="your-access-key-id" \
@@ -56,6 +58,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/baiducloud-blb/baiducloud_blb_test.go b/pkg/core/deployer/providers-tester/baiducloud-blb/baiducloud_blb_test.go
similarity index 83%
rename from pkg/core/deployer/providers/baiducloud-blb/baiducloud_blb_test.go
rename to pkg/core/deployer/providers-tester/baiducloud-blb/baiducloud_blb_test.go
index 3e6ee519a..c28df9016 100644
--- a/pkg/core/deployer/providers/baiducloud-blb/baiducloud_blb_test.go
+++ b/pkg/core/deployer/providers-tester/baiducloud-blb/baiducloud_blb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baiducloudblb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baiducloud-blb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BAIDUCLOUDBLB_")
+ fp = tester.InitArgs("BAIDUCLOUDBLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baiducloud_blb_test.go -args \
+ go test -tags=tester -v ./baiducloud_blb_test.go -args \
--BAIDUCLOUDBLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAIDUCLOUDBLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAIDUCLOUDBLB_ACCESSKEYID="your-access-key-id" \
@@ -56,6 +58,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/baiducloud-cdn/baiducloud_cdn_test.go b/pkg/core/deployer/providers-tester/baiducloud-cdn/baiducloud_cdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/baiducloud-cdn/baiducloud_cdn_test.go
rename to pkg/core/deployer/providers-tester/baiducloud-cdn/baiducloud_cdn_test.go
index 015913726..ec44454d0 100644
--- a/pkg/core/deployer/providers/baiducloud-cdn/baiducloud_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/baiducloud-cdn/baiducloud_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baiducloudcdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baiducloud-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BAIDUCLOUDCDN_")
+ fp = tester.InitArgs("BAIDUCLOUDCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baiducloud_cdn_test.go -args \
+ go test -tags=tester -v ./baiducloud_cdn_test.go -args \
--BAIDUCLOUDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAIDUCLOUDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAIDUCLOUDCDN_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/baishan-cdn/baishan_cdn_test.go b/pkg/core/deployer/providers-tester/baishan-cdn/baishan_cdn_test.go
similarity index 76%
rename from pkg/core/deployer/providers/baishan-cdn/baishan_cdn_test.go
rename to pkg/core/deployer/providers-tester/baishan-cdn/baishan_cdn_test.go
index a70832054..7444c6228 100644
--- a/pkg/core/deployer/providers/baishan-cdn/baishan_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/baishan-cdn/baishan_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baishancdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baishan-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BAISHANCDN_")
+ fp = tester.InitArgs("BAISHANCDN_")
fTestCertPath string
fTestKeyPath string
fApiToken string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baishan_cdn_test.go -args \
+ go test -tags=tester -v ./baishan_cdn_test.go -args \
--BAISHANCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAISHANCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAISHANCDN_APITOKEN="your-api-token" \
@@ -44,6 +46,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/baotapanel-console/baotapanel_console_test.go b/pkg/core/deployer/providers-tester/baotapanel-console/baotapanel_console_test.go
similarity index 77%
rename from pkg/core/deployer/providers/baotapanel-console/baotapanel_console_test.go
rename to pkg/core/deployer/providers-tester/baotapanel-console/baotapanel_console_test.go
index 4f7113b88..6290328c4 100644
--- a/pkg/core/deployer/providers/baotapanel-console/baotapanel_console_test.go
+++ b/pkg/core/deployer/providers-tester/baotapanel-console/baotapanel_console_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baotapanelconsole_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotapanel-console"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BAOTAPANELCONSOLE_")
+ fp = tester.InitArgs("BAOTAPANELCONSOLE_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baotapanel_console_test.go -args \
+ go test -tags=tester -v ./baotapanel_console_test.go -args \
--BAOTAPANELCONSOLE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAOTAPANELCONSOLE_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAOTAPANELCONSOLE_SERVERURL="http://127.0.0.1:8888" \
@@ -45,6 +47,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/baotapanel/baotapanel_test.go b/pkg/core/deployer/providers-tester/baotapanel/baotapanel_test.go
similarity index 81%
rename from pkg/core/deployer/providers/baotapanel/baotapanel_test.go
rename to pkg/core/deployer/providers-tester/baotapanel/baotapanel_test.go
index 85b532636..91a008b0b 100644
--- a/pkg/core/deployer/providers/baotapanel/baotapanel_test.go
+++ b/pkg/core/deployer/providers-tester/baotapanel/baotapanel_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baotapanel_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotapanel"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BAOTAPANEL_")
+ fp = tester.InitArgs("BAOTAPANEL_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baotapanel_test.go -args \
+ go test -tags=tester -v ./baotapanel_test.go -args \
--BAOTAPANEL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAOTAPANEL_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAOTAPANEL_SERVERURL="http://127.0.0.1:8888" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/baotapanelgo-console/baotapanelgo_console_test.go b/pkg/core/deployer/providers-tester/baotapanelgo-console/baotapanelgo_console_test.go
similarity index 76%
rename from pkg/core/deployer/providers/baotapanelgo-console/baotapanelgo_console_test.go
rename to pkg/core/deployer/providers-tester/baotapanelgo-console/baotapanelgo_console_test.go
index a4fe3f6f8..66f465109 100644
--- a/pkg/core/deployer/providers/baotapanelgo-console/baotapanelgo_console_test.go
+++ b/pkg/core/deployer/providers-tester/baotapanelgo-console/baotapanelgo_console_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baotapanelgoconsole_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotapanelgo-console"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BAOTAPANELGOCONSOLE_")
+ fp = tester.InitArgs("BAOTAPANELGOCONSOLE_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baotapanelgo_console_test.go -args \
+ go test -tags=tester -v ./baotapanelgo_console_test.go -args \
--BAOTAPANELGOCONSOLE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAOTAPANELGOCONSOLE_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAOTAPANELGOCONSOLE_SERVERURL="http://127.0.0.1:8888" \
@@ -44,6 +46,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/baotapanelgo/baotapanelgo_test.go b/pkg/core/deployer/providers-tester/baotapanelgo/baotapanelgo_test.go
similarity index 81%
rename from pkg/core/deployer/providers/baotapanelgo/baotapanelgo_test.go
rename to pkg/core/deployer/providers-tester/baotapanelgo/baotapanelgo_test.go
index 71912e0af..af01e8d2e 100644
--- a/pkg/core/deployer/providers/baotapanelgo/baotapanelgo_test.go
+++ b/pkg/core/deployer/providers-tester/baotapanelgo/baotapanelgo_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baotapanelgo_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotapanelgo"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BAOTAPANELGO_")
+ fp = tester.InitArgs("BAOTAPANELGO_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baotapanelgo_test.go -args \
+ go test -tags=tester -v ./baotapanelgo_test.go -args \
--BAOTAPANELGO_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAOTAPANELGO_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAOTAPANELGO_SERVERURL="http://127.0.0.1:8888" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/baotawaf-console/baotawaf_console_test.go b/pkg/core/deployer/providers-tester/baotawaf-console/baotawaf_console_test.go
similarity index 77%
rename from pkg/core/deployer/providers/baotawaf-console/baotawaf_console_test.go
rename to pkg/core/deployer/providers-tester/baotawaf-console/baotawaf_console_test.go
index 39590f116..7c6252ea9 100644
--- a/pkg/core/deployer/providers/baotawaf-console/baotawaf_console_test.go
+++ b/pkg/core/deployer/providers-tester/baotawaf-console/baotawaf_console_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baotapanelconsole_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotawaf-console"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BAOTAWAFCONSOLE_")
+ fp = tester.InitArgs("BAOTAWAFCONSOLE_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baotawaf_console_test.go -args \
+ go test -tags=tester -v ./baotawaf_console_test.go -args \
--BAOTAWAFCONSOLE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAOTAWAFCONSOLE_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAOTAWAFCONSOLE_SERVERURL="http://127.0.0.1:8888" \
@@ -46,6 +48,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/baotawaf/baotawaf_test.go b/pkg/core/deployer/providers-tester/baotawaf/baotawaf_test.go
similarity index 81%
rename from pkg/core/deployer/providers/baotawaf/baotawaf_test.go
rename to pkg/core/deployer/providers-tester/baotawaf/baotawaf_test.go
index ffbc985f0..965fe7a2a 100644
--- a/pkg/core/deployer/providers/baotawaf/baotawaf_test.go
+++ b/pkg/core/deployer/providers-tester/baotawaf/baotawaf_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package baotawaf_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/baotawaf"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BAOTAWAF_")
+ fp = tester.InitArgs("BAOTAWAF_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./baotawaf_test.go -args \
+ go test -tags=tester -v ./baotawaf_test.go -args \
--BAOTAWAF_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BAOTAWAF_TESTKEYPATH="/path/to/your-test-key.pem" \
--BAOTAWAF_SERVERURL="http://127.0.0.1:8888" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/bunny-cdn/bunny_cdn_test.go b/pkg/core/deployer/providers-tester/bunny-cdn/bunny_cdn_test.go
similarity index 78%
rename from pkg/core/deployer/providers/bunny-cdn/bunny_cdn_test.go
rename to pkg/core/deployer/providers-tester/bunny-cdn/bunny_cdn_test.go
index a3d6009ce..0d3e06f80 100644
--- a/pkg/core/deployer/providers/bunny-cdn/bunny_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/bunny-cdn/bunny_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package bunnycdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/bunny-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BUNNYCDN_")
+ fp = tester.InitArgs("BUNNYCDN_")
fTestCertPath string
fTestKeyPath string
fApiKey string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./bunny_cdn_test.go -args \
+ go test -tags=tester -v ./bunny_cdn_test.go -args \
--BUNNYCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BUNNYCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--BUNNYCDN_APITOKEN="your-api-token" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/byteplus-alb/byteplus_alb_test.go b/pkg/core/deployer/providers-tester/byteplus-alb/byteplus_alb_test.go
similarity index 81%
rename from pkg/core/deployer/providers/byteplus-alb/byteplus_alb_test.go
rename to pkg/core/deployer/providers-tester/byteplus-alb/byteplus_alb_test.go
index a8b46c897..10f5e7e64 100644
--- a/pkg/core/deployer/providers/byteplus-alb/byteplus_alb_test.go
+++ b/pkg/core/deployer/providers-tester/byteplus-alb/byteplus_alb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package byteplusalb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-alb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BYTEPLUSALB_")
+ fp = tester.InitArgs("BYTEPLUSALB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./byteplus_alb_test.go -args \
+ go test -tags=tester -v ./byteplus_alb_test.go -args \
--BYTEPLUSALB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BYTEPLUSALB_TESTKEYPATH="/path/to/your-test-key.pem" \
--BYTEPLUSALB_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/byteplus-apig/byteplus_apig_test.go b/pkg/core/deployer/providers-tester/byteplus-apig/byteplus_apig_test.go
similarity index 81%
rename from pkg/core/deployer/providers/byteplus-apig/byteplus_apig_test.go
rename to pkg/core/deployer/providers-tester/byteplus-apig/byteplus_apig_test.go
index 6e2f5d935..f0426b9aa 100644
--- a/pkg/core/deployer/providers/byteplus-apig/byteplus_apig_test.go
+++ b/pkg/core/deployer/providers-tester/byteplus-apig/byteplus_apig_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package byteplusapig_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-apig"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BYTEPLUSAPIG_")
+ fp = tester.InitArgs("BYTEPLUSAPIG_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./byteplus_apig_test.go -args \
+ go test -tags=tester -v ./byteplus_apig_test.go -args \
--BYTEPLUSAPIG_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BYTEPLUSAPIG_TESTKEYPATH="/path/to/your-test-key.pem" \
--BYTEPLUSAPIG_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/byteplus-cdn/byteplus_cdn_test.go b/pkg/core/deployer/providers-tester/byteplus-cdn/byteplus_cdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/byteplus-cdn/byteplus_cdn_test.go
rename to pkg/core/deployer/providers-tester/byteplus-cdn/byteplus_cdn_test.go
index f6b830819..acb0fe9f1 100644
--- a/pkg/core/deployer/providers/byteplus-cdn/byteplus_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/byteplus-cdn/byteplus_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package bytepluscdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BYTEPLUSCDN_")
+ fp = tester.InitArgs("BYTEPLUSCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./byteplus_cdn_test.go -args \
+ go test -tags=tester -v ./byteplus_cdn_test.go -args \
--BYTEPLUSCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BYTEPLUSCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--BYTEPLUSCDN_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/byteplus-clb/byteplus_clb_test.go b/pkg/core/deployer/providers-tester/byteplus-clb/byteplus_clb_test.go
similarity index 81%
rename from pkg/core/deployer/providers/byteplus-clb/byteplus_clb_test.go
rename to pkg/core/deployer/providers-tester/byteplus-clb/byteplus_clb_test.go
index 286d34367..1a9261f8c 100644
--- a/pkg/core/deployer/providers/byteplus-clb/byteplus_clb_test.go
+++ b/pkg/core/deployer/providers-tester/byteplus-clb/byteplus_clb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package byteplusclb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-clb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BYTEPLUSCLB_")
+ fp = tester.InitArgs("BYTEPLUSCLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./byteplus_clb_test.go -args \
+ go test -tags=tester -v ./byteplus_clb_test.go -args \
--BYTEPLUSCLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BYTEPLUSCLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--BYTEPLUSCLB_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/byteplus-medialive/byteplus_medialive_test.go b/pkg/core/deployer/providers-tester/byteplus-medialive/byteplus_medialive_test.go
similarity index 79%
rename from pkg/core/deployer/providers/byteplus-medialive/byteplus_medialive_test.go
rename to pkg/core/deployer/providers-tester/byteplus-medialive/byteplus_medialive_test.go
index 8bc12abcb..529b88848 100644
--- a/pkg/core/deployer/providers/byteplus-medialive/byteplus_medialive_test.go
+++ b/pkg/core/deployer/providers-tester/byteplus-medialive/byteplus_medialive_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package byteplusmedialive_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-medialive"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BYTEPLUSMEDIALIVE_")
+ fp = tester.InitArgs("BYTEPLUSMEDIALIVE_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./byteplus_medialive_test.go -args \
+ go test -tags=tester -v ./byteplus_medialive_test.go -args \
--BYTEPLUSMEDIALIVE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BYTEPLUSMEDIALIVE_TESTKEYPATH="/path/to/your-test-key.pem" \
--BYTEPLUSMEDIALIVE_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/byteplus-tos/byteplus_tos_test.go b/pkg/core/deployer/providers-tester/byteplus-tos/byteplus_tos_test.go
similarity index 82%
rename from pkg/core/deployer/providers/byteplus-tos/byteplus_tos_test.go
rename to pkg/core/deployer/providers-tester/byteplus-tos/byteplus_tos_test.go
index 9a2b8e2a4..56ed43a3e 100644
--- a/pkg/core/deployer/providers/byteplus-tos/byteplus_tos_test.go
+++ b/pkg/core/deployer/providers-tester/byteplus-tos/byteplus_tos_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package byteplustos_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/byteplus-tos"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("BYTEPLUSTOS_")
+ fp = tester.InitArgs("BYTEPLUSTOS_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./byteplus_tos_test.go -args \
+ go test -tags=tester -v ./byteplus_tos_test.go -args \
--BYTEPLUSTOS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--BYTEPLUSTOS_TESTKEYPATH="/path/to/your-test-key.pem" \
--BYTEPLUSTOS_ACCESSKEYID="your-access-key-id" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/cachefly/cachefly_test.go b/pkg/core/deployer/providers-tester/cachefly/cachefly_test.go
similarity index 72%
rename from pkg/core/deployer/providers/cachefly/cachefly_test.go
rename to pkg/core/deployer/providers-tester/cachefly/cachefly_test.go
index 8a5e7e2f5..5b189a4da 100644
--- a/pkg/core/deployer/providers/cachefly/cachefly_test.go
+++ b/pkg/core/deployer/providers-tester/cachefly/cachefly_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package cachefly_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cachefly"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CACHEFLY_")
+ fp = tester.InitArgs("CACHEFLY_")
fTestCertPath string
fTestKeyPath string
fApiToken string
@@ -25,7 +27,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./cachefly_test.go -args \
+ go test -tags=tester -v ./cachefly_test.go -args \
--CACHEFLY_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CACHEFLY_TESTKEYPATH="/path/to/your-test-key.pem" \
--CACHEFLY_APITOKEN="your-api-token"
@@ -39,6 +41,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/cdnfly/cdnfly_test.go b/pkg/core/deployer/providers-tester/cdnfly/cdnfly_test.go
similarity index 82%
rename from pkg/core/deployer/providers/cdnfly/cdnfly_test.go
rename to pkg/core/deployer/providers-tester/cdnfly/cdnfly_test.go
index 6e30a861c..b5b2fb583 100644
--- a/pkg/core/deployer/providers/cdnfly/cdnfly_test.go
+++ b/pkg/core/deployer/providers-tester/cdnfly/cdnfly_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package cdnfly_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cdnfly"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CDNFLY_")
+ fp = tester.InitArgs("CDNFLY_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./cdnfly_test.go -args \
+ go test -tags=tester -v ./cdnfly_test.go -args \
--CDNFLY_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CDNFLY_TESTKEYPATH="/path/to/your-test-key.pem" \
--CDNFLY_SERVERURL="http://127.0.0.1:88" \
@@ -53,6 +55,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/cloudflare-ssl/cloudflare_ssl_test.go b/pkg/core/deployer/providers-tester/cloudflare-ssl/cloudflare_ssl_test.go
similarity index 78%
rename from pkg/core/deployer/providers/cloudflare-ssl/cloudflare_ssl_test.go
rename to pkg/core/deployer/providers-tester/cloudflare-ssl/cloudflare_ssl_test.go
index 24edd8f1c..0554a7195 100644
--- a/pkg/core/deployer/providers/cloudflare-ssl/cloudflare_ssl_test.go
+++ b/pkg/core/deployer/providers-tester/cloudflare-ssl/cloudflare_ssl_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package cloudflaressl_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cloudflare-ssl"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CLOUDFLARESSL_")
+ fp = tester.InitArgs("CLOUDFLARESSL_")
fTestCertPath string
fTestKeyPath string
fApiToken string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./cloudflare_ssl_test.go -args \
+ go test -tags=tester -v ./cloudflare_ssl_test.go -args \
--CLOUDFLARESSL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CLOUDFLARESSL_TESTKEYPATH="/path/to/your-test-key.pem" \
--CLOUDFLARESSL_APITOKEN="your-api-token" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/cmcccloud-cdn/cmcccloud_cdn_test.go b/pkg/core/deployer/providers-tester/cmcccloud-cdn/cmcccloud_cdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/cmcccloud-cdn/cmcccloud_cdn_test.go
rename to pkg/core/deployer/providers-tester/cmcccloud-cdn/cmcccloud_cdn_test.go
index 2e4eedbdc..5ca4dc2f8 100644
--- a/pkg/core/deployer/providers/cmcccloud-cdn/cmcccloud_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/cmcccloud-cdn/cmcccloud_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package cmcccloudcdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cmcccloud-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CMCCCLOUDCDN_")
+ fp = tester.InitArgs("CMCCCLOUDCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./cmcccloud_cdn_test.go -args \
+ go test -tags=tester -v ./cmcccloud_cdn_test.go -args \
--CMCCCLOUDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CMCCCLOUDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--CMCCCLOUDCDN_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/cmcccloud-vlb/cmcccloud_vlb_test.go b/pkg/core/deployer/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go
similarity index 82%
rename from pkg/core/deployer/providers/cmcccloud-vlb/cmcccloud_vlb_test.go
rename to pkg/core/deployer/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go
index 88d2148a2..7058dfcd2 100644
--- a/pkg/core/deployer/providers/cmcccloud-vlb/cmcccloud_vlb_test.go
+++ b/pkg/core/deployer/providers-tester/cmcccloud-vlb/cmcccloud_vlb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package cmcccloudvlb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cmcccloud-vlb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CMCCCLOUDVLB_")
+ fp = tester.InitArgs("CMCCCLOUDVLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./cmcccloud_vlb_test.go -args \
+ go test -tags=tester -v ./cmcccloud_vlb_test.go -args \
--CMCCCLOUDVLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CMCCCLOUDVLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--CMCCCLOUDVLB_ACCESSKEYID="your-access-key-id" \
@@ -55,7 +57,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToListener", func(t *testing.T) {
@@ -68,6 +70,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/cpanel/cpanel_test.go b/pkg/core/deployer/providers-tester/cpanel/cpanel_test.go
similarity index 82%
rename from pkg/core/deployer/providers/cpanel/cpanel_test.go
rename to pkg/core/deployer/providers-tester/cpanel/cpanel_test.go
index 1ca12ab4f..35a48bd34 100644
--- a/pkg/core/deployer/providers/cpanel/cpanel_test.go
+++ b/pkg/core/deployer/providers-tester/cpanel/cpanel_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package cpanel_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/cpanel"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CPANEL_")
+ fp = tester.InitArgs("CPANEL_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./cpanel_test.go -args \
+ go test -tags=tester -v ./cpanel_test.go -args \
--CPANEL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CPANEL_TESTKEYPATH="/path/to/your-test-key.pem" \
--CPANEL_SERVERURL="http://127.0.0.1:2082" \
@@ -53,6 +55,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ctcccloud-ao/ctcccloud_ao_test.go b/pkg/core/deployer/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go
similarity index 79%
rename from pkg/core/deployer/providers/ctcccloud-ao/ctcccloud_ao_test.go
rename to pkg/core/deployer/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go
index b4e4760c4..0225a951e 100644
--- a/pkg/core/deployer/providers/ctcccloud-ao/ctcccloud_ao_test.go
+++ b/pkg/core/deployer/providers-tester/ctcccloud-ao/ctcccloud_ao_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudao_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-ao"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CTCCCLOUDAO_")
+ fp = tester.InitArgs("CTCCCLOUDAO_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_ao_test.go -args \
+ go test -tags=tester -v ./ctcccloud_ao_test.go -args \
--CTCCCLOUDAO_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDAO_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDAO_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ctcccloud-cdn/ctcccloud_cdn_test.go b/pkg/core/deployer/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/ctcccloud-cdn/ctcccloud_cdn_test.go
rename to pkg/core/deployer/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go
index 4f36191a3..a12bd72eb 100644
--- a/pkg/core/deployer/providers/ctcccloud-cdn/ctcccloud_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/ctcccloud-cdn/ctcccloud_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudcdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CTCCCLOUDCDN_")
+ fp = tester.InitArgs("CTCCCLOUDCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_cdn_test.go -args \
+ go test -tags=tester -v ./ctcccloud_cdn_test.go -args \
--CTCCCLOUDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDCDN_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ctcccloud-cms/ctcccloud_cms_test.go b/pkg/core/deployer/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go
similarity index 76%
rename from pkg/core/deployer/providers/ctcccloud-cms/ctcccloud_cms_test.go
rename to pkg/core/deployer/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go
index 0d6e1d642..3d910bcc5 100644
--- a/pkg/core/deployer/providers/ctcccloud-cms/ctcccloud_cms_test.go
+++ b/pkg/core/deployer/providers-tester/ctcccloud-cms/ctcccloud_cms_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudcms_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-cms"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CTCCCLOUDCMS_")
+ fp = tester.InitArgs("CTCCCLOUDCMS_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_cms_test.go -args \
+ go test -tags=tester -v ./ctcccloud_cms_test.go -args \
--CTCCCLOUDCMS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDCMS_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDCMS_ACCESSKEYID="your-access-key-id" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ctcccloud-elb/ctcccloud_elb_test.go b/pkg/core/deployer/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go
similarity index 82%
rename from pkg/core/deployer/providers/ctcccloud-elb/ctcccloud_elb_test.go
rename to pkg/core/deployer/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go
index eea8851b5..fcad43d02 100644
--- a/pkg/core/deployer/providers/ctcccloud-elb/ctcccloud_elb_test.go
+++ b/pkg/core/deployer/providers-tester/ctcccloud-elb/ctcccloud_elb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudelb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-elb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CTCCCLOUDELB_")
+ fp = tester.InitArgs("CTCCCLOUDELB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_elb_test.go -args \
+ go test -tags=tester -v ./ctcccloud_elb_test.go -args \
--CTCCCLOUDELB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDELB_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDELB_ACCESSKEYID="your-access-key-id" \
@@ -55,7 +57,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToListener", func(t *testing.T) {
@@ -68,6 +70,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ctcccloud-faas/ctcccloud_faas_test.go b/pkg/core/deployer/providers-tester/ctcccloud-faas/ctcccloud_faas_test.go
similarity index 80%
rename from pkg/core/deployer/providers/ctcccloud-faas/ctcccloud_faas_test.go
rename to pkg/core/deployer/providers-tester/ctcccloud-faas/ctcccloud_faas_test.go
index efbafb738..83212d377 100644
--- a/pkg/core/deployer/providers/ctcccloud-faas/ctcccloud_faas_test.go
+++ b/pkg/core/deployer/providers-tester/ctcccloud-faas/ctcccloud_faas_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudfaas_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-faas"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CTCCCLOUDFAAS_")
+ fp = tester.InitArgs("CTCCCLOUDFAAS_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_faas_test.go -args \
+ go test -tags=tester -v ./ctcccloud_faas_test.go -args \
--CTCCCLOUDFAAS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDFAAS_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDFAAS_ACCESSKEYID="your-access-key-id" \
@@ -51,6 +53,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ctcccloud-icdn/ctcccloud_icdn_test.go b/pkg/core/deployer/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/ctcccloud-icdn/ctcccloud_icdn_test.go
rename to pkg/core/deployer/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go
index 17955e098..5b7fbbe91 100644
--- a/pkg/core/deployer/providers/ctcccloud-icdn/ctcccloud_icdn_test.go
+++ b/pkg/core/deployer/providers-tester/ctcccloud-icdn/ctcccloud_icdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudicdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-icdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CTCCCLOUDCDN_")
+ fp = tester.InitArgs("CTCCCLOUDCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_cdn_test.go -args \
+ go test -tags=tester -v ./ctcccloud_cdn_test.go -args \
--CTCCCLOUDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDCDN_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go b/pkg/core/deployer/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go
rename to pkg/core/deployer/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go
index 0e6166334..be0051569 100644
--- a/pkg/core/deployer/providers/ctcccloud-lvdn/ctcccloud_lvdn_test.go
+++ b/pkg/core/deployer/providers-tester/ctcccloud-lvdn/ctcccloud_lvdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ctcccloudlvdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ctcccloud-lvdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("CTCCCLOUDLVDN_")
+ fp = tester.InitArgs("CTCCCLOUDLVDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ctcccloud_lvdn_test.go -args \
+ go test -tags=tester -v ./ctcccloud_lvdn_test.go -args \
--CTCCCLOUDLVDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--CTCCCLOUDLVDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--CTCCCLOUDLVDN_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers-tester/dogecloud-cdn/dogecloud_cdn_test.go b/pkg/core/deployer/providers-tester/dogecloud-cdn/dogecloud_cdn_test.go
new file mode 100644
index 000000000..f6c41ac89
--- /dev/null
+++ b/pkg/core/deployer/providers-tester/dogecloud-cdn/dogecloud_cdn_test.go
@@ -0,0 +1,54 @@
+//go:build tester
+
+package dogecloudcdn_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
+ impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/dogecloud-cdn"
+)
+
+var (
+ fp = tester.InitArgs("DOGECLOUDCDN_")
+ fTestCertPath string
+ fTestKeyPath string
+ fAccessKey string
+ fSecretKey string
+ fDomain string
+)
+
+func init() {
+ fp.DefineString(&fTestCertPath, "TESTCERTPATH")
+ fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
+ fp.DefineString(&fAccessKey, "ACCESSKEY")
+ fp.DefineString(&fSecretKey, "SECRETKEY")
+ fp.DefineString(&fDomain, "DOMAIN")
+}
+
+/*
+Shell command to run this test:
+
+ go test -tags=tester -v ./dogecloud_cdn_test.go -args \
+ --DOGECLOUDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
+ --DOGECLOUDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
+ --DOGECLOUDCDN_ACCESSKEY="your-access-key" \
+ --DOGECLOUDCDN_SECRETKEY="your-secret-key" \
+ --DOGECLOUDCDN_DOMAIN="example.com"
+*/
+func TestProvider(t *testing.T) {
+ fp.Parse()
+
+ t.Run("Deploy", func(t *testing.T) {
+ provider, err := impl.NewDeployer(&impl.DeployerConfig{
+ AccessKey: fAccessKey,
+ SecretKey: fSecretKey,
+ Domain: fDomain,
+ })
+ require.NoError(t, err)
+
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ })
+}
diff --git a/pkg/core/deployer/providers/flexcdn/flexcdn_test.go b/pkg/core/deployer/providers-tester/flexcdn/flexcdn_test.go
similarity index 83%
rename from pkg/core/deployer/providers/flexcdn/flexcdn_test.go
rename to pkg/core/deployer/providers-tester/flexcdn/flexcdn_test.go
index 128cd10a7..31fd9ef37 100644
--- a/pkg/core/deployer/providers/flexcdn/flexcdn_test.go
+++ b/pkg/core/deployer/providers-tester/flexcdn/flexcdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package flexcdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/flexcdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("FLEXCDN_")
+ fp = tester.InitArgs("FLEXCDN_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./flexcdn_test.go -args \
+ go test -tags=tester -v ./flexcdn_test.go -args \
--FLEXCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--FLEXCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--FLEXCDN_SERVERURL="http://127.0.0.1:7788" \
@@ -54,6 +56,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/flyio/flyio_test.go b/pkg/core/deployer/providers-tester/flyio/flyio_test.go
similarity index 77%
rename from pkg/core/deployer/providers/flyio/flyio_test.go
rename to pkg/core/deployer/providers-tester/flyio/flyio_test.go
index c22f7cb73..952715b7a 100644
--- a/pkg/core/deployer/providers/flyio/flyio_test.go
+++ b/pkg/core/deployer/providers-tester/flyio/flyio_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package flyio_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/flyio"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("FLYIO_")
+ fp = tester.InitArgs("FLYIO_")
fTestCertPath string
fTestKeyPath string
fApiToken string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./flyio_test.go -args \
+ go test -tags=tester -v ./flyio_test.go -args \
--FLYIO_TESTCERTPATH="/path/to/your-test-cert.pem" \
--FLYIO_TESTKEYPATH="/path/to/your-test-key.pem" \
--FLYIO_APITOKEN="your-api-token" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ftp/ftp_test.go b/pkg/core/deployer/providers-tester/ftp/ftp_test.go
similarity index 84%
rename from pkg/core/deployer/providers/ftp/ftp_test.go
rename to pkg/core/deployer/providers-tester/ftp/ftp_test.go
index db0c8273b..cbace5f73 100644
--- a/pkg/core/deployer/providers/ftp/ftp_test.go
+++ b/pkg/core/deployer/providers-tester/ftp/ftp_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ftp_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ftp"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("FTP_")
+ fp = tester.InitArgs("FTP_")
fTestCertPath string
fTestKeyPath string
fFtpHost string
@@ -35,7 +37,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ftp_test.go -args \
+ go test -tags=tester -v ./ftp_test.go -args \
--FTP_TESTCERTPATH="/path/to/your-test-cert.pem" \
--FTP_TESTKEYPATH="/path/to/your-test-key.pem" \
--FTP_FTPHOST="localhost" \
@@ -60,6 +62,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/gcore-cdn/gcore_cdn_test.go b/pkg/core/deployer/providers-tester/gcore-cdn/gcore_cdn_test.go
similarity index 76%
rename from pkg/core/deployer/providers/gcore-cdn/gcore_cdn_test.go
rename to pkg/core/deployer/providers-tester/gcore-cdn/gcore_cdn_test.go
index 4c114296a..6003f0c40 100644
--- a/pkg/core/deployer/providers/gcore-cdn/gcore_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/gcore-cdn/gcore_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package gcorecdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/gcore-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("GCORECDN_")
+ fp = tester.InitArgs("GCORECDN_")
fTestCertPath string
fTestKeyPath string
fApiToken string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./gcore_cdn_test.go -args \
+ go test -tags=tester -v ./gcore_cdn_test.go -args \
--GCORECDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--GCORECDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--GCORECDN_APITOKEN="your-api-token" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/goedge/goedge_test.go b/pkg/core/deployer/providers-tester/goedge/goedge_test.go
similarity index 83%
rename from pkg/core/deployer/providers/goedge/goedge_test.go
rename to pkg/core/deployer/providers-tester/goedge/goedge_test.go
index 65c34ff85..9369bf737 100644
--- a/pkg/core/deployer/providers/goedge/goedge_test.go
+++ b/pkg/core/deployer/providers-tester/goedge/goedge_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package goedge_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/goedge"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("GOEDGE_")
+ fp = tester.InitArgs("GOEDGE_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./goedge_test.go -args \
+ go test -tags=tester -v ./goedge_test.go -args \
--GOEDGE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--GOEDGE_TESTKEYPATH="/path/to/your-test-key.pem" \
--GOEDGE_SERVERURL="http://127.0.0.1:7788" \
@@ -54,6 +56,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/huaweicloud-aad/huaweicloud_aad_test.go b/pkg/core/deployer/providers-tester/huaweicloud-aad/huaweicloud_aad_test.go
similarity index 81%
rename from pkg/core/deployer/providers/huaweicloud-aad/huaweicloud_aad_test.go
rename to pkg/core/deployer/providers-tester/huaweicloud-aad/huaweicloud_aad_test.go
index 32936f96c..e05877f0f 100644
--- a/pkg/core/deployer/providers/huaweicloud-aad/huaweicloud_aad_test.go
+++ b/pkg/core/deployer/providers-tester/huaweicloud-aad/huaweicloud_aad_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package huaweicloudaad_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-aad"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("HUAWEICLOUDAAD_")
+ fp = tester.InitArgs("HUAWEICLOUDAAD_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./huaweicloud_aad_test.go -args \
+ go test -tags=tester -v ./huaweicloud_aad_test.go -args \
--HUAWEICLOUDAAD_TESTCERTPATH="/path/to/your-test-cert.pem" \
--HUAWEICLOUDAAD_TESTKEYPATH="/path/to/your-test-key.pem" \
--HUAWEICLOUDAAD_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/huaweicloud-apig/huaweicloud_apig_test.go b/pkg/core/deployer/providers-tester/huaweicloud-apig/huaweicloud_apig_test.go
similarity index 81%
rename from pkg/core/deployer/providers/huaweicloud-apig/huaweicloud_apig_test.go
rename to pkg/core/deployer/providers-tester/huaweicloud-apig/huaweicloud_apig_test.go
index 3cf151190..5dc112abc 100644
--- a/pkg/core/deployer/providers/huaweicloud-apig/huaweicloud_apig_test.go
+++ b/pkg/core/deployer/providers-tester/huaweicloud-apig/huaweicloud_apig_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package huaweicloudapig_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-apig"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("HUAWEICLOUDAPIG_")
+ fp = tester.InitArgs("HUAWEICLOUDAPIG_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./huaweicloud_apig_test.go -args \
+ go test -tags=tester -v ./huaweicloud_apig_test.go -args \
--HUAWEICLOUDAPIG_TESTCERTPATH="/path/to/your-test-cert.pem" \
--HUAWEICLOUDAPIG_TESTKEYPATH="/path/to/your-test-key.pem" \
--HUAWEICLOUDAPIG_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/huaweicloud-cdn/huaweicloud_cdn_test.go b/pkg/core/deployer/providers-tester/huaweicloud-cdn/huaweicloud_cdn_test.go
similarity index 81%
rename from pkg/core/deployer/providers/huaweicloud-cdn/huaweicloud_cdn_test.go
rename to pkg/core/deployer/providers-tester/huaweicloud-cdn/huaweicloud_cdn_test.go
index 61b48373a..2deb2ae5f 100644
--- a/pkg/core/deployer/providers/huaweicloud-cdn/huaweicloud_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/huaweicloud-cdn/huaweicloud_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package huaweicloudcdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("HUAWEICLOUDCDN_")
+ fp = tester.InitArgs("HUAWEICLOUDCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./huaweicloud_cdn_test.go -args \
+ go test -tags=tester -v ./huaweicloud_cdn_test.go -args \
--HUAWEICLOUDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--HUAWEICLOUDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--HUAWEICLOUDCDN_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/huaweicloud-elb/huaweicloud_elb_test.go b/pkg/core/deployer/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go
similarity index 82%
rename from pkg/core/deployer/providers/huaweicloud-elb/huaweicloud_elb_test.go
rename to pkg/core/deployer/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go
index 3091213d7..fbf1fa449 100644
--- a/pkg/core/deployer/providers/huaweicloud-elb/huaweicloud_elb_test.go
+++ b/pkg/core/deployer/providers-tester/huaweicloud-elb/huaweicloud_elb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package huaweicloudelb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-elb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("HUAWEICLOUDELB_")
+ fp = tester.InitArgs("HUAWEICLOUDELB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -35,7 +37,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./huaweicloud_elb_test.go -args \
+ go test -tags=tester -v ./huaweicloud_elb_test.go -args \
--HUAWEICLOUDELB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--HUAWEICLOUDELB_TESTKEYPATH="/path/to/your-test-key.pem" \
--HUAWEICLOUDELB_ACCESSKEYID="your-access-key-id" \
@@ -58,7 +60,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToListenerId", func(t *testing.T) {
@@ -71,7 +73,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToCertificate", func(t *testing.T) {
@@ -84,6 +86,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/huaweicloud-live/huaweicloud_live_test.go b/pkg/core/deployer/providers-tester/huaweicloud-live/huaweicloud_live_test.go
similarity index 81%
rename from pkg/core/deployer/providers/huaweicloud-live/huaweicloud_live_test.go
rename to pkg/core/deployer/providers-tester/huaweicloud-live/huaweicloud_live_test.go
index 8b21aa283..996e4c150 100644
--- a/pkg/core/deployer/providers/huaweicloud-live/huaweicloud_live_test.go
+++ b/pkg/core/deployer/providers-tester/huaweicloud-live/huaweicloud_live_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package huaweicloudlive_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-live"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("HUAWEICLOUDLIVE_")
+ fp = tester.InitArgs("HUAWEICLOUDLIVE_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./huaweicloud_live_test.go -args \
+ go test -tags=tester -v ./huaweicloud_live_test.go -args \
--HUAWEICLOUDLIVE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--HUAWEICLOUDLIVE_TESTKEYPATH="/path/to/your-test-key.pem" \
--HUAWEICLOUDLIVE_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/huaweicloud-obs/huaweicloud_obs_test.go b/pkg/core/deployer/providers-tester/huaweicloud-obs/huaweicloud_obs_test.go
similarity index 82%
rename from pkg/core/deployer/providers/huaweicloud-obs/huaweicloud_obs_test.go
rename to pkg/core/deployer/providers-tester/huaweicloud-obs/huaweicloud_obs_test.go
index 67f87ffa7..05ce366c6 100644
--- a/pkg/core/deployer/providers/huaweicloud-obs/huaweicloud_obs_test.go
+++ b/pkg/core/deployer/providers-tester/huaweicloud-obs/huaweicloud_obs_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package huaweicloudobs_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-obs"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("HUAWEICLOUDOBS_")
+ fp = tester.InitArgs("HUAWEICLOUDOBS_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./huaweicloud_obs_test.go -args \
+ go test -tags=tester -v ./huaweicloud_obs_test.go -args \
--HUAWEICLOUDOBS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--HUAWEICLOUDOBS_TESTKEYPATH="/path/to/your-test-key.pem" \
--HUAWEICLOUDOBS_ACCESSKEYID="your-access-key-id" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/huaweicloud-vod/huaweicloud_vod_test.go b/pkg/core/deployer/providers-tester/huaweicloud-vod/huaweicloud_vod_test.go
similarity index 81%
rename from pkg/core/deployer/providers/huaweicloud-vod/huaweicloud_vod_test.go
rename to pkg/core/deployer/providers-tester/huaweicloud-vod/huaweicloud_vod_test.go
index 6aa71e676..1d28836e9 100644
--- a/pkg/core/deployer/providers/huaweicloud-vod/huaweicloud_vod_test.go
+++ b/pkg/core/deployer/providers-tester/huaweicloud-vod/huaweicloud_vod_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package huaweicloudvod_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-vod"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("HUAWEICLOUDVOD_")
+ fp = tester.InitArgs("HUAWEICLOUDVOD_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./huaweicloud_vod_test.go -args \
+ go test -tags=tester -v ./huaweicloud_vod_test.go -args \
--HUAWEICLOUDVOD_TESTCERTPATH="/path/to/your-test-cert.pem" \
--HUAWEICLOUDVOD_TESTKEYPATH="/path/to/your-test-key.pem" \
--HUAWEICLOUDVOD_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/huaweicloud-waf/huaweicloud_waf_test.go b/pkg/core/deployer/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go
similarity index 81%
rename from pkg/core/deployer/providers/huaweicloud-waf/huaweicloud_waf_test.go
rename to pkg/core/deployer/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go
index d7a666b6f..dd04eba4d 100644
--- a/pkg/core/deployer/providers/huaweicloud-waf/huaweicloud_waf_test.go
+++ b/pkg/core/deployer/providers-tester/huaweicloud-waf/huaweicloud_waf_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package huaweicloudwaf_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweicloud-waf"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("HUAWEICLOUDWAF_")
+ fp = tester.InitArgs("HUAWEICLOUDWAF_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./huaweicloud_waf_test.go -args \
+ go test -tags=tester -v ./huaweicloud_waf_test.go -args \
--HUAWEICLOUDWAF_TESTCERTPATH="/path/to/your-test-cert.pem" \
--HUAWEICLOUDWAF_TESTKEYPATH="/path/to/your-test-key.pem" \
--HUAWEICLOUDWAF_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers-tester/huaweiibmc/huaweiibmc_test.go b/pkg/core/deployer/providers-tester/huaweiibmc/huaweiibmc_test.go
new file mode 100644
index 000000000..3e50e9127
--- /dev/null
+++ b/pkg/core/deployer/providers-tester/huaweiibmc/huaweiibmc_test.go
@@ -0,0 +1,55 @@
+//go:build tester
+
+package huaweiibmc_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
+ impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/huaweiibmc"
+)
+
+var (
+ fp = tester.InitArgs("HUAWEIIBMC_")
+ fTestCertPath string
+ fTestKeyPath string
+ fHost string
+ fUsername string
+ fPassword string
+)
+
+func init() {
+ fp.DefineString(&fTestCertPath, "TESTCERTPATH")
+ fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
+ fp.DefineString(&fHost, "HOST")
+ fp.DefineString(&fUsername, "USERNAME")
+ fp.DefineString(&fPassword, "PASSWORD")
+}
+
+/*
+Shell command to run this test:
+
+ go test -tags=tester -v ./huaweiibmc_test.go -args \
+ --HUAWEIIBMC_TESTCERTPATH="/path/to/your-test-cert.pem" \
+ --HUAWEIIBMC_TESTKEYPATH="/path/to/your-test-key.pem" \
+ --HUAWEIIBMC_HOST="localhost" \
+ --HUAWEIIBMC_USERNAME="admin" \
+ --HUAWEIIBMC_PASSWORD="password"
+*/
+func TestProvider(t *testing.T) {
+ fp.Parse()
+
+ t.Run("Deploy", func(t *testing.T) {
+ provider, err := impl.NewDeployer(&impl.DeployerConfig{
+ Host: fHost,
+ Username: fUsername,
+ Password: fPassword,
+ AutoRestart: true,
+ })
+ require.NoError(t, err)
+
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ })
+}
diff --git a/pkg/core/deployer/providers/jdcloud-alb/jdcloud_alb_test.go b/pkg/core/deployer/providers-tester/jdcloud-alb/jdcloud_alb_test.go
similarity index 82%
rename from pkg/core/deployer/providers/jdcloud-alb/jdcloud_alb_test.go
rename to pkg/core/deployer/providers-tester/jdcloud-alb/jdcloud_alb_test.go
index dac86be63..98668cdc2 100644
--- a/pkg/core/deployer/providers/jdcloud-alb/jdcloud_alb_test.go
+++ b/pkg/core/deployer/providers-tester/jdcloud-alb/jdcloud_alb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package jdcloudalb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/jdcloud-alb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("JDCLOUDALB_")
+ fp = tester.InitArgs("JDCLOUDALB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./jdcloud_alb_test.go -args \
+ go test -tags=tester -v ./jdcloud_alb_test.go -args \
--JDCLOUDALB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--JDCLOUDALB_TESTKEYPATH="/path/to/your-test-key.pem" \
--JDCLOUDALB_ACCESSKEYID="your-access-key-id" \
@@ -55,7 +57,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToListener", func(t *testing.T) {
@@ -68,6 +70,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/jdcloud-cdn/jdcloud_cdn_test.go b/pkg/core/deployer/providers-tester/jdcloud-cdn/jdcloud_cdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/jdcloud-cdn/jdcloud_cdn_test.go
rename to pkg/core/deployer/providers-tester/jdcloud-cdn/jdcloud_cdn_test.go
index 014018d5d..606451dae 100644
--- a/pkg/core/deployer/providers/jdcloud-cdn/jdcloud_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/jdcloud-cdn/jdcloud_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package jdcloudcdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/jdcloud-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("JDCLOUDCDN_")
+ fp = tester.InitArgs("JDCLOUDCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./jdcloud_cdn_test.go -args \
+ go test -tags=tester -v ./jdcloud_cdn_test.go -args \
--JDCLOUDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--JDCLOUDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--JDCLOUDCDN_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/jdcloud-live/jdcloud_live_test.go b/pkg/core/deployer/providers-tester/jdcloud-live/jdcloud_live_test.go
similarity index 79%
rename from pkg/core/deployer/providers/jdcloud-live/jdcloud_live_test.go
rename to pkg/core/deployer/providers-tester/jdcloud-live/jdcloud_live_test.go
index 4a79c665a..9f11fbc70 100644
--- a/pkg/core/deployer/providers/jdcloud-live/jdcloud_live_test.go
+++ b/pkg/core/deployer/providers-tester/jdcloud-live/jdcloud_live_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package jdcloudlive_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/jdcloud-live"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("JDCLOUDLIVE_")
+ fp = tester.InitArgs("JDCLOUDLIVE_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./jdcloud_live_test.go -args \
+ go test -tags=tester -v ./jdcloud_live_test.go -args \
--JDCLOUDLIVE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--JDCLOUDLIVE_TESTKEYPATH="/path/to/your-test-key.pem" \
--JDCLOUDLIVE_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/jdcloud-vod/jdcloud_vod_test.go b/pkg/core/deployer/providers-tester/jdcloud-vod/jdcloud_vod_test.go
similarity index 79%
rename from pkg/core/deployer/providers/jdcloud-vod/jdcloud_vod_test.go
rename to pkg/core/deployer/providers-tester/jdcloud-vod/jdcloud_vod_test.go
index 952bc89cf..6405f525b 100644
--- a/pkg/core/deployer/providers/jdcloud-vod/jdcloud_vod_test.go
+++ b/pkg/core/deployer/providers-tester/jdcloud-vod/jdcloud_vod_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package jdcloudvod_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/jdcloud-vod"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("JDCLOUDVOD_")
+ fp = tester.InitArgs("JDCLOUDVOD_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./jdcloud_vod_test.go -args \
+ go test -tags=tester -v ./jdcloud_vod_test.go -args \
--JDCLOUDVOD_TESTCERTPATH="/path/to/your-test-cert.pem" \
--JDCLOUDVOD_TESTKEYPATH="/path/to/your-test-key.pem" \
--JDCLOUDVOD_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/jdcloud-waf/jdcloud_waf_test.go b/pkg/core/deployer/providers-tester/jdcloud-waf/jdcloud_waf_test.go
similarity index 81%
rename from pkg/core/deployer/providers/jdcloud-waf/jdcloud_waf_test.go
rename to pkg/core/deployer/providers-tester/jdcloud-waf/jdcloud_waf_test.go
index 743ca880d..08269897a 100644
--- a/pkg/core/deployer/providers/jdcloud-waf/jdcloud_waf_test.go
+++ b/pkg/core/deployer/providers-tester/jdcloud-waf/jdcloud_waf_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package jdcloudwaf_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/jdcloud-waf"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("JDCLOUDWAF_")
+ fp = tester.InitArgs("JDCLOUDWAF_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./jdcloud_waf_test.go -args \
+ go test -tags=tester -v ./jdcloud_waf_test.go -args \
--JDCLOUDWAF_TESTCERTPATH="/path/to/your-test-cert.pem" \
--JDCLOUDWAF_TESTKEYPATH="/path/to/your-test-key.pem" \
--JDCLOUDWAF_ACCESSKEYID="your-access-key-id" \
@@ -51,6 +53,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers-tester/k8s-secret/k8s_secret_test.go b/pkg/core/deployer/providers-tester/k8s-secret/k8s_secret_test.go
new file mode 100644
index 000000000..71f42b2e5
--- /dev/null
+++ b/pkg/core/deployer/providers-tester/k8s-secret/k8s_secret_test.go
@@ -0,0 +1,68 @@
+//go:build tester
+
+package k8ssecret_test
+
+import (
+ "os"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
+ impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/k8s-secret"
+)
+
+var (
+ fp = tester.InitArgs("K8SSECRET_")
+ fTestCertPath string
+ fTestKeyPath string
+ fKubeConfig string
+ fNamespace string
+ fSecretName string
+ fSecretDataKeyForCrt string
+ fSecretDataKeyForKey string
+)
+
+func init() {
+ fp.DefineString(&fTestCertPath, "TESTCERTPATH")
+ fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
+ fp.DefineString(&fKubeConfig, "KUBECONFIG")
+ fp.DefineString(&fNamespace, "NAMESPACE", "default")
+ fp.DefineString(&fSecretName, "SECRETNAME")
+ fp.DefineString(&fSecretDataKeyForCrt, "SECRETDATAKEYFORCRT", "tls.crt")
+ fp.DefineString(&fSecretDataKeyForKey, "SECRETDATAKEYFORKEY", "tls.key")
+}
+
+/*
+Shell command to run this test:
+
+ go test -tags=tester -v ./k8s_secret_test.go -args \
+ --K8SSECRET_TESTCERTPATH="/path/to/your-test-cert.pem" \
+ --K8SSECRET_TESTKEYPATH="/path/to/your-test-key.pem" \
+ --K8SSECRET_KUBECONFIG="..." \
+ --K8SSECRET_NAMESPACE="default" \
+ --K8SSECRET_SECRETNAME="secret" \
+ --K8SSECRET_SECRETDATAKEYFORCRT="tls.crt" \
+ --K8SSECRET_SECRETDATAKEYFORKEY="tls.key"
+*/
+func TestProvider(t *testing.T) {
+ fp.Parse()
+
+ if fKubeConfigStat, err := os.Stat(fKubeConfig); err == nil && !fKubeConfigStat.IsDir() {
+ fKubeConfigBytes, _ := os.ReadFile(fKubeConfig)
+ fKubeConfig = string(fKubeConfigBytes)
+ }
+
+ t.Run("Deploy", func(t *testing.T) {
+ provider, err := impl.NewDeployer(&impl.DeployerConfig{
+ KubeConfig: fKubeConfig,
+ Namespace: fNamespace,
+ SecretName: fSecretName,
+ SecretDataKeyForCrt: fSecretDataKeyForCrt,
+ SecretDataKeyForKey: fSecretDataKeyForKey,
+ })
+ require.NoError(t, err)
+
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ })
+}
diff --git a/pkg/core/deployer/providers/kong/kong_test.go b/pkg/core/deployer/providers-tester/kong/kong_test.go
similarity index 80%
rename from pkg/core/deployer/providers/kong/kong_test.go
rename to pkg/core/deployer/providers-tester/kong/kong_test.go
index dca330d69..db856d441 100644
--- a/pkg/core/deployer/providers/kong/kong_test.go
+++ b/pkg/core/deployer/providers-tester/kong/kong_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package kong_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/kong"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("KONG_")
+ fp = tester.InitArgs("KONG_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./kong_test.go -args \
+ go test -tags=tester -v ./kong_test.go -args \
--KONG_TESTCERTPATH="/path/to/your-test-cert.pem" \
--KONG_TESTKEYPATH="/path/to/your-test-key.pem" \
--KONG_SERVERURL="http://127.0.0.1:9080" \
@@ -49,6 +51,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ksyun-cdn/ksyun_cdn_test.go b/pkg/core/deployer/providers-tester/ksyun-cdn/ksyun_cdn_test.go
similarity index 80%
rename from pkg/core/deployer/providers/ksyun-cdn/ksyun_cdn_test.go
rename to pkg/core/deployer/providers-tester/ksyun-cdn/ksyun_cdn_test.go
index 1fea31028..1f988c872 100644
--- a/pkg/core/deployer/providers/ksyun-cdn/ksyun_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/ksyun-cdn/ksyun_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ksyuncdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ksyun-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("KSYUNCDN_")
+ fp = tester.InitArgs("KSYUNCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ksyun_cdn_test.go -args \
+ go test -tags=tester -v ./ksyun_cdn_test.go -args \
--KSYUNCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--KSYUNCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--KSYUNCDN_ACCESSKEYID="your-access-key-id" \
@@ -52,7 +54,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToCertificate", func(t *testing.T) {
@@ -64,6 +66,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ksyun-slb/ksyun_slb_test.go b/pkg/core/deployer/providers-tester/ksyun-slb/ksyun_slb_test.go
similarity index 81%
rename from pkg/core/deployer/providers/ksyun-slb/ksyun_slb_test.go
rename to pkg/core/deployer/providers-tester/ksyun-slb/ksyun_slb_test.go
index 05037db6c..e93745b81 100644
--- a/pkg/core/deployer/providers/ksyun-slb/ksyun_slb_test.go
+++ b/pkg/core/deployer/providers-tester/ksyun-slb/ksyun_slb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ksyunslb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ksyun-slb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("KSYUNSLB_")
+ fp = tester.InitArgs("KSYUNSLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ksyun_slb_test.go -args \
+ go test -tags=tester -v ./ksyun_slb_test.go -args \
--KSYUNSLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--KSYUNSLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--KSYUNSLB_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/lecdn/lecdn_test.go b/pkg/core/deployer/providers-tester/lecdn/lecdn_test.go
similarity index 84%
rename from pkg/core/deployer/providers/lecdn/lecdn_test.go
rename to pkg/core/deployer/providers-tester/lecdn/lecdn_test.go
index 32b960d7c..9266f94fb 100644
--- a/pkg/core/deployer/providers/lecdn/lecdn_test.go
+++ b/pkg/core/deployer/providers-tester/lecdn/lecdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package lecdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/lecdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("LECDN_")
+ fp = tester.InitArgs("LECDN_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./lecdn_test.go -args \
+ go test -tags=tester -v ./lecdn_test.go -args \
--LECDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--LECDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--LECDN_SERVERURL="http://127.0.0.1:5090" \
@@ -57,6 +59,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/linode-los/linode_los_test.go b/pkg/core/deployer/providers-tester/linode-los/linode_los_test.go
similarity index 78%
rename from pkg/core/deployer/providers/linode-los/linode_los_test.go
rename to pkg/core/deployer/providers-tester/linode-los/linode_los_test.go
index 254ce85a1..88f223bd4 100644
--- a/pkg/core/deployer/providers/linode-los/linode_los_test.go
+++ b/pkg/core/deployer/providers-tester/linode-los/linode_los_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package linodelos_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/linode-los"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("LINODELOS_")
+ fp = tester.InitArgs("LINODELOS_")
fTestCertPath string
fTestKeyPath string
fApiToken string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./linode_los_test.go -args \
+ go test -tags=tester -v ./linode_los_test.go -args \
--LINODELOS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--LINODELOS_TESTKEYPATH="/path/to/your-test-key.pem" \
--LINODELOS_ACCESSTOKEN="your-api-token" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/local/local_test.go b/pkg/core/deployer/providers-tester/local/local_test.go
similarity index 84%
rename from pkg/core/deployer/providers/local/local_test.go
rename to pkg/core/deployer/providers-tester/local/local_test.go
index 46b079aae..9c351ce12 100644
--- a/pkg/core/deployer/providers/local/local_test.go
+++ b/pkg/core/deployer/providers-tester/local/local_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package local_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/local"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("LOCAL_")
+ fp = tester.InitArgs("LOCAL_")
fTestCertPath string
fTestKeyPath string
fFilePathForCrt string
@@ -43,7 +45,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./local_test.go -args \
+ go test -tags=tester -v ./local_test.go -args \
--LOCAL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--LOCAL_TESTKEYPATH="/path/to/your-test-key.pem" \
--LOCAL_FILEPATHFORCRT="/path/to/your-output-cert" \
@@ -71,7 +73,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_PFX", func(t *testing.T) {
@@ -83,7 +85,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_JKS", func(t *testing.T) {
@@ -96,6 +98,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/mohua-mvh/mohua_mvh_test.go b/pkg/core/deployer/providers-tester/mohua-mvh/mohua_mvh_test.go
similarity index 80%
rename from pkg/core/deployer/providers/mohua-mvh/mohua_mvh_test.go
rename to pkg/core/deployer/providers-tester/mohua-mvh/mohua_mvh_test.go
index e9797dedf..ff20027af 100644
--- a/pkg/core/deployer/providers/mohua-mvh/mohua_mvh_test.go
+++ b/pkg/core/deployer/providers-tester/mohua-mvh/mohua_mvh_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package mohuamvh_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/mohua-mvh"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("MOHUAMVH_")
+ fp = tester.InitArgs("MOHUAMVH_")
fTestCertPath string
fTestKeyPath string
fUsername string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./mohuamvh_test.go -args \
+ go test -tags=tester -v ./mohuamvh_test.go -args \
--MOHUAMVH_TESTCERTPATH="/path/to/your-test-cert.pem" \
--MOHUAMVH_TESTKEYPATH="/path/to/your-test-key.pem" \
--MOHUAMVH_USERNAME="your-username" \
@@ -51,6 +53,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/netlify/netlify_test.go b/pkg/core/deployer/providers-tester/netlify/netlify_test.go
similarity index 76%
rename from pkg/core/deployer/providers/netlify/netlify_test.go
rename to pkg/core/deployer/providers-tester/netlify/netlify_test.go
index 079752e2b..fa519aabf 100644
--- a/pkg/core/deployer/providers/netlify/netlify_test.go
+++ b/pkg/core/deployer/providers-tester/netlify/netlify_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package netlify_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/netlify"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("NETLIFY_")
+ fp = tester.InitArgs("NETLIFY_")
fTestCertPath string
fTestKeyPath string
fApiToken string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./netlify_test.go -args \
+ go test -tags=tester -v ./netlify_test.go -args \
--NETLIFY_TESTCERTPATH="/path/to/your-test-cert.pem" \
--NETLIFY_TESTKEYPATH="/path/to/your-test-key.pem" \
--NETLIFY_APITOKEN="your-api-token" \
@@ -44,6 +46,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/nginxproxymanager/nginxproxymanager_test.go b/pkg/core/deployer/providers-tester/nginxproxymanager/nginxproxymanager_test.go
similarity index 83%
rename from pkg/core/deployer/providers/nginxproxymanager/nginxproxymanager_test.go
rename to pkg/core/deployer/providers-tester/nginxproxymanager/nginxproxymanager_test.go
index 2a39a81e9..ce6f39c0e 100644
--- a/pkg/core/deployer/providers/nginxproxymanager/nginxproxymanager_test.go
+++ b/pkg/core/deployer/providers-tester/nginxproxymanager/nginxproxymanager_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package nginxproxymanager_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/nginxproxymanager"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("NGINXPROXYMANAGER_")
+ fp = tester.InitArgs("NGINXPROXYMANAGER_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -32,7 +34,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./nginxproxymanager_test.go -args \
+ go test -tags=tester -v ./nginxproxymanager_test.go -args \
--NGINXPROXYMANAGER_TESTCERTPATH="/path/to/your-test-cert.pem" \
--NGINXPROXYMANAGER_TESTKEYPATH="/path/to/your-test-key.pem" \
--NGINXPROXYMANAGER_SERVERURL="http://127.0.0.1:20410" \
@@ -58,6 +60,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers-tester/proxmoxbs/proxmoxbs_test.go b/pkg/core/deployer/providers-tester/proxmoxbs/proxmoxbs_test.go
new file mode 100644
index 000000000..8d32d4407
--- /dev/null
+++ b/pkg/core/deployer/providers-tester/proxmoxbs/proxmoxbs_test.go
@@ -0,0 +1,60 @@
+//go:build tester
+
+package proxmoxbs_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
+ impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/proxmoxbs"
+)
+
+var (
+ fp = tester.InitArgs("PROXMOXBS_")
+ fTestCertPath string
+ fTestKeyPath string
+ fServerUrl string
+ fApiToken string
+ fApiTokenSecret string
+ fNodeName string
+)
+
+func init() {
+ fp.DefineString(&fTestCertPath, "TESTCERTPATH")
+ fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
+ fp.DefineString(&fServerUrl, "SERVERURL")
+ fp.DefineString(&fApiToken, "APITOKEN")
+ fp.DefineString(&fApiTokenSecret, "APITOKENSECRET")
+ fp.DefineString(&fNodeName, "NODENAME")
+}
+
+/*
+Shell command to run this test:
+
+ go test -tags=tester -v ./proxmoxbs_test.go -args \
+ --PROXMOXBS_TESTCERTPATH="/path/to/your-test-cert.pem" \
+ --PROXMOXBS_TESTKEYPATH="/path/to/your-test-key.pem" \
+ --PROXMOXBS_SERVERURL="http://127.0.0.1:8007" \
+ --PROXMOXBS_APITOKEN="your-api-token" \
+ --PROXMOXBS_APITOKENSECRET="your-api-token-secret" \
+ --PROXMOXBS_NODENAME="your-node-name"
+*/
+func TestProvider(t *testing.T) {
+ fp.Parse()
+
+ t.Run("Deploy", func(t *testing.T) {
+ provider, err := impl.NewDeployer(&impl.DeployerConfig{
+ ServerUrl: fServerUrl,
+ ApiToken: fApiToken,
+ ApiTokenSecret: fApiTokenSecret,
+ AllowInsecureConnections: true,
+ NodeName: fNodeName,
+ AutoRestart: true,
+ })
+ require.NoError(t, err)
+
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ })
+}
diff --git a/pkg/core/deployer/providers/proxmoxve/proxmoxve_test.go b/pkg/core/deployer/providers-tester/proxmoxve/proxmoxve_test.go
similarity index 82%
rename from pkg/core/deployer/providers/proxmoxve/proxmoxve_test.go
rename to pkg/core/deployer/providers-tester/proxmoxve/proxmoxve_test.go
index d6e63dd47..be0a7530f 100644
--- a/pkg/core/deployer/providers/proxmoxve/proxmoxve_test.go
+++ b/pkg/core/deployer/providers-tester/proxmoxve/proxmoxve_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package proxmoxve_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/proxmoxve"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("PROXMOXVE_")
+ fp = tester.InitArgs("PROXMOXVE_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./proxmoxve_test.go -args \
+ go test -tags=tester -v ./proxmoxve_test.go -args \
--PROXMOXVE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--PROXMOXVE_TESTKEYPATH="/path/to/your-test-key.pem" \
--PROXMOXVE_SERVERURL="http://127.0.0.1:8006" \
@@ -53,6 +55,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/qingcloud-lb/qingcloud_lb_test.go b/pkg/core/deployer/providers-tester/qingcloud-lb/qingcloud_lb_test.go
similarity index 82%
rename from pkg/core/deployer/providers/qingcloud-lb/qingcloud_lb_test.go
rename to pkg/core/deployer/providers-tester/qingcloud-lb/qingcloud_lb_test.go
index db378759b..5f577e131 100644
--- a/pkg/core/deployer/providers/qingcloud-lb/qingcloud_lb_test.go
+++ b/pkg/core/deployer/providers-tester/qingcloud-lb/qingcloud_lb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package qingcloudlb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/qingcloud-lb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("QINGCLOUDLB_")
+ fp = tester.InitArgs("QINGCLOUDLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -34,7 +36,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./qingcloud_lb_test.go -args \
+ go test -tags=tester -v ./qingcloud_lb_test.go -args \
--QINGCLOUDLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--QINGCLOUDLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--QINGCLOUDLB_ACCESSKEYID="your-access-key-id" \
@@ -56,7 +58,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToListenerId", func(t *testing.T) {
@@ -69,6 +71,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers-tester/qiniu-cdn/qiniu_cdn_test.go b/pkg/core/deployer/providers-tester/qiniu-cdn/qiniu_cdn_test.go
new file mode 100644
index 000000000..097b022b2
--- /dev/null
+++ b/pkg/core/deployer/providers-tester/qiniu-cdn/qiniu_cdn_test.go
@@ -0,0 +1,55 @@
+//go:build tester
+
+package qiniucdn_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
+ impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/qiniu-cdn"
+)
+
+var (
+ fp = tester.InitArgs("QINIUCDN_")
+ fTestCertPath string
+ fTestKeyPath string
+ fAccessKey string
+ fSecretKey string
+ fDomain string
+)
+
+func init() {
+ fp.DefineString(&fTestCertPath, "TESTCERTPATH")
+ fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
+ fp.DefineString(&fAccessKey, "ACCESSKEY")
+ fp.DefineString(&fSecretKey, "SECRETKEY")
+ fp.DefineString(&fDomain, "DOMAIN")
+}
+
+/*
+Shell command to run this test:
+
+ go test -tags=tester -v ./qiniu_cdn_test.go -args \
+ --QINIUCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
+ --QINIUCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
+ --QINIUCDN_ACCESSKEY="your-access-key" \
+ --QINIUCDN_SECRETKEY="your-secret-key" \
+ --QINIUCDN_DOMAIN="example.com"
+*/
+func TestProvider(t *testing.T) {
+ fp.Parse()
+
+ t.Run("Deploy", func(t *testing.T) {
+ provider, err := impl.NewDeployer(&impl.DeployerConfig{
+ AccessKey: fAccessKey,
+ SecretKey: fSecretKey,
+ DomainMatchPattern: impl.DOMAIN_MATCH_PATTERN_EXACT,
+ Domain: fDomain,
+ })
+ require.NoError(t, err)
+
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ })
+}
diff --git a/pkg/core/deployer/providers-tester/qiniu-kodo/qiniu_kodo_test.go b/pkg/core/deployer/providers-tester/qiniu-kodo/qiniu_kodo_test.go
new file mode 100644
index 000000000..600e08584
--- /dev/null
+++ b/pkg/core/deployer/providers-tester/qiniu-kodo/qiniu_kodo_test.go
@@ -0,0 +1,58 @@
+//go:build tester
+
+package qiniukodo_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
+ impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/qiniu-kodo"
+)
+
+var (
+ fp = tester.InitArgs("QINIUKODO_")
+ fTestCertPath string
+ fTestKeyPath string
+ fAccessKey string
+ fSecretKey string
+ fBucket string
+ fDomain string
+)
+
+func init() {
+ fp.DefineString(&fTestCertPath, "TESTCERTPATH")
+ fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
+ fp.DefineString(&fAccessKey, "ACCESSKEY")
+ fp.DefineString(&fSecretKey, "SECRETKEY")
+ fp.DefineString(&fBucket, "BUCKET")
+ fp.DefineString(&fDomain, "DOMAIN")
+}
+
+/*
+Shell command to run this test:
+
+ go test -tags=tester -v ./qiniu_kodo_test.go -args \
+ --QINIUKODO_TESTCERTPATH="/path/to/your-test-cert.pem" \
+ --QINIUKODO_TESTKEYPATH="/path/to/your-test-key.pem" \
+ --QINIUKODO_ACCESSKEY="your-access-key" \
+ --QINIUKODO_SECRETKEY="your-secret-key" \
+ --QINIUKODO_BUCKET="your-bucket" \
+ --QINIUKODO_DOMAIN="example.com"
+*/
+func TestProvider(t *testing.T) {
+ fp.Parse()
+
+ t.Run("Deploy", func(t *testing.T) {
+ provider, err := impl.NewDeployer(&impl.DeployerConfig{
+ AccessKey: fAccessKey,
+ SecretKey: fSecretKey,
+ Bucket: fBucket,
+ Domain: fDomain,
+ })
+ require.NoError(t, err)
+
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ })
+}
diff --git a/pkg/core/deployer/providers-tester/qiniu-pili/qiniu_pili_test.go b/pkg/core/deployer/providers-tester/qiniu-pili/qiniu_pili_test.go
new file mode 100644
index 000000000..15a1aa1a6
--- /dev/null
+++ b/pkg/core/deployer/providers-tester/qiniu-pili/qiniu_pili_test.go
@@ -0,0 +1,58 @@
+//go:build tester
+
+package qiniupili_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
+ impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/qiniu-pili"
+)
+
+var (
+ fp = tester.InitArgs("QINIUPILI_")
+ fTestCertPath string
+ fTestKeyPath string
+ fAccessKey string
+ fSecretKey string
+ fHub string
+ fDomain string
+)
+
+func init() {
+ fp.DefineString(&fTestCertPath, "TESTCERTPATH")
+ fp.DefineString(&fTestKeyPath, "TESTKEYPATH")
+ fp.DefineString(&fAccessKey, "ACCESSKEY")
+ fp.DefineString(&fSecretKey, "SECRETKEY")
+ fp.DefineString(&fHub, "HUB")
+ fp.DefineString(&fDomain, "DOMAIN")
+}
+
+/*
+Shell command to run this test:
+
+ go test -tags=tester -v ./qiniu_pili_test.go -args \
+ --QINIUPILI_TESTCERTPATH="/path/to/your-test-cert.pem" \
+ --QINIUPILI_TESTKEYPATH="/path/to/your-test-key.pem" \
+ --QINIUPILI_ACCESSKEY="your-access-key" \
+ --QINIUPILI_SECRETKEY="your-secret-key" \
+ --QINIUPILI_HUB="your-hub-name" \
+ --QINIUPILI_DOMAIN="example.com"
+*/
+func TestProvider(t *testing.T) {
+ fp.Parse()
+
+ t.Run("Deploy", func(t *testing.T) {
+ provider, err := impl.NewDeployer(&impl.DeployerConfig{
+ AccessKey: fAccessKey,
+ SecretKey: fSecretKey,
+ DomainMatchPattern: impl.DOMAIN_MATCH_PATTERN_EXACT,
+ Domain: fDomain,
+ })
+ require.NoError(t, err)
+
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ })
+}
diff --git a/pkg/core/deployer/providers/rainyun-rcdn/rainyun_rcdn_test.go b/pkg/core/deployer/providers-tester/rainyun-rcdn/rainyun_rcdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/rainyun-rcdn/rainyun_rcdn_test.go
rename to pkg/core/deployer/providers-tester/rainyun-rcdn/rainyun_rcdn_test.go
index a567e53bf..6bcd0beab 100644
--- a/pkg/core/deployer/providers/rainyun-rcdn/rainyun_rcdn_test.go
+++ b/pkg/core/deployer/providers-tester/rainyun-rcdn/rainyun_rcdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package rainyunrcdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/rainyun-rcdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("RAINYUNRCDN_")
+ fp = tester.InitArgs("RAINYUNRCDN_")
fTestCertPath string
fTestKeyPath string
fApiKey string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./rainyun_rcdn_test.go -args \
+ go test -tags=tester -v ./rainyun_rcdn_test.go -args \
--RAINYUNRCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--RAINYUNRCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--RAINYUNRCDN_APIKEY="your-api-key" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/rainyun-sslcenter/rainyun_sslcenter_test.go b/pkg/core/deployer/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go
similarity index 72%
rename from pkg/core/deployer/providers/rainyun-sslcenter/rainyun_sslcenter_test.go
rename to pkg/core/deployer/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go
index 148c04596..2141be438 100644
--- a/pkg/core/deployer/providers/rainyun-sslcenter/rainyun_sslcenter_test.go
+++ b/pkg/core/deployer/providers-tester/rainyun-sslcenter/rainyun_sslcenter_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package rainyunsslcenter_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/rainyun-sslcenter"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("RAINYUNSSLCENTER_")
+ fp = tester.InitArgs("RAINYUNSSLCENTER_")
fTestCertPath string
fTestKeyPath string
fApiKey string
@@ -25,7 +27,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./rainyun_sslcenter_test.go -args \
+ go test -tags=tester -v ./rainyun_sslcenter_test.go -args \
--RAINYUNRCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--RAINYUNRCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--RAINYUNRCDN_APIKEY="your-api-key"
@@ -39,6 +41,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ratpanel-console/ratpanel_console_test.go b/pkg/core/deployer/providers-tester/ratpanel-console/ratpanel_console_test.go
similarity index 79%
rename from pkg/core/deployer/providers/ratpanel-console/ratpanel_console_test.go
rename to pkg/core/deployer/providers-tester/ratpanel-console/ratpanel_console_test.go
index e8235855d..48fbb9fc9 100644
--- a/pkg/core/deployer/providers/ratpanel-console/ratpanel_console_test.go
+++ b/pkg/core/deployer/providers-tester/ratpanel-console/ratpanel_console_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ratpanelconsole_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ratpanel-console"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("RATPANELCONSOLE_")
+ fp = tester.InitArgs("RATPANELCONSOLE_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ratpanel_console_test.go -args \
+ go test -tags=tester -v ./ratpanel_console_test.go -args \
--RATPANELCONSOLE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--RATPANELCONSOLE_TESTKEYPATH="/path/to/your-test-key.pem" \
--RATPANELCONSOLE_SERVERURL="http://127.0.0.1:8888" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ratpanel/ratpanel_test.go b/pkg/core/deployer/providers-tester/ratpanel/ratpanel_test.go
similarity index 82%
rename from pkg/core/deployer/providers/ratpanel/ratpanel_test.go
rename to pkg/core/deployer/providers-tester/ratpanel/ratpanel_test.go
index 3579d5414..c66a168c2 100644
--- a/pkg/core/deployer/providers/ratpanel/ratpanel_test.go
+++ b/pkg/core/deployer/providers-tester/ratpanel/ratpanel_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ratpanel_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ratpanel"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("RATPANEL_")
+ fp = tester.InitArgs("RATPANEL_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ratpanel_test.go -args \
+ go test -tags=tester -v ./ratpanel_test.go -args \
--RATPANEL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--RATPANEL_TESTKEYPATH="/path/to/your-test-key.pem" \
--RATPANEL_SERVERURL="http://127.0.0.1:8888" \
@@ -53,6 +55,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/s3/s3_test.go b/pkg/core/deployer/providers-tester/s3/s3_test.go
similarity index 85%
rename from pkg/core/deployer/providers/s3/s3_test.go
rename to pkg/core/deployer/providers-tester/s3/s3_test.go
index aec61ae83..6b237a1ff 100644
--- a/pkg/core/deployer/providers/s3/s3_test.go
+++ b/pkg/core/deployer/providers-tester/s3/s3_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package s3_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/s3"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("S3_")
+ fp = tester.InitArgs("S3_")
fTestCertPath string
fTestKeyPath string
fSshHost string
@@ -37,7 +39,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./s3_test.go -args \
+ go test -tags=tester -v ./s3_test.go -args \
--S3_TESTCERTPATH="/path/to/your-test-cert.pem" \
--S3_TESTKEYPATH="/path/to/your-test-key.pem" \
--S3_ENDPOINT="http://endpoint" \
@@ -64,6 +66,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/safeline/safeline_test.go b/pkg/core/deployer/providers-tester/safeline/safeline_test.go
similarity index 80%
rename from pkg/core/deployer/providers/safeline/safeline_test.go
rename to pkg/core/deployer/providers-tester/safeline/safeline_test.go
index 009d9913a..cf20da447 100644
--- a/pkg/core/deployer/providers/safeline/safeline_test.go
+++ b/pkg/core/deployer/providers-tester/safeline/safeline_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package safeline_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/safeline"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("SAFELINE_")
+ fp = tester.InitArgs("SAFELINE_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./safeline_test.go -args \
+ go test -tags=tester -v ./safeline_test.go -args \
--SAFELINE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--SAFELINE_TESTKEYPATH="/path/to/your-test-key.pem" \
--SAFELINE_SERVERURL="http://127.0.0.1:9443" \
@@ -49,6 +51,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/samwaf-console/samwaf_console_test.go b/pkg/core/deployer/providers-tester/samwaf-console/samwaf_console_test.go
similarity index 78%
rename from pkg/core/deployer/providers/samwaf-console/samwaf_console_test.go
rename to pkg/core/deployer/providers-tester/samwaf-console/samwaf_console_test.go
index ce179875a..554049558 100644
--- a/pkg/core/deployer/providers/samwaf-console/samwaf_console_test.go
+++ b/pkg/core/deployer/providers-tester/samwaf-console/samwaf_console_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package samwafconsole_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/samwaf-console"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("SAMWAFCONSOLE_")
+ fp = tester.InitArgs("SAMWAFCONSOLE_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./samwaf_console_test.go -args \
+ go test -tags=tester -v ./samwaf_console_test.go -args \
--SAMWAFCONSOLE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--SAMWAFCONSOLE_TESTKEYPATH="/path/to/your-test-key.pem" \
--SAMWAFCONSOLE_SERVERURL="http://127.0.0.1:26666" \
@@ -46,6 +48,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/samwaf/samwaf_test.go b/pkg/core/deployer/providers-tester/samwaf/samwaf_test.go
similarity index 80%
rename from pkg/core/deployer/providers/samwaf/samwaf_test.go
rename to pkg/core/deployer/providers-tester/samwaf/samwaf_test.go
index a2e3e0e6b..2bebb2166 100644
--- a/pkg/core/deployer/providers/samwaf/samwaf_test.go
+++ b/pkg/core/deployer/providers-tester/samwaf/samwaf_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package samwaf_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/samwaf"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("SAMWAF_")
+ fp = tester.InitArgs("SAMWAF_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./samwaf_test.go -args \
+ go test -tags=tester -v ./samwaf_test.go -args \
--SAMWAF_TESTCERTPATH="/path/to/your-test-cert.pem" \
--SAMWAF_TESTKEYPATH="/path/to/your-test-key.pem" \
--SAMWAF_SERVERURL="http://127.0.0.1:26666" \
@@ -49,6 +51,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ssh/ssh_test.go b/pkg/core/deployer/providers-tester/ssh/ssh_test.go
similarity index 84%
rename from pkg/core/deployer/providers/ssh/ssh_test.go
rename to pkg/core/deployer/providers-tester/ssh/ssh_test.go
index 633e67251..b03eb9d4d 100644
--- a/pkg/core/deployer/providers/ssh/ssh_test.go
+++ b/pkg/core/deployer/providers-tester/ssh/ssh_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ssh_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ssh"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("SSH_")
+ fp = tester.InitArgs("SSH_")
fTestCertPath string
fTestKeyPath string
fSshHost string
@@ -35,7 +37,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ssh_test.go -args \
+ go test -tags=tester -v ./ssh_test.go -args \
--SSH_TESTCERTPATH="/path/to/your-test-cert.pem" \
--SSH_TESTKEYPATH="/path/to/your-test-key.pem" \
--SSH_SSHHOST="localhost" \
@@ -62,6 +64,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/synologydsm/synologydsm_test.go b/pkg/core/deployer/providers-tester/synologydsm/synologydsm_test.go
similarity index 84%
rename from pkg/core/deployer/providers/synologydsm/synologydsm_test.go
rename to pkg/core/deployer/providers-tester/synologydsm/synologydsm_test.go
index d6ea4ed44..4c17416c1 100644
--- a/pkg/core/deployer/providers/synologydsm/synologydsm_test.go
+++ b/pkg/core/deployer/providers-tester/synologydsm/synologydsm_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package synologydsm_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/synologydsm"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("SYNOLOGYDSM_")
+ fp = tester.InitArgs("SYNOLOGYDSM_")
fTestCertPath string
fTestKeyPath string
fServerUrl string
@@ -35,7 +37,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./synology_dsm_test.go -args \
+ go test -tags=tester -v ./synology_dsm_test.go -args \
--SYNOLOGYDSM_TESTCERTPATH="/path/to/your-test-cert.pem" \
--SYNOLOGYDSM_TESTKEYPATH="/path/to/your-test-key.pem" \
--SYNOLOGYDSM_SERVERURL="http://127.0.0.1:5000/" \
@@ -59,6 +61,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-cdn/tencentcloud_cdn_test.go b/pkg/core/deployer/providers-tester/tencentcloud-cdn/tencentcloud_cdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/tencentcloud-cdn/tencentcloud_cdn_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-cdn/tencentcloud_cdn_test.go
index a1f9c0f55..3df6c92e9 100644
--- a/pkg/core/deployer/providers/tencentcloud-cdn/tencentcloud_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-cdn/tencentcloud_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudcdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUDCDN_")
+ fp = tester.InitArgs("TENCENTCLOUDCDN_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_cdn_test.go -args \
+ go test -tags=tester -v ./tencentcloud_cdn_test.go -args \
--TENCENTCLOUDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDCDN_SECRETID="your-secret-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-clb/tencentcloud_clb_test.go b/pkg/core/deployer/providers-tester/tencentcloud-clb/tencentcloud_clb_test.go
similarity index 82%
rename from pkg/core/deployer/providers/tencentcloud-clb/tencentcloud_clb_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-clb/tencentcloud_clb_test.go
index d4e4787ab..a30a24b17 100644
--- a/pkg/core/deployer/providers/tencentcloud-clb/tencentcloud_clb_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-clb/tencentcloud_clb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudclb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-clb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUDCLB_")
+ fp = tester.InitArgs("TENCENTCLOUDCLB_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -35,7 +37,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_clb_test.go -args \
+ go test -tags=tester -v ./tencentcloud_clb_test.go -args \
--TENCENTCLOUDCLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDCLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDCLB_SECRETID="your-secret-id" \
@@ -58,7 +60,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToListener", func(t *testing.T) {
@@ -72,7 +74,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToRuleDomain", func(t *testing.T) {
@@ -87,6 +89,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-cos/tencentcloud_cos_test.go b/pkg/core/deployer/providers-tester/tencentcloud-cos/tencentcloud_cos_test.go
similarity index 81%
rename from pkg/core/deployer/providers/tencentcloud-cos/tencentcloud_cos_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-cos/tencentcloud_cos_test.go
index eb88c5198..30771999a 100644
--- a/pkg/core/deployer/providers/tencentcloud-cos/tencentcloud_cos_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-cos/tencentcloud_cos_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudcos_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-cos"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUDCOS_")
+ fp = tester.InitArgs("TENCENTCLOUDCOS_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_cos_test.go -args \
+ go test -tags=tester -v ./tencentcloud_cos_test.go -args \
--TENCENTCLOUDCOS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDCOS_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDCOS_SECRETID="your-secret-id" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-css/tencentcloud_css_test.go b/pkg/core/deployer/providers-tester/tencentcloud-css/tencentcloud_css_test.go
similarity index 77%
rename from pkg/core/deployer/providers/tencentcloud-css/tencentcloud_css_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-css/tencentcloud_css_test.go
index e98a13990..ba5954406 100644
--- a/pkg/core/deployer/providers/tencentcloud-css/tencentcloud_css_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-css/tencentcloud_css_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudcss_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-css"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUDCSS_")
+ fp = tester.InitArgs("TENCENTCLOUDCSS_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_css_test.go -args \
+ go test -tags=tester -v ./tencentcloud_css_test.go -args \
--TENCENTCLOUDCSS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDCSS_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDCSS_SECRETID="your-secret-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-ecdn/tencentcloud_ecdn_test.go b/pkg/core/deployer/providers-tester/tencentcloud-ecdn/tencentcloud_ecdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/tencentcloud-ecdn/tencentcloud_ecdn_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-ecdn/tencentcloud_ecdn_test.go
index 655fe78ec..845eaf6ec 100644
--- a/pkg/core/deployer/providers/tencentcloud-ecdn/tencentcloud_ecdn_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-ecdn/tencentcloud_ecdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudecdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-ecdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUDECDN_")
+ fp = tester.InitArgs("TENCENTCLOUDECDN_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_ecdn_test.go -args \
+ go test -tags=tester -v ./tencentcloud_ecdn_test.go -args \
--TENCENTCLOUDECDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDECDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDECDN_SECRETID="your-secret-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-eo/tencentcloud_eo_test.go b/pkg/core/deployer/providers-tester/tencentcloud-eo/tencentcloud_eo_test.go
similarity index 81%
rename from pkg/core/deployer/providers/tencentcloud-eo/tencentcloud_eo_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-eo/tencentcloud_eo_test.go
index 74393a609..2260b2116 100644
--- a/pkg/core/deployer/providers/tencentcloud-eo/tencentcloud_eo_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-eo/tencentcloud_eo_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudeo_test
import (
@@ -6,12 +8,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-eo"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUDEO_")
+ fp = tester.InitArgs("TENCENTCLOUDEO_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -32,7 +34,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_eo_test.go -args \
+ go test -tags=tester -v ./tencentcloud_eo_test.go -args \
--TENCENTCLOUDEO_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDEO_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDEO_SECRETID="your-secret-id" \
@@ -54,6 +56,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-eomakers/tencentcloud_eomakers_test.go b/pkg/core/deployer/providers-tester/tencentcloud-eomakers/tencentcloud_eomakers_test.go
similarity index 83%
rename from pkg/core/deployer/providers/tencentcloud-eomakers/tencentcloud_eomakers_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-eomakers/tencentcloud_eomakers_test.go
index fa1e0d6bb..fc57363bb 100644
--- a/pkg/core/deployer/providers/tencentcloud-eomakers/tencentcloud_eomakers_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-eomakers/tencentcloud_eomakers_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudeomakers_test
import (
@@ -6,12 +8,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-eomakers"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUDEOMAKERS_")
+ fp = tester.InitArgs("TENCENTCLOUDEOMAKERS_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -34,7 +36,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_eomakers_test.go -args \
+ go test -tags=tester -v ./tencentcloud_eomakers_test.go -args \
--TENCENTCLOUDEOMAKERS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDEOMAKERS_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDEOMAKERS_SECRETID="your-secret-id" \
@@ -58,6 +60,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-ga2/tencentcloud_ga2_test.go b/pkg/core/deployer/providers-tester/tencentcloud-ga2/tencentcloud_ga2_test.go
similarity index 81%
rename from pkg/core/deployer/providers/tencentcloud-ga2/tencentcloud_ga2_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-ga2/tencentcloud_ga2_test.go
index 78cdfd557..949579955 100644
--- a/pkg/core/deployer/providers/tencentcloud-ga2/tencentcloud_ga2_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-ga2/tencentcloud_ga2_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudga2_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-ga2"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUDGA2_")
+ fp = tester.InitArgs("TENCENTCLOUDGA2_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_ga2_test.go -args \
+ go test -tags=tester -v ./tencentcloud_ga2_test.go -args \
--TENCENTCLOUDGA2_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDGA2_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDGA2_SECRETID="your-secret-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-gaap/tencentcloud_gaap_test.go b/pkg/core/deployer/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go
similarity index 81%
rename from pkg/core/deployer/providers/tencentcloud-gaap/tencentcloud_gaap_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go
index 1ae0d1e68..395e7a222 100644
--- a/pkg/core/deployer/providers/tencentcloud-gaap/tencentcloud_gaap_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-gaap/tencentcloud_gaap_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudgaap_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-gaap"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUGAAP_")
+ fp = tester.InitArgs("TENCENTCLOUGAAP_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_gaap_test.go -args \
+ go test -tags=tester -v ./tencentcloud_gaap_test.go -args \
--TENCENTCLOUDGAAP_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDGAAP_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDGAAP_SECRETID="your-secret-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-scf/tencentcloud_scf_test.go b/pkg/core/deployer/providers-tester/tencentcloud-scf/tencentcloud_scf_test.go
similarity index 80%
rename from pkg/core/deployer/providers/tencentcloud-scf/tencentcloud_scf_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-scf/tencentcloud_scf_test.go
index 1b3e3ad49..1339c9448 100644
--- a/pkg/core/deployer/providers/tencentcloud-scf/tencentcloud_scf_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-scf/tencentcloud_scf_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudscf_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-scf"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUDSCF_")
+ fp = tester.InitArgs("TENCENTCLOUDSCF_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_scf_test.go -args \
+ go test -tags=tester -v ./tencentcloud_scf_test.go -args \
--TENCENTCLOUDSCF_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDSCF_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDSCF_SECRETID="your-secret-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-vod/tencentcloud_vod_test.go b/pkg/core/deployer/providers-tester/tencentcloud-vod/tencentcloud_vod_test.go
similarity index 81%
rename from pkg/core/deployer/providers/tencentcloud-vod/tencentcloud_vod_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-vod/tencentcloud_vod_test.go
index 9c7423bc7..4c1f6bb6c 100644
--- a/pkg/core/deployer/providers/tencentcloud-vod/tencentcloud_vod_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-vod/tencentcloud_vod_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudvod_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-vod"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUDVOD_")
+ fp = tester.InitArgs("TENCENTCLOUDVOD_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_vod_test.go -args \
+ go test -tags=tester -v ./tencentcloud_vod_test.go -args \
--TENCENTCLOUDVOD_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDVOD_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDVOD_SECRETID="your-secret-id" \
@@ -54,6 +56,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/tencentcloud-waf/tencentcloud_waf_test.go b/pkg/core/deployer/providers-tester/tencentcloud-waf/tencentcloud_waf_test.go
similarity index 82%
rename from pkg/core/deployer/providers/tencentcloud-waf/tencentcloud_waf_test.go
rename to pkg/core/deployer/providers-tester/tencentcloud-waf/tencentcloud_waf_test.go
index 3d7e2f972..2dc809b24 100644
--- a/pkg/core/deployer/providers/tencentcloud-waf/tencentcloud_waf_test.go
+++ b/pkg/core/deployer/providers-tester/tencentcloud-waf/tencentcloud_waf_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package tencentcloudwaf_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/tencentcloud-waf"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("TENCENTCLOUDWAF_")
+ fp = tester.InitArgs("TENCENTCLOUDWAF_")
fTestCertPath string
fTestKeyPath string
fSecretId string
@@ -35,7 +37,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./tencentcloud_waf_test.go -args \
+ go test -tags=tester -v ./tencentcloud_waf_test.go -args \
--TENCENTCLOUDWAF_TESTCERTPATH="/path/to/your-test-cert.pem" \
--TENCENTCLOUDWAF_TESTKEYPATH="/path/to/your-test-key.pem" \
--TENCENTCLOUDWAF_SECRETID="your-secret-id" \
@@ -59,6 +61,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/testing/testing.go b/pkg/core/deployer/providers-tester/tester.go
similarity index 57%
rename from pkg/core/deployer/testing/testing.go
rename to pkg/core/deployer/providers-tester/tester.go
index 47b7634c4..1d91cd5bd 100644
--- a/pkg/core/deployer/testing/testing.go
+++ b/pkg/core/deployer/providers-tester/tester.go
@@ -1,4 +1,6 @@
-package testing
+//go:build tester
+
+package tester
import (
"context"
@@ -13,33 +15,33 @@ import (
"github.com/certimate-go/certimate/pkg/core/deployer"
)
-type TestDeployArgs struct {
+type DeployInput struct {
CertPath string
KeyPath string
}
-func TestDeploy(t *testing.T, testProvider deployer.Provider, testArgs TestDeployArgs) {
- if _, err := os.Stat(testArgs.CertPath); os.IsNotExist(err) {
+func Deploy(t *testing.T, provider deployer.Provider, input DeployInput) {
+ if _, err := os.Stat(input.CertPath); os.IsNotExist(err) {
t.Errorf("err: test cert file not exist")
return
}
- if _, err := os.Stat(testArgs.KeyPath); os.IsNotExist(err) {
+ if _, err := os.Stat(input.KeyPath); os.IsNotExist(err) {
t.Errorf("err: test privkey file not exist")
return
}
ctx := context.Background()
- certData, _ := os.ReadFile(testArgs.CertPath)
- privkeyData, _ := os.ReadFile(testArgs.KeyPath)
+ certData, _ := os.ReadFile(input.CertPath)
+ privkeyData, _ := os.ReadFile(input.KeyPath)
assert.NotNil(t, certData)
assert.NotNil(t, privkeyData)
logger := slog.Default()
logger.Enabled(ctx, slog.LevelDebug)
- testProvider.SetLogger(logger)
+ provider.SetLogger(logger)
- res, err := testProvider.Deploy(ctx, string(certData), string(privkeyData))
+ res, err := provider.Deploy(ctx, string(certData), string(privkeyData))
require.NoError(t, err)
require.NotNil(t, res)
diff --git a/pkg/core/deployer/providers-tester/tester_args.go b/pkg/core/deployer/providers-tester/tester_args.go
new file mode 100644
index 000000000..110391f3d
--- /dev/null
+++ b/pkg/core/deployer/providers-tester/tester_args.go
@@ -0,0 +1,11 @@
+//go:build tester
+
+package tester
+
+import (
+ "github.com/certimate-go/certimate/pkg/core/internal/testing"
+)
+
+func InitArgs(prefix string) testing.ArgsParser {
+ return testing.InitArgs(prefix)
+}
diff --git a/pkg/core/deployer/providers/ucloud-ualb/ucloud_ualb_test.go b/pkg/core/deployer/providers-tester/ucloud-ualb/ucloud_ualb_test.go
similarity index 82%
rename from pkg/core/deployer/providers/ucloud-ualb/ucloud_ualb_test.go
rename to pkg/core/deployer/providers-tester/ucloud-ualb/ucloud_ualb_test.go
index 2df965a5d..e6d420330 100644
--- a/pkg/core/deployer/providers/ucloud-ualb/ucloud_ualb_test.go
+++ b/pkg/core/deployer/providers-tester/ucloud-ualb/ucloud_ualb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ucloudualb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-ualb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("UCLOUDUALB_")
+ fp = tester.InitArgs("UCLOUDUALB_")
fTestCertPath string
fTestKeyPath string
fPrivateKey string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ucloud_ualb_test.go -args \
+ go test -tags=tester -v ./ucloud_ualb_test.go -args \
--UCLOUDUALB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UCLOUDUALB_TESTKEYPATH="/path/to/your-test-key.pem" \
--UCLOUDUALB_PRIVATEKEY="your-private-key" \
@@ -56,6 +58,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ucloud-ucdn/ucloud_ucdn_test.go b/pkg/core/deployer/providers-tester/ucloud-ucdn/ucloud_ucdn_test.go
similarity index 78%
rename from pkg/core/deployer/providers/ucloud-ucdn/ucloud_ucdn_test.go
rename to pkg/core/deployer/providers-tester/ucloud-ucdn/ucloud_ucdn_test.go
index aea04a87d..fad2058c3 100644
--- a/pkg/core/deployer/providers/ucloud-ucdn/ucloud_ucdn_test.go
+++ b/pkg/core/deployer/providers-tester/ucloud-ucdn/ucloud_ucdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package uclouducdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-ucdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("UCLOUDUCDN_")
+ fp = tester.InitArgs("UCLOUDUCDN_")
fTestCertPath string
fTestKeyPath string
fPrivateKey string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ucloud_ucdn_test.go -args \
+ go test -tags=tester -v ./ucloud_ucdn_test.go -args \
--UCLOUDUCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UCLOUDUCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--UCLOUDUCDN_PRIVATEKEY="your-private-key" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ucloud-uclb/ucloud_uclb_test.go b/pkg/core/deployer/providers-tester/ucloud-uclb/ucloud_uclb_test.go
similarity index 82%
rename from pkg/core/deployer/providers/ucloud-uclb/ucloud_uclb_test.go
rename to pkg/core/deployer/providers-tester/ucloud-uclb/ucloud_uclb_test.go
index fa9189783..08f385b9f 100644
--- a/pkg/core/deployer/providers/ucloud-uclb/ucloud_uclb_test.go
+++ b/pkg/core/deployer/providers-tester/ucloud-uclb/ucloud_uclb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package uclouduclb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-uclb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("UCLOUDUCLB_")
+ fp = tester.InitArgs("UCLOUDUCLB_")
fTestCertPath string
fTestKeyPath string
fPrivateKey string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ucloud_uclb_test.go -args \
+ go test -tags=tester -v ./ucloud_uclb_test.go -args \
--UCLOUDUCLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UCLOUDUCLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--UCLOUDUCLB_PRIVATEKEY="your-private-key" \
@@ -56,6 +58,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ucloud-uewaf/ucloud_uewaf_test.go b/pkg/core/deployer/providers-tester/ucloud-uewaf/ucloud_uewaf_test.go
similarity index 78%
rename from pkg/core/deployer/providers/ucloud-uewaf/ucloud_uewaf_test.go
rename to pkg/core/deployer/providers-tester/ucloud-uewaf/ucloud_uewaf_test.go
index bfe7b0122..e81b93633 100644
--- a/pkg/core/deployer/providers/ucloud-uewaf/ucloud_uewaf_test.go
+++ b/pkg/core/deployer/providers-tester/ucloud-uewaf/ucloud_uewaf_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package uclouduewaf_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-uewaf"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("UCLOUDUEWAF_")
+ fp = tester.InitArgs("UCLOUDUEWAF_")
fTestCertPath string
fTestKeyPath string
fPrivateKey string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ucloud_uewaf_test.go -args \
+ go test -tags=tester -v ./ucloud_uewaf_test.go -args \
--UCLOUDUEWAF_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UCLOUDUEWAF_TESTKEYPATH="/path/to/your-test-key.pem" \
--UCLOUDUEWAF_PRIVATEKEY="your-private-key" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ucloud-upathx/ucloud_upathx_test.go b/pkg/core/deployer/providers-tester/ucloud-upathx/ucloud_upathx_test.go
similarity index 81%
rename from pkg/core/deployer/providers/ucloud-upathx/ucloud_upathx_test.go
rename to pkg/core/deployer/providers-tester/ucloud-upathx/ucloud_upathx_test.go
index 067b6a704..854f5d7e8 100644
--- a/pkg/core/deployer/providers/ucloud-upathx/ucloud_upathx_test.go
+++ b/pkg/core/deployer/providers-tester/ucloud-upathx/ucloud_upathx_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ucloudupathx_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-upathx"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("UCLOUDUPATHX_")
+ fp = tester.InitArgs("UCLOUDUPATHX_")
fTestCertPath string
fTestKeyPath string
fPrivateKey string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ucloud_upathx_test.go -args \
+ go test -tags=tester -v ./ucloud_upathx_test.go -args \
--UCLOUDUPATHX_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UCLOUDUPATHX_TESTKEYPATH="/path/to/your-test-key.pem" \
--UCLOUDUPATHX_PRIVATEKEY="your-private-key" \
@@ -53,6 +55,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/ucloud-us3/ucloud_us3_test.go b/pkg/core/deployer/providers-tester/ucloud-us3/ucloud_us3_test.go
similarity index 81%
rename from pkg/core/deployer/providers/ucloud-us3/ucloud_us3_test.go
rename to pkg/core/deployer/providers-tester/ucloud-us3/ucloud_us3_test.go
index 5e7acdbcd..eb925d7c9 100644
--- a/pkg/core/deployer/providers/ucloud-us3/ucloud_us3_test.go
+++ b/pkg/core/deployer/providers-tester/ucloud-us3/ucloud_us3_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package ucloudus3_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/ucloud-us3"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("UCLOUDUS3_")
+ fp = tester.InitArgs("UCLOUDUS3_")
fTestCertPath string
fTestKeyPath string
fPrivateKey string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./ucloud_us3_test.go -args \
+ go test -tags=tester -v ./ucloud_us3_test.go -args \
--UCLOUDUS3_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UCLOUDUS3_TESTKEYPATH="/path/to/your-test-key.pem" \
--UCLOUDUS3_PRIVATEKEY="your-private-key" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/unicloud-webhost/unicloud_webhost_test.go b/pkg/core/deployer/providers-tester/unicloud-webhost/unicloud_webhost_test.go
similarity index 81%
rename from pkg/core/deployer/providers/unicloud-webhost/unicloud_webhost_test.go
rename to pkg/core/deployer/providers-tester/unicloud-webhost/unicloud_webhost_test.go
index 202d28b36..e532f70a9 100644
--- a/pkg/core/deployer/providers/unicloud-webhost/unicloud_webhost_test.go
+++ b/pkg/core/deployer/providers-tester/unicloud-webhost/unicloud_webhost_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package unicloudwebhost_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/unicloud-webhost"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("UNICLOUDWEBHOST_")
+ fp = tester.InitArgs("UNICLOUDWEBHOST_")
fTestCertPath string
fTestKeyPath string
fUsername string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./unicloud_webhost_test.go -args \
+ go test -tags=tester -v ./unicloud_webhost_test.go -args \
--UNICLOUDWEBHOST_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UNICLOUDWEBHOST_TESTKEYPATH="/path/to/your-test-key.pem" \
--UNICLOUDWEBHOST_USERNAME="your-username" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/upyun-cdn/upyun_cdn_test.go b/pkg/core/deployer/providers-tester/upyun-cdn/upyun_cdn_test.go
similarity index 77%
rename from pkg/core/deployer/providers/upyun-cdn/upyun_cdn_test.go
rename to pkg/core/deployer/providers-tester/upyun-cdn/upyun_cdn_test.go
index 3d40ad283..2fd06d97c 100644
--- a/pkg/core/deployer/providers/upyun-cdn/upyun_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/upyun-cdn/upyun_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package upyuncdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/upyun-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("UPYUNCDN_")
+ fp = tester.InitArgs("UPYUNCDN_")
fTestCertPath string
fTestKeyPath string
fUsername string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./upyun_cdn_test.go -args \
+ go test -tags=tester -v ./upyun_cdn_test.go -args \
--UPYUNCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UPYUNCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--UPYUNCDN_USERNAME="your-username" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/upyun-file/upyun_file_test.go b/pkg/core/deployer/providers-tester/upyun-file/upyun_file_test.go
similarity index 79%
rename from pkg/core/deployer/providers/upyun-file/upyun_file_test.go
rename to pkg/core/deployer/providers-tester/upyun-file/upyun_file_test.go
index 635aa2e32..0e79bca68 100644
--- a/pkg/core/deployer/providers/upyun-file/upyun_file_test.go
+++ b/pkg/core/deployer/providers-tester/upyun-file/upyun_file_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package upyunfile_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/upyun-file"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("UPYUNFILE_")
+ fp = tester.InitArgs("UPYUNFILE_")
fTestCertPath string
fTestKeyPath string
fUsername string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./upyun_file_test.go -args \
+ go test -tags=tester -v ./upyun_file_test.go -args \
--UPYUNFILE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--UPYUNFILE_TESTKEYPATH="/path/to/your-test-key.pem" \
--UPYUNFILE_USERNAME="your-username" \
@@ -51,6 +53,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/vercel/vercel_test.go b/pkg/core/deployer/providers-tester/vercel/vercel_test.go
similarity index 76%
rename from pkg/core/deployer/providers/vercel/vercel_test.go
rename to pkg/core/deployer/providers-tester/vercel/vercel_test.go
index fbe8d129f..35943d49b 100644
--- a/pkg/core/deployer/providers/vercel/vercel_test.go
+++ b/pkg/core/deployer/providers-tester/vercel/vercel_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package vercel_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/vercel"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("VERCEL_")
+ fp = tester.InitArgs("VERCEL_")
fTestCertPath string
fTestKeyPath string
fApiAccessToken string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./vercel_test.go -args \
+ go test -tags=tester -v ./vercel_test.go -args \
--VERCEL_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VERCEL_TESTKEYPATH="/path/to/your-test-key.pem" \
--VERCEL_APIACCESSTOKEN="your-api-access-token" \
@@ -43,6 +45,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/volcengine-alb/volcengine_alb_test.go b/pkg/core/deployer/providers-tester/volcengine-alb/volcengine_alb_test.go
similarity index 81%
rename from pkg/core/deployer/providers/volcengine-alb/volcengine_alb_test.go
rename to pkg/core/deployer/providers-tester/volcengine-alb/volcengine_alb_test.go
index 71faef9c6..b330ecad4 100644
--- a/pkg/core/deployer/providers/volcengine-alb/volcengine_alb_test.go
+++ b/pkg/core/deployer/providers-tester/volcengine-alb/volcengine_alb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcenginealb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-alb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("VOLCENGINEALB_")
+ fp = tester.InitArgs("VOLCENGINEALB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_alb_test.go -args \
+ go test -tags=tester -v ./volcengine_alb_test.go -args \
--VOLCENGINEALB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINEALB_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINEALB_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/volcengine-apig/volcengine_apig_test.go b/pkg/core/deployer/providers-tester/volcengine-apig/volcengine_apig_test.go
similarity index 81%
rename from pkg/core/deployer/providers/volcengine-apig/volcengine_apig_test.go
rename to pkg/core/deployer/providers-tester/volcengine-apig/volcengine_apig_test.go
index d3210c60a..c33e48bfc 100644
--- a/pkg/core/deployer/providers/volcengine-apig/volcengine_apig_test.go
+++ b/pkg/core/deployer/providers-tester/volcengine-apig/volcengine_apig_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcengineapig_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-apig"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("VOLCENGINEAPIG_")
+ fp = tester.InitArgs("VOLCENGINEAPIG_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_apig_test.go -args \
+ go test -tags=tester -v ./volcengine_apig_test.go -args \
--VOLCENGINEAPIG_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINEAPIG_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINEAPIG_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/volcengine-cdn/volcengine_cdn_test.go b/pkg/core/deployer/providers-tester/volcengine-cdn/volcengine_cdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/volcengine-cdn/volcengine_cdn_test.go
rename to pkg/core/deployer/providers-tester/volcengine-cdn/volcengine_cdn_test.go
index 9d98219cb..cb4c3895e 100644
--- a/pkg/core/deployer/providers/volcengine-cdn/volcengine_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/volcengine-cdn/volcengine_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcenginecdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("VOLCENGINECDN_")
+ fp = tester.InitArgs("VOLCENGINECDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_cdn_test.go -args \
+ go test -tags=tester -v ./volcengine_cdn_test.go -args \
--VOLCENGINECDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINECDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINECDN_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/volcengine-clb/volcengine_clb_test.go b/pkg/core/deployer/providers-tester/volcengine-clb/volcengine_clb_test.go
similarity index 81%
rename from pkg/core/deployer/providers/volcengine-clb/volcengine_clb_test.go
rename to pkg/core/deployer/providers-tester/volcengine-clb/volcengine_clb_test.go
index ed6bde0e3..d982c884f 100644
--- a/pkg/core/deployer/providers/volcengine-clb/volcengine_clb_test.go
+++ b/pkg/core/deployer/providers-tester/volcengine-clb/volcengine_clb_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcengineclb_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-clb"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("VOLCENGINECLB_")
+ fp = tester.InitArgs("VOLCENGINECLB_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_clb_test.go -args \
+ go test -tags=tester -v ./volcengine_clb_test.go -args \
--VOLCENGINECLB_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINECLB_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINECLB_ACCESSKEYID="your-access-key-id" \
@@ -52,6 +54,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/volcengine-dcdn/volcengine_dcdn_test.go b/pkg/core/deployer/providers-tester/volcengine-dcdn/volcengine_dcdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/volcengine-dcdn/volcengine_dcdn_test.go
rename to pkg/core/deployer/providers-tester/volcengine-dcdn/volcengine_dcdn_test.go
index 2690af806..3dd8c384f 100644
--- a/pkg/core/deployer/providers/volcengine-dcdn/volcengine_dcdn_test.go
+++ b/pkg/core/deployer/providers-tester/volcengine-dcdn/volcengine_dcdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcenginedcdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-dcdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("VOLCENGINEDCDN_")
+ fp = tester.InitArgs("VOLCENGINEDCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_dcdn_test.go -args \
+ go test -tags=tester -v ./volcengine_dcdn_test.go -args \
--VOLCENGINEDCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINEDCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINEDCDN_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/volcengine-imagex/volcengine_imagex_test.go b/pkg/core/deployer/providers-tester/volcengine-imagex/volcengine_imagex_test.go
similarity index 82%
rename from pkg/core/deployer/providers/volcengine-imagex/volcengine_imagex_test.go
rename to pkg/core/deployer/providers-tester/volcengine-imagex/volcengine_imagex_test.go
index 33d57a8ec..6182f38cf 100644
--- a/pkg/core/deployer/providers/volcengine-imagex/volcengine_imagex_test.go
+++ b/pkg/core/deployer/providers-tester/volcengine-imagex/volcengine_imagex_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcengineimagex_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-imagex"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("VOLCENGINEIMAGEX_")
+ fp = tester.InitArgs("VOLCENGINEIMAGEX_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_imagex_test.go -args \
+ go test -tags=tester -v ./volcengine_imagex_test.go -args \
--VOLCENGINEIMAGEX_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINEIMAGEX_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINEIMAGEX_ACCESSKEYID="your-access-key-id" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/volcengine-live/volcengine_live_test.go b/pkg/core/deployer/providers-tester/volcengine-live/volcengine_live_test.go
similarity index 79%
rename from pkg/core/deployer/providers/volcengine-live/volcengine_live_test.go
rename to pkg/core/deployer/providers-tester/volcengine-live/volcengine_live_test.go
index 38667475f..f922e415b 100644
--- a/pkg/core/deployer/providers/volcengine-live/volcengine_live_test.go
+++ b/pkg/core/deployer/providers-tester/volcengine-live/volcengine_live_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcenginelive_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-live"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("VOLCENGINELIVE_")
+ fp = tester.InitArgs("VOLCENGINELIVE_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_live_test.go -args \
+ go test -tags=tester -v ./volcengine_live_test.go -args \
--VOLCENGINELIVE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINELIVE_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINELIVE_ACCESSKEYID="your-access-key-id" \
@@ -48,6 +50,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/volcengine-tos/volcengine_tos_test.go b/pkg/core/deployer/providers-tester/volcengine-tos/volcengine_tos_test.go
similarity index 82%
rename from pkg/core/deployer/providers/volcengine-tos/volcengine_tos_test.go
rename to pkg/core/deployer/providers-tester/volcengine-tos/volcengine_tos_test.go
index c770fee13..65f7b36d3 100644
--- a/pkg/core/deployer/providers/volcengine-tos/volcengine_tos_test.go
+++ b/pkg/core/deployer/providers-tester/volcengine-tos/volcengine_tos_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcenginetos_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-tos"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("VOLCENGINETOS_")
+ fp = tester.InitArgs("VOLCENGINETOS_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_tos_test.go -args \
+ go test -tags=tester -v ./volcengine_tos_test.go -args \
--VOLCENGINETOS_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINETOS_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINETOS_ACCESSKEYID="your-access-key-id" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/volcengine-vod/volcengine_vod_test.go b/pkg/core/deployer/providers-tester/volcengine-vod/volcengine_vod_test.go
similarity index 83%
rename from pkg/core/deployer/providers/volcengine-vod/volcengine_vod_test.go
rename to pkg/core/deployer/providers-tester/volcengine-vod/volcengine_vod_test.go
index 34df4ea21..1205ad55f 100644
--- a/pkg/core/deployer/providers/volcengine-vod/volcengine_vod_test.go
+++ b/pkg/core/deployer/providers-tester/volcengine-vod/volcengine_vod_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcenginevod_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-vod"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("VOLCENGINEVOD_")
+ fp = tester.InitArgs("VOLCENGINEVOD_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_vod_test.go -args \
+ go test -tags=tester -v ./volcengine_vod_test.go -args \
--VOLCENGINEVOD_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINEVOD_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINEVOD_ACCESSKEYID="your-access-key-id" \
@@ -56,6 +58,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/volcengine-waf/volcengine_waf_test.go b/pkg/core/deployer/providers-tester/volcengine-waf/volcengine_waf_test.go
similarity index 82%
rename from pkg/core/deployer/providers/volcengine-waf/volcengine_waf_test.go
rename to pkg/core/deployer/providers-tester/volcengine-waf/volcengine_waf_test.go
index e9534e854..8ec84f86d 100644
--- a/pkg/core/deployer/providers/volcengine-waf/volcengine_waf_test.go
+++ b/pkg/core/deployer/providers-tester/volcengine-waf/volcengine_waf_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package volcenginewaf_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/volcengine-waf"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("VOLCENGINEWAF_")
+ fp = tester.InitArgs("VOLCENGINEWAF_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./volcengine_waf_test.go -args \
+ go test -tags=tester -v ./volcengine_waf_test.go -args \
--VOLCENGINEWAF_TESTCERTPATH="/path/to/your-test-cert.pem" \
--VOLCENGINEWAF_TESTKEYPATH="/path/to/your-test-key.pem" \
--VOLCENGINEWAF_ACCESSKEYID="your-access-key-id" \
@@ -55,6 +57,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/wangsu-cdn/wangsu_cdn_test.go b/pkg/core/deployer/providers-tester/wangsu-cdn/wangsu_cdn_test.go
similarity index 79%
rename from pkg/core/deployer/providers/wangsu-cdn/wangsu_cdn_test.go
rename to pkg/core/deployer/providers-tester/wangsu-cdn/wangsu_cdn_test.go
index 487a3fad8..b840dd298 100644
--- a/pkg/core/deployer/providers/wangsu-cdn/wangsu_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/wangsu-cdn/wangsu_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package wangsucdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/wangsu-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("WANGSUCDN_")
+ fp = tester.InitArgs("WANGSUCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./wangsu_cdn_test.go -args \
+ go test -tags=tester -v ./wangsu_cdn_test.go -args \
--WANGSUCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--WANGSUCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--WANGSUCDN_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/wangsu-cdnpro/wangsu_cdnpro_test.go b/pkg/core/deployer/providers-tester/wangsu-cdnpro/wangsu_cdnpro_test.go
similarity index 85%
rename from pkg/core/deployer/providers/wangsu-cdnpro/wangsu_cdnpro_test.go
rename to pkg/core/deployer/providers-tester/wangsu-cdnpro/wangsu_cdnpro_test.go
index 93d45e916..9ca4db5d1 100644
--- a/pkg/core/deployer/providers/wangsu-cdnpro/wangsu_cdnpro_test.go
+++ b/pkg/core/deployer/providers-tester/wangsu-cdnpro/wangsu_cdnpro_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package wangsucdnpro_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/wangsu-cdnpro"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("WANGSUCDNPRO_")
+ fp = tester.InitArgs("WANGSUCDNPRO_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -37,7 +39,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./wangsu_cdnpro_test.go -args \
+ go test -tags=tester -v ./wangsu_cdnpro_test.go -args \
--WANGSUCDNPRO_TESTCERTPATH="/path/to/your-test-cert.pem" \
--WANGSUCDNPRO_TESTKEYPATH="/path/to/your-test-key.pem" \
--WANGSUCDNPRO_ACCESSKEYID="your-access-key-id" \
@@ -63,6 +65,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/wangsu-certificate/wangsu_certificate_test.go b/pkg/core/deployer/providers-tester/wangsu-certificate/wangsu_certificate_test.go
similarity index 79%
rename from pkg/core/deployer/providers/wangsu-certificate/wangsu_certificate_test.go
rename to pkg/core/deployer/providers-tester/wangsu-certificate/wangsu_certificate_test.go
index 4c142dbe6..c7bd5dfb4 100644
--- a/pkg/core/deployer/providers/wangsu-certificate/wangsu_certificate_test.go
+++ b/pkg/core/deployer/providers-tester/wangsu-certificate/wangsu_certificate_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package wangsucertificate_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/wangsu-certificate"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("WANGSUCERTIFICATE_")
+ fp = tester.InitArgs("WANGSUCERTIFICATE_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./wangsu_certificate_test.go -args \
+ go test -tags=tester -v ./wangsu_certificate_test.go -args \
--WANGSUCERTIFICATE_TESTCERTPATH="/path/to/your-test-cert.pem" \
--WANGSUCERTIFICATE_TESTKEYPATH="/path/to/your-test-key.pem" \
--WANGSUCERTIFICATE_ACCESSKEYID="your-access-key-id" \
@@ -47,6 +49,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/webhook/webhook_test.go b/pkg/core/deployer/providers-tester/webhook/webhook_test.go
similarity index 81%
rename from pkg/core/deployer/providers/webhook/webhook_test.go
rename to pkg/core/deployer/providers-tester/webhook/webhook_test.go
index 055f323dd..2d2744ae6 100644
--- a/pkg/core/deployer/providers/webhook/webhook_test.go
+++ b/pkg/core/deployer/providers-tester/webhook/webhook_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package webhook_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/webhook"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("WEBHOOK_")
+ fp = tester.InitArgs("WEBHOOK_")
fTestCertPath string
fTestKeyPath string
fWebhookUrl string
@@ -29,7 +31,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./webhook_test.go -args \
+ go test -tags=tester -v ./webhook_test.go -args \
--WEBHOOK_TESTCERTPATH="/path/to/your-test-cert.pem" \
--WEBHOOK_TESTKEYPATH="/path/to/your-test-key.pem" \
--WEBHOOK_URL="https://example.com/your-webhook-url" \
@@ -51,6 +53,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/zenlayer-cdn/zenlayer_cdn_test.go b/pkg/core/deployer/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go
similarity index 81%
rename from pkg/core/deployer/providers/zenlayer-cdn/zenlayer_cdn_test.go
rename to pkg/core/deployer/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go
index 396e1ac55..e6a2118e0 100644
--- a/pkg/core/deployer/providers/zenlayer-cdn/zenlayer_cdn_test.go
+++ b/pkg/core/deployer/providers-tester/zenlayer-cdn/zenlayer_cdn_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package zenlayercdn_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/zenlayer-cdn"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ZENLAYERCDN_")
+ fp = tester.InitArgs("ZENLAYERCDN_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./zenlayer_cdn_test.go -args \
+ go test -tags=tester -v ./zenlayer_cdn_test.go -args \
--ZENLAYERCDN_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ZENLAYERCDN_TESTKEYPATH="/path/to/your-test-key.pem" \
--ZENLAYERCDN_ACCESSKEYID="your-access-key-id" \
@@ -52,7 +54,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToCertificate", func(t *testing.T) {
@@ -64,6 +66,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/zenlayer-ga/zenlayer_ga_test.go b/pkg/core/deployer/providers-tester/zenlayer-ga/zenlayer_ga_test.go
similarity index 81%
rename from pkg/core/deployer/providers/zenlayer-ga/zenlayer_ga_test.go
rename to pkg/core/deployer/providers-tester/zenlayer-ga/zenlayer_ga_test.go
index 65892332a..272142aa2 100644
--- a/pkg/core/deployer/providers/zenlayer-ga/zenlayer_ga_test.go
+++ b/pkg/core/deployer/providers-tester/zenlayer-ga/zenlayer_ga_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package zenlayerga_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/deployer/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/deployer/providers/zenlayer-ga"
- it "github.com/certimate-go/certimate/pkg/core/deployer/testing"
)
var (
- fp = it.Args("ZENLAYERGA_")
+ fp = tester.InitArgs("ZENLAYERGA_")
fTestCertPath string
fTestKeyPath string
fAccessKeyId string
@@ -31,7 +33,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./zenlayer_ga_test.go -args \
+ go test -tags=tester -v ./zenlayer_ga_test.go -args \
--ZENLAYERGA_TESTCERTPATH="/path/to/your-test-cert.pem" \
--ZENLAYERGA_TESTKEYPATH="/path/to/your-test-key.pem" \
--ZENLAYERGA_ACCESSKEYID="your-access-key-id" \
@@ -51,7 +53,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
t.Run("Deploy_ToCertificate", func(t *testing.T) {
@@ -63,6 +65,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestDeploy(t, provider, it.TestDeployArgs{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
+ tester.Deploy(t, provider, tester.DeployInput{CertPath: fTestCertPath, KeyPath: fTestKeyPath})
})
}
diff --git a/pkg/core/deployer/providers/axisnow/axisnow.go b/pkg/core/deployer/providers/axisnow/axisnow.go
new file mode 100644
index 000000000..b56b619f1
--- /dev/null
+++ b/pkg/core/deployer/providers/axisnow/axisnow.go
@@ -0,0 +1,69 @@
+package axisnow
+
+import (
+ "context"
+ "fmt"
+ "log/slog"
+
+ "github.com/certimate-go/certimate/pkg/core"
+ cmgrimpl "github.com/certimate-go/certimate/pkg/core/certmgr/providers/axisnow"
+)
+
+type (
+ Provider = core.Deployer
+ DeployResult = core.DeployerDeployResult
+)
+
+type DeployerConfig struct {
+ // AxisNow API 令牌。
+ ApiToken string `json:"apiToken"`
+}
+
+type Deployer struct {
+ config *DeployerConfig
+ logger *slog.Logger
+ sdkCertmgr core.Certmgr
+}
+
+var _ Provider = (*Deployer)(nil)
+
+func NewDeployer(config *DeployerConfig) (*Deployer, error) {
+ if config == nil {
+ return nil, fmt.Errorf("the configuration of the deployer provider is nil")
+ }
+
+ pcertmgr, err := cmgrimpl.NewCertmgr(&cmgrimpl.CertmgrConfig{
+ ApiToken: config.ApiToken,
+ })
+ if err != nil {
+ return nil, fmt.Errorf("could not create certmgr: %w", err)
+ }
+
+ return &Deployer{
+ config: config,
+ logger: slog.Default(),
+ sdkCertmgr: pcertmgr,
+ }, nil
+}
+
+func (d *Deployer) SetLogger(logger *slog.Logger) {
+ if logger == nil {
+ d.logger = slog.New(slog.DiscardHandler)
+ } else {
+ d.logger = logger
+ }
+
+ d.sdkCertmgr.SetLogger(logger)
+}
+
+func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*DeployResult, error) {
+ // 上传证书
+ upres, err := d.sdkCertmgr.Upload(ctx, certPEM, privkeyPEM)
+ if err != nil {
+ return nil, fmt.Errorf("failed to upload certificate file: %w", err)
+ } else {
+ d.logger.Info("ssl certificate uploaded", slog.Any("result", upres))
+ }
+
+ return &DeployResult{}, nil
+}
diff --git a/pkg/core/deployer/providers/cmcccloud-cdn/cmcccloud_cdn.go b/pkg/core/deployer/providers/cmcccloud-cdn/cmcccloud_cdn.go
index 31ef284ec..031266654 100644
--- a/pkg/core/deployer/providers/cmcccloud-cdn/cmcccloud_cdn.go
+++ b/pkg/core/deployer/providers/cmcccloud-cdn/cmcccloud_cdn.go
@@ -1,3 +1,6 @@
+//nolint:composites
+//nolint:govet
+
package cmcccloudcdn
import (
diff --git a/pkg/core/deployer/providers/cmcccloud-vlb/cmcccloud_vlb.go b/pkg/core/deployer/providers/cmcccloud-vlb/cmcccloud_vlb.go
index c7d5a1388..b5bdb0dfb 100644
--- a/pkg/core/deployer/providers/cmcccloud-vlb/cmcccloud_vlb.go
+++ b/pkg/core/deployer/providers/cmcccloud-vlb/cmcccloud_vlb.go
@@ -1,3 +1,6 @@
+//nolint:composites
+//nolint:govet
+
package cmcccloudvlb
import (
diff --git a/pkg/core/deployer/providers/huaweiibmc/huaweiibmc.go b/pkg/core/deployer/providers/huaweiibmc/huaweiibmc.go
new file mode 100644
index 000000000..99e46cac3
--- /dev/null
+++ b/pkg/core/deployer/providers/huaweiibmc/huaweiibmc.go
@@ -0,0 +1,171 @@
+package huaweiibmc
+
+import (
+ "context"
+ "crypto/rand"
+ "crypto/tls"
+ "encoding/base64"
+ "encoding/hex"
+ "fmt"
+ "log/slog"
+ "net"
+ "strings"
+
+ "github.com/certimate-go/certimate/pkg/core"
+ ibmcsdk "github.com/certimate-go/certimate/pkg/sdk3rd/huaweiibmc"
+ xcert "github.com/certimate-go/certimate/pkg/utils/cert"
+ xloop "github.com/certimate-go/certimate/pkg/utils/loop"
+)
+
+type (
+ Provider = core.Deployer
+ DeployResult = core.DeployerDeployResult
+)
+
+type DeployerConfig struct {
+ // iBMC 主机。
+ Host string `json:"host"`
+ // iBMC 用户名。
+ Username string `json:"username"`
+ // iBMC 密码。
+ Password string `json:"password"`
+ // 是否允许不安全的连接。
+ AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
+ // 是否自动重启。
+ AutoRestart bool `json:"autoRestart,omitempty"`
+}
+
+type Deployer struct {
+ config *DeployerConfig
+ logger *slog.Logger
+}
+
+var _ Provider = (*Deployer)(nil)
+
+func NewDeployer(config *DeployerConfig) (*Deployer, error) {
+ if config == nil {
+ return nil, fmt.Errorf("the configuration of the iBMC deployer is nil")
+ }
+
+ return &Deployer{
+ config: config,
+ logger: slog.Default(),
+ }, nil
+}
+
+func (d *Deployer) SetLogger(logger *slog.Logger) {
+ if logger == nil {
+ d.logger = slog.New(slog.DiscardHandler)
+ } else {
+ d.logger = logger
+ }
+}
+
+func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*DeployResult, error) {
+ // 转换证书格式
+ certPFXPwd := make([]byte, 24)
+ if _, err := rand.Read(certPFXPwd); err != nil {
+ return nil, fmt.Errorf("failed to generate PFX password: %w", err)
+ }
+ certPFXPwdHex := hex.EncodeToString(certPFXPwd)
+ certPFX, err := xcert.TransformCertificateFromPEMToPFX(certPEM, privkeyPEM, certPFXPwdHex, nil)
+ if err != nil {
+ return nil, fmt.Errorf("failed to transform certificate from PEM to PFX: %w", err)
+ }
+
+ // 创建 iBMC 客户端
+ client, err := createSDKClient(d.config.Host, d.config.Username, d.config.Password, d.config.AllowInsecureConnections)
+ if err != nil {
+ return nil, fmt.Errorf("could not create client: %w", err)
+ }
+
+ // 创建会话
+ createSessionResp, err := client.CreateSessionWithContext(ctx)
+ d.logger.Debug("sdk request 'SessionService.CreateSession'", slog.Any("response", createSessionResp))
+ if err != nil {
+ return nil, fmt.Errorf("failed to execute sdk request 'SessionService.CreateSession': %w", err)
+ } else {
+ defer client.DeleteSessionWithContext(ctx)
+ }
+
+ // 查询管理集合资源信息
+ listManagersResp, err := client.ListManagersWithContext(ctx)
+ d.logger.Debug("sdk request 'Managers.ListManagers'", slog.Any("response", listManagersResp))
+ if err != nil {
+ return nil, fmt.Errorf("failed to execute sdk request 'Managers.ListManagers': %w", err)
+ }
+
+ // 批量更新管理证书
+ if len(listManagersResp.Members) == 0 {
+ d.logger.Info("no ibmc managers to deploy")
+ } else {
+ d.logger.Info("found ibmc managers to deploy", slog.Any("managers", listManagersResp.Members))
+
+ if err := xloop.ForRangeAllWithContext(ctx, listManagersResp.Members, func(ctx context.Context, managerInfo *ibmcsdk.Entity, _ int) error {
+ importCustomCertificateReq := &ibmcsdk.ImportCustomCertificateToManagerRequest{
+ ManagerID: managerInfo.ID,
+ ManagerLocation: managerInfo.ODataID,
+ Certificate: base64.StdEncoding.EncodeToString(certPFX),
+ Password: certPFXPwdHex,
+ }
+ importCustomCertificateResp, err := client.ImportCustomCertificateToManagerWithContext(ctx, importCustomCertificateReq)
+ d.logger.Debug("sdk request 'Managers.SecurityService.HttpsCert.ImportCustomCertificateToManager'", slog.String("params.managerODataId", managerInfo.ODataID), slog.Any("request", importCustomCertificateReq), slog.Any("response", importCustomCertificateResp))
+ if err != nil {
+ return fmt.Errorf("failed to execute sdk request 'Managers.SecurityService.HttpsCert.ImportCustomCertificateToManager': %w", err)
+ }
+
+ if d.config.AutoRestart {
+ resetManagerReq := &ibmcsdk.ResetManagerRequest{
+ ManagerID: managerInfo.ID,
+ ManagerLocation: managerInfo.ODataID,
+ ResetType: "ForceRestart",
+ }
+ resetManagerResp, err := client.ResetManagerWithContext(ctx, resetManagerReq)
+ d.logger.Debug("sdk request 'Managers.ResetManager'", slog.String("params.managerODataId", managerInfo.ODataID), slog.Any("request", resetManagerReq), slog.Any("response", resetManagerResp))
+ if err != nil {
+ return fmt.Errorf("failed to execute sdk request 'Managers.ResetManager': %w", err)
+ }
+ }
+
+ return nil
+ }); err != nil {
+ return nil, err
+ }
+ }
+
+ return &DeployResult{}, nil
+}
+
+func createSDKClient(host, username, password string, skipTlsVerify bool) (*ibmcsdk.Client, error) {
+ serverUrl := ""
+ if strings.Contains(host, "://") {
+ serverUrl = host
+ } else {
+ if net.ParseIP(host) != nil && strings.Contains(host, ":") {
+ host = "[" + host + "]"
+ }
+ serverUrl = "https://" + host
+ }
+
+ client, err := ibmcsdk.NewClient(
+ serverUrl,
+ ibmcsdk.WithLogins(username, password),
+ )
+ if err != nil {
+ return nil, err
+ }
+
+ if skipTlsVerify {
+ client.SetTLSConfig(&tls.Config{InsecureSkipVerify: true})
+ }
+
+ return client, nil
+}
+
+func generateCertificatePassword() (string, error) {
+ password := make([]byte, 24)
+ if _, err := rand.Read(password); err != nil {
+ return "", err
+ }
+ return hex.EncodeToString(password), nil
+}
diff --git a/pkg/core/deployer/providers/k8s-secret/k8s_secret.go b/pkg/core/deployer/providers/k8s-secret/k8s_secret.go
new file mode 100644
index 000000000..e9840b25c
--- /dev/null
+++ b/pkg/core/deployer/providers/k8s-secret/k8s_secret.go
@@ -0,0 +1,252 @@
+package k8ssecret
+
+import (
+ "context"
+ "fmt"
+ "log/slog"
+ "strings"
+
+ k8score "k8s.io/api/core/v1"
+ k8serrs "k8s.io/apimachinery/pkg/api/errors"
+ meta "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/client-go/rest"
+ "k8s.io/client-go/tools/clientcmd"
+
+ "github.com/certimate-go/certimate/pkg/core"
+ xcert "github.com/certimate-go/certimate/pkg/utils/cert"
+ xmaps "github.com/certimate-go/certimate/pkg/utils/maps"
+)
+
+type (
+ Provider = core.Deployer
+ DeployResult = core.DeployerDeployResult
+)
+
+type DeployerConfig struct {
+ // kubeconfig 文件内容。
+ KubeConfig string `json:"kubeConfig,omitempty"`
+ // Kubernetes 命名空间。
+ Namespace string `json:"namespace,omitempty"`
+ // Kubernetes Secret 名称。
+ SecretName string `json:"secretName"`
+ // Kubernetes Secret 类型。
+ SecretType string `json:"secretType"`
+ // Kubernetes Secret 中用于存放私钥的键。
+ SecretDataKeyForKey string `json:"secretDataKeyForKey,omitempty"`
+ // Kubernetes Secret 中用于存放证书的键。
+ SecretDataKeyForCrt string `json:"secretDataKeyForCrt,omitempty"`
+ // Kubernetes Secret 中用于存放证书(仅含服务器证书)的键。
+ // 选填。
+ SecretDataKeyForCrtOnlyServer string `json:"secretDataKeyForCrtOnlyServer,omitempty"`
+ // Kubernetes Secret 中用于存放证书(仅含中间证书)的键。
+ // 选填。
+ SecretDataKeyForCrtOnlyIntermedia string `json:"secretDataKeyForCrtOnlyIntermedia,omitempty"`
+ // Kubernetes Secret 注解。
+ SecretAnnotations map[string]string `json:"secretAnnotations,omitempty"`
+ // Kubernetes Secret 标签。
+ SecretLabels map[string]string `json:"secretLabels,omitempty"`
+}
+
+type Deployer struct {
+ config *DeployerConfig
+ logger *slog.Logger
+}
+
+var _ Provider = (*Deployer)(nil)
+
+func NewDeployer(config *DeployerConfig) (*Deployer, error) {
+ if config == nil {
+ return nil, fmt.Errorf("the configuration of the deployer provider is nil")
+ }
+
+ return &Deployer{
+ logger: slog.Default(),
+ config: config,
+ }, nil
+}
+
+func (d *Deployer) SetLogger(logger *slog.Logger) {
+ if logger == nil {
+ d.logger = slog.New(slog.DiscardHandler)
+ } else {
+ d.logger = logger
+ }
+}
+
+func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*DeployResult, error) {
+ if d.config.Namespace == "" {
+ return nil, fmt.Errorf("config `namespace` is required")
+ }
+ if d.config.SecretName == "" {
+ return nil, fmt.Errorf("config `secretName` is required")
+ }
+ if d.config.SecretType == "" {
+ return nil, fmt.Errorf("config `secretType` is required")
+ }
+
+ // 解析证书内容
+ certX509, err := xcert.ParseCertificateFromPEM(certPEM)
+ if err != nil {
+ return nil, err
+ }
+
+ // 提取服务器证书和中间证书
+ serverCertPEM, issuerCertPEM, err := xcert.ExtractCertificatesFromPEM(certPEM)
+ if err != nil {
+ return nil, fmt.Errorf("failed to extract certs: %w", err)
+ }
+
+ // 连接到 Kubernetes
+ client, err := createK8sClient(d.config.KubeConfig)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create kubernetes client: %w", err)
+ }
+
+ // 获取 Secret 实例
+ secretPayload := &k8score.Secret{}
+ secretIsNew := false
+ secretGetResp := client.Get().
+ Namespace(d.config.Namespace).
+ Resource("secrets").
+ Name(d.config.SecretName).
+ VersionedParams(&meta.GetOptions{}, meta.ParameterCodec).
+ Do(ctx)
+ if err := secretGetResp.Error(); err != nil {
+ if !k8serrs.IsNotFound(err) {
+ return nil, fmt.Errorf("failed to get kubernetes secret: %w", err)
+ }
+
+ secretPayload = &k8score.Secret{
+ Type: k8score.SecretType(d.config.SecretType),
+ TypeMeta: meta.TypeMeta{
+ Kind: "Secret",
+ APIVersion: "v1",
+ },
+ ObjectMeta: meta.ObjectMeta{
+ Name: d.config.SecretName,
+ },
+ }
+ secretIsNew = true
+ } else if err := secretGetResp.Into(secretPayload); err != nil {
+ return nil, fmt.Errorf("failed to parse kubernetes secret: %w", err)
+ }
+ d.logger.Debug("kubernetes operate 'Secrets.Get'", slog.String("namespace", d.config.Namespace), slog.Any("secret", d.config.SecretName))
+
+ // 生成 Secret 注解和标签
+ secretAnnotations := map[string]string{
+ "certimate/common-name": certX509.Subject.CommonName,
+ "certimate/subject-sn": certX509.Subject.SerialNumber,
+ "certimate/subject-alt-names": strings.Join(certX509.DNSNames, ","),
+ "certimate/issuer-sn": certX509.Issuer.SerialNumber,
+ "certimate/issuer-org": strings.Join(certX509.Issuer.Organization, ","),
+ }
+ secretLabels := map[string]string{}
+ if d.config.SecretAnnotations != nil {
+ xmaps.CopyTo(d.config.SecretAnnotations, secretAnnotations)
+ }
+ if d.config.SecretLabels != nil {
+ xmaps.CopyTo(d.config.SecretLabels, secretLabels)
+ }
+
+ // 赋值 Secret 实例
+ secretPayload.Type = k8score.SecretType(d.config.SecretType)
+ if secretPayload.ObjectMeta.Annotations == nil {
+ secretPayload.ObjectMeta.Annotations = secretAnnotations
+ } else {
+ xmaps.CopyTo(secretAnnotations, secretPayload.ObjectMeta.Annotations)
+ }
+ if secretPayload.ObjectMeta.Labels == nil {
+ secretPayload.ObjectMeta.Labels = secretLabels
+ } else {
+ xmaps.CopyTo(secretLabels, secretPayload.ObjectMeta.Labels)
+ }
+ if secretPayload.Data == nil {
+ secretPayload.Data = make(map[string][]byte)
+ }
+ if d.config.SecretDataKeyForKey != "" {
+ secretPayload.Data[d.config.SecretDataKeyForKey] = []byte(privkeyPEM)
+ }
+ if d.config.SecretDataKeyForCrt != "" {
+ secretPayload.Data[d.config.SecretDataKeyForCrt] = []byte(certPEM)
+ }
+ if d.config.SecretDataKeyForCrtOnlyServer != "" {
+ secretPayload.Data[d.config.SecretDataKeyForCrtOnlyServer] = []byte(serverCertPEM)
+ }
+ if d.config.SecretDataKeyForCrtOnlyIntermedia != "" {
+ secretPayload.Data[d.config.SecretDataKeyForCrtOnlyIntermedia] = []byte(issuerCertPEM)
+ }
+
+ // 创建或更新 Secret 实例
+ if secretIsNew {
+ secretPostResp := client.Post().
+ Namespace(d.config.Namespace).
+ Resource("secrets").
+ Name(d.config.SecretName).
+ VersionedParams(&meta.GetOptions{}, meta.ParameterCodec).
+ Body(secretPayload).
+ Do(ctx)
+ d.logger.Debug("kubernetes operate 'Secrets.Post'", slog.String("namespace", d.config.Namespace), slog.Any("secret", d.config.SecretName))
+ if err := secretPostResp.Error(); err != nil {
+ return nil, fmt.Errorf("failed to create kubernetes secret: %w", err)
+ }
+ } else {
+ secretPutResp := client.Put().
+ Namespace(d.config.Namespace).
+ Resource("secrets").
+ Name(d.config.SecretName).
+ VersionedParams(&meta.GetOptions{}, meta.ParameterCodec).
+ Body(secretPayload).
+ Do(ctx)
+ d.logger.Debug("kubernetes operate 'Secrets.Put'", slog.String("namespace", d.config.Namespace), slog.Any("secret", d.config.SecretName))
+ if err := secretPutResp.Error(); err != nil {
+ return nil, fmt.Errorf("failed to update kubernetes secret: %w", err)
+ }
+ }
+
+ return &DeployResult{}, nil
+}
+
+func createK8sClient(kubeConfig string) (*rest.RESTClient, error) {
+ var config *rest.Config
+ var err error
+ if kubeConfig == "" {
+ config, err = rest.InClusterConfig()
+ } else {
+ kubeConfig, err := clientcmd.NewClientConfigFromBytes([]byte(kubeConfig))
+ if err != nil {
+ return nil, err
+ }
+ config, err = kubeConfig.ClientConfig()
+ }
+ if err != nil {
+ return nil, err
+ }
+
+ // InClusterConfig does not set GroupVersion, NegotiatedSerializer or APIPath,
+ // but all of them are required by rest.RESTClientFor.
+ // Note that an empty APIPath makes every request target "/v1/namespaces/..."
+ // instead of "/api/v1/namespaces/...", which the API server rejects with
+ // 404 "the server could not find the requested resource".
+ if config.GroupVersion == nil {
+ config.GroupVersion = &schema.GroupVersion{Group: "", Version: "v1"}
+ }
+ if config.NegotiatedSerializer == nil {
+ config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
+ }
+ if config.APIPath == "" {
+ if config.GroupVersion.Group == "" {
+ config.APIPath = "/api"
+ } else {
+ config.APIPath = "/apis"
+ }
+ }
+
+ client, err := rest.RESTClientFor(config)
+ if err != nil {
+ return nil, err
+ }
+
+ return client, nil
+}
diff --git a/pkg/core/deployer/providers/k8s-secret/k8s_secret_test.go b/pkg/core/deployer/providers/k8s-secret/k8s_secret_test.go
new file mode 100644
index 000000000..df04a2f1f
--- /dev/null
+++ b/pkg/core/deployer/providers/k8s-secret/k8s_secret_test.go
@@ -0,0 +1,41 @@
+package k8ssecret
+
+import (
+ "strings"
+ "testing"
+)
+
+const testKubeConfig = `apiVersion: v1
+kind: Config
+clusters:
+ - name: test
+ cluster:
+ server: https://127.0.0.1:6443
+ insecure-skip-tls-verify: true
+contexts:
+ - name: test
+ context:
+ cluster: test
+ user: test
+current-context: test
+users:
+ - name: test
+ user:
+ token: test-token
+`
+
+// Secrets live in the core API group, which is served under "/api".
+// If APIPath is left empty, rest.RESTClientFor builds requests against
+// "/v1/namespaces/..." and the API server answers 404
+// ("the server could not find the requested resource").
+func TestCreateK8sClientSetsCoreAPIPath(t *testing.T) {
+ client, err := createK8sClient(testKubeConfig)
+ if err != nil {
+ t.Fatalf("createK8sClient() returned an unexpected error: %v", err)
+ }
+
+ const want = "/api/v1"
+ if got := client.Get().URL().Path; !strings.HasPrefix(got, want) {
+ t.Errorf("request path = %q, want it to start with %q", got, want)
+ }
+}
diff --git a/pkg/core/deployer/providers/proxmoxbs/proxmoxbs.go b/pkg/core/deployer/providers/proxmoxbs/proxmoxbs.go
new file mode 100644
index 000000000..99d89999a
--- /dev/null
+++ b/pkg/core/deployer/providers/proxmoxbs/proxmoxbs.go
@@ -0,0 +1,102 @@
+package proxmoxbs
+
+import (
+ "context"
+ "crypto/tls"
+ "fmt"
+ "log/slog"
+
+ "github.com/certimate-go/certimate/pkg/core"
+ pbssdk "github.com/certimate-go/certimate/pkg/sdk3rd/proxmoxbs"
+)
+
+type (
+ Provider = core.Deployer
+ DeployResult = core.DeployerDeployResult
+)
+
+type DeployerConfig struct {
+ // Proxmox BS 服务地址。
+ ServerUrl string `json:"serverUrl"`
+ // Proxmox BS API Token。
+ ApiToken string `json:"apiToken"`
+ // Proxmox BS API Token Secret。
+ ApiTokenSecret string `json:"apiTokenSecret"`
+ // 是否允许不安全的连接。
+ AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
+ // 节点名称。
+ NodeName string `json:"nodeName"`
+ // 是否自动重启。
+ AutoRestart bool `json:"autoRestart"`
+}
+
+type Deployer struct {
+ config *DeployerConfig
+ logger *slog.Logger
+ sdkClient *pbssdk.Client
+}
+
+var _ Provider = (*Deployer)(nil)
+
+func NewDeployer(config *DeployerConfig) (*Deployer, error) {
+ if config == nil {
+ return nil, fmt.Errorf("the configuration of the deployer provider is nil")
+ }
+
+ client, err := createSDKClient(config.ServerUrl, config.ApiToken, config.ApiTokenSecret, config.AllowInsecureConnections)
+ if err != nil {
+ return nil, fmt.Errorf("could not create client: %w", err)
+ }
+
+ return &Deployer{
+ config: config,
+ logger: slog.Default(),
+ sdkClient: client,
+ }, nil
+}
+
+func (d *Deployer) SetLogger(logger *slog.Logger) {
+ if logger == nil {
+ d.logger = slog.New(slog.DiscardHandler)
+ } else {
+ d.logger = logger
+ }
+}
+
+func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*DeployResult, error) {
+ if d.config.NodeName == "" {
+ return nil, fmt.Errorf("config `nodeName` is required")
+ }
+
+ // 上传自定义证书
+ // REF: https://pbs.proxmox.com/docs/api-viewer/index.html#/nodes/{node}/certificates/custom
+ nodeUploadCustomCertificateReq := &pbssdk.NodeUploadCustomCertificateRequest{
+ Certificates: certPEM,
+ Key: privkeyPEM,
+ Force: true,
+ Restart: d.config.AutoRestart,
+ }
+ nodeUploadCustomCertificateResp, err := d.sdkClient.NodeUploadCustomCertificateWithContext(ctx, d.config.NodeName, nodeUploadCustomCertificateReq)
+ d.logger.Debug("sdk request 'node.UploadCustomCertificate'", slog.String("params.node", d.config.NodeName), slog.Any("request", nodeUploadCustomCertificateReq), slog.Any("response", nodeUploadCustomCertificateResp))
+ if err != nil {
+ return nil, fmt.Errorf("failed to execute sdk request 'node.UploadCustomCertificate': %w", err)
+ }
+
+ return &DeployResult{}, nil
+}
+
+func createSDKClient(serverUrl, apiToken, apiTokenSecret string, skipTlsVerify bool) (*pbssdk.Client, error) {
+ client, err := pbssdk.NewClient(
+ serverUrl,
+ pbssdk.WithApiToken(apiToken, apiTokenSecret),
+ )
+ if err != nil {
+ return nil, err
+ }
+
+ if skipTlsVerify {
+ client.SetTLSConfig(&tls.Config{InsecureSkipVerify: true})
+ }
+
+ return client, nil
+}
diff --git a/pkg/core/deployer/providers/proxmoxve/proxmoxve.go b/pkg/core/deployer/providers/proxmoxve/proxmoxve.go
index fdc5987ec..dae860968 100644
--- a/pkg/core/deployer/providers/proxmoxve/proxmoxve.go
+++ b/pkg/core/deployer/providers/proxmoxve/proxmoxve.go
@@ -7,7 +7,7 @@ import (
"log/slog"
"github.com/certimate-go/certimate/pkg/core"
- proxmoxvesdk "github.com/certimate-go/certimate/pkg/sdk3rd/proxmoxve"
+ pvesdk "github.com/certimate-go/certimate/pkg/sdk3rd/proxmoxve"
)
type (
@@ -21,10 +21,10 @@ type DeployerConfig struct {
// Proxmox VE API Token。
ApiToken string `json:"apiToken"`
// Proxmox VE API Token Secret。
- ApiTokenSecret string `json:"apiTokenSecret,omitempty"`
+ ApiTokenSecret string `json:"apiTokenSecret"`
// 是否允许不安全的连接。
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
- // 集群节点名称。
+ // 节点名称。
NodeName string `json:"nodeName"`
// 是否自动重启。
AutoRestart bool `json:"autoRestart"`
@@ -33,7 +33,7 @@ type DeployerConfig struct {
type Deployer struct {
config *DeployerConfig
logger *slog.Logger
- sdkClient *proxmoxvesdk.Client
+ sdkClient *pvesdk.Client
}
var _ Provider = (*Deployer)(nil)
@@ -70,7 +70,7 @@ func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*Dep
// 上传自定义证书
// REF: https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/certificates/custom
- nodeUploadCustomCertificateReq := &proxmoxvesdk.NodeUploadCustomCertificateRequest{
+ nodeUploadCustomCertificateReq := &pvesdk.NodeUploadCustomCertificateRequest{
Certificates: certPEM,
Key: privkeyPEM,
Force: true,
@@ -85,9 +85,10 @@ func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*Dep
return &DeployResult{}, nil
}
-func createSDKClient(serverUrl, apiToken, apiTokenSecret string, skipTlsVerify bool) (*proxmoxvesdk.Client, error) {
- client, err := proxmoxvesdk.NewClient(serverUrl,
- proxmoxvesdk.WithApiToken(apiToken, apiTokenSecret),
+func createSDKClient(serverUrl, apiToken, apiTokenSecret string, skipTlsVerify bool) (*pvesdk.Client, error) {
+ client, err := pvesdk.NewClient(
+ serverUrl,
+ pvesdk.WithApiToken(apiToken, apiTokenSecret),
)
if err != nil {
return nil, err
diff --git a/pkg/core/deployer/providers/ucloud-ucdn/ucloud_ucdn.go b/pkg/core/deployer/providers/ucloud-ucdn/ucloud_ucdn.go
index f2ed86ece..686ccf888 100644
--- a/pkg/core/deployer/providers/ucloud-ucdn/ucloud_ucdn.go
+++ b/pkg/core/deployer/providers/ucloud-ucdn/ucloud_ucdn.go
@@ -7,6 +7,7 @@ import (
"strconv"
"strings"
+ "github.com/samber/lo"
"github.com/ucloud/ucloud-sdk-go/ucloud"
"github.com/ucloud/ucloud-sdk-go/ucloud/auth"
@@ -95,14 +96,19 @@ func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*Dep
// 获取加速域名配置
// REF: https://docs.ucloud.cn/api/ucdn-api/get_ucdn_domain_config
+ var domainConfigInfo ucloudsdk.DomainConfigInfo
getUcdnDomainConfigReq := d.sdkClient.NewGetUcdnDomainConfigRequest()
getUcdnDomainConfigReq.DomainId = []string{d.config.DomainId}
getUcdnDomainConfigResp, err := d.sdkClient.GetUcdnDomainConfig(getUcdnDomainConfigReq)
d.logger.Debug("sdk request 'ucdn.GetUcdnDomainConfig'", slog.Any("request", getUcdnDomainConfigReq), slog.Any("response", getUcdnDomainConfigResp))
if err != nil {
return nil, fmt.Errorf("failed to execute sdk request 'ucdn.GetUcdnDomainConfig': %w", err)
- } else if len(getUcdnDomainConfigResp.DomainList) == 0 {
- return nil, fmt.Errorf("could not find domain '%s'", d.config.DomainId)
+ } else {
+ if len(getUcdnDomainConfigResp.DomainList) == 0 {
+ return nil, fmt.Errorf("could not find domain '%s'", d.config.DomainId)
+ }
+
+ domainConfigInfo = getUcdnDomainConfigResp.DomainList[0]
}
// 更新 HTTPS 加速配置
@@ -110,9 +116,12 @@ func (d *Deployer) Deploy(ctx context.Context, certPEM, privkeyPEM string) (*Dep
certId, _ := strconv.Atoi(upres.CertId)
updateUcdnDomainHttpsConfigV2Req := d.sdkClient.NewUpdateUcdnDomainHttpsConfigV2Request()
updateUcdnDomainHttpsConfigV2Req.DomainId = ucloud.String(d.config.DomainId)
- updateUcdnDomainHttpsConfigV2Req.HttpsStatusCn = ucloud.String(getUcdnDomainConfigResp.DomainList[0].HttpsStatusCn)
- updateUcdnDomainHttpsConfigV2Req.HttpsStatusAbroad = ucloud.String(getUcdnDomainConfigResp.DomainList[0].HttpsStatusAbroad)
- updateUcdnDomainHttpsConfigV2Req.HttpsStatusAbroad = ucloud.String(getUcdnDomainConfigResp.DomainList[0].HttpsStatusAbroad)
+ updateUcdnDomainHttpsConfigV2Req.HttpsStatusCn = lo.
+ IfF(domainConfigInfo.AreaCode == "all" || domainConfigInfo.AreaCode == "cn", func() *string { return ucloud.String(domainConfigInfo.HttpsStatusCn) }).
+ Else(nil)
+ updateUcdnDomainHttpsConfigV2Req.HttpsStatusAbroad = lo.
+ IfF(domainConfigInfo.AreaCode == "all" || domainConfigInfo.AreaCode == "abroad", func() *string { return ucloud.String(domainConfigInfo.HttpsStatusAbroad) }).
+ Else(nil)
updateUcdnDomainHttpsConfigV2Req.CertId = ucloud.Int(certId)
updateUcdnDomainHttpsConfigV2Req.CertName = ucloud.String(upres.CertName)
updateUcdnDomainHttpsConfigV2Req.CertType = ucloud.String("ussl")
diff --git a/pkg/core/deployer/testing/args.go b/pkg/core/deployer/testing/args.go
deleted file mode 100644
index 077fd3fa6..000000000
--- a/pkg/core/deployer/testing/args.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package testing
-
-import (
- "github.com/certimate-go/certimate/pkg/core/internal/testing"
-)
-
-func Args(prefix string) testing.ArgsParser {
- return testing.Args(prefix)
-}
diff --git a/pkg/core/errors.go b/pkg/core/errors.go
index aeb984262..f741e43a4 100644
--- a/pkg/core/errors.go
+++ b/pkg/core/errors.go
@@ -1,4 +1,4 @@
-package core
+package core
import (
"errors"
diff --git a/pkg/core/internal/testing/argsparser.go b/pkg/core/internal/testing/argsparser.go
index 559e1a04f..e03ec8e76 100644
--- a/pkg/core/internal/testing/argsparser.go
+++ b/pkg/core/internal/testing/argsparser.go
@@ -20,7 +20,7 @@ type argsParser struct {
vals []any
}
-func Args(prefix string) ArgsParser {
+func InitArgs(prefix string) ArgsParser {
return &argsParser{
prefix: prefix,
keys: make([]string, 0),
diff --git a/pkg/core/notifier/providers/dingtalkbot/dingtalkbot_test.go b/pkg/core/notifier/providers-tester/dingtalkbot/dingtalkbot_test.go
similarity index 73%
rename from pkg/core/notifier/providers/dingtalkbot/dingtalkbot_test.go
rename to pkg/core/notifier/providers-tester/dingtalkbot/dingtalkbot_test.go
index 38fe32e57..1c8611205 100644
--- a/pkg/core/notifier/providers/dingtalkbot/dingtalkbot_test.go
+++ b/pkg/core/notifier/providers-tester/dingtalkbot/dingtalkbot_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package dingtalkbot_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/dingtalkbot"
- it "github.com/certimate-go/certimate/pkg/core/notifier/testing"
)
var (
- fp = it.Args("DINGTALKBOT_")
+ fp = tester.InitArgs("DINGTALKBOT_")
fWebhookUrl string
fSecret string
)
@@ -23,7 +25,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./dingtalkbot_test.go -args \
+ go test -tags=tester -v ./dingtalkbot_test.go -args \
--DINGTALKBOT_WEBHOOKURL="https://example.com/your-webhook-url" \
--DINGTALKBOT_SECRET="your-secret"
*/
@@ -37,6 +39,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestNotify(t, provider, it.TestNotifyArgs{})
+ tester.Notify(t, provider, tester.NotifyInput{})
})
}
diff --git a/pkg/core/notifier/providers/discordbot/discordbot_test.go b/pkg/core/notifier/providers-tester/discordbot/discordbot_test.go
similarity index 73%
rename from pkg/core/notifier/providers/discordbot/discordbot_test.go
rename to pkg/core/notifier/providers-tester/discordbot/discordbot_test.go
index 7f54c8c4e..837ac9942 100644
--- a/pkg/core/notifier/providers/discordbot/discordbot_test.go
+++ b/pkg/core/notifier/providers-tester/discordbot/discordbot_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package discordbot_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/discordbot"
- it "github.com/certimate-go/certimate/pkg/core/notifier/testing"
)
var (
- fp = it.Args("DISCORDBOT_")
+ fp = tester.InitArgs("DISCORDBOT_")
fApiToken string
fChannelId string
)
@@ -23,7 +25,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./discordbot_test.go -args \
+ go test -tags=tester -v ./discordbot_test.go -args \
--DISCORDBOT_APITOKEN="your-bot-token" \
--DISCORDBOT_CHANNELID="your-channel-id"
*/
@@ -37,6 +39,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestNotify(t, provider, it.TestNotifyArgs{})
+ tester.Notify(t, provider, tester.NotifyInput{})
})
}
diff --git a/pkg/core/notifier/providers/email/email_test.go b/pkg/core/notifier/providers-tester/email/email_test.go
similarity index 86%
rename from pkg/core/notifier/providers/email/email_test.go
rename to pkg/core/notifier/providers-tester/email/email_test.go
index ccfafe622..552a2afd2 100644
--- a/pkg/core/notifier/providers/email/email_test.go
+++ b/pkg/core/notifier/providers-tester/email/email_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package email_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/email"
- it "github.com/certimate-go/certimate/pkg/core/notifier/testing"
)
var (
- fp = it.Args("EMAIL_")
+ fp = tester.InitArgs("EMAIL_")
fSmtpHost string
fSmtpPort int64
fSmtpTLS bool
@@ -33,7 +35,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./email_test.go -args \
+ go test -tags=tester -v ./email_test.go -args \
--EMAIL_SMTPHOST="smtp.example.com" \
--EMAIL_SMTPPORT=465 \
--EMAIL_SMTPTLS=true \
@@ -57,7 +59,7 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestNotify(t, provider, it.TestNotifyArgs{})
+ tester.Notify(t, provider, tester.NotifyInput{})
})
t.Run("Notify_Html", func(t *testing.T) {
@@ -77,6 +79,6 @@ func TestProvider(t *testing.T) {
}
const mockHtml = "
Hello Certimate!
Google"
- it.TestNotify(t, provider, it.TestNotifyArgs{Message: mockHtml})
+ tester.Notify(t, provider, tester.NotifyInput{Message: mockHtml})
})
}
diff --git a/pkg/core/notifier/providers/larkbot/larkbot_test.go b/pkg/core/notifier/providers-tester/larkbot/larkbot_test.go
similarity index 73%
rename from pkg/core/notifier/providers/larkbot/larkbot_test.go
rename to pkg/core/notifier/providers-tester/larkbot/larkbot_test.go
index 4142f0cb1..2c9d17127 100644
--- a/pkg/core/notifier/providers/larkbot/larkbot_test.go
+++ b/pkg/core/notifier/providers-tester/larkbot/larkbot_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package larkbot_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/larkbot"
- it "github.com/certimate-go/certimate/pkg/core/notifier/testing"
)
var (
- fp = it.Args("LARKBOT_")
+ fp = tester.InitArgs("LARKBOT_")
fWebhookUrl string
fSecret string
)
@@ -23,7 +25,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./larkbot_test.go -args \
+ go test -tags=tester -v ./larkbot_test.go -args \
--LARKBOT_WEBHOOKURL="https://example.com/your-webhook-url" \
--LARKBOT_SECRET="your-secret"
*/
@@ -37,6 +39,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestNotify(t, provider, it.TestNotifyArgs{})
+ tester.Notify(t, provider, tester.NotifyInput{})
})
}
diff --git a/pkg/core/notifier/providers/matrix/matrix_test.go b/pkg/core/notifier/providers-tester/matrix/matrix_test.go
similarity index 79%
rename from pkg/core/notifier/providers/matrix/matrix_test.go
rename to pkg/core/notifier/providers-tester/matrix/matrix_test.go
index b8d5f1cef..7778364f7 100644
--- a/pkg/core/notifier/providers/matrix/matrix_test.go
+++ b/pkg/core/notifier/providers-tester/matrix/matrix_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package matrix_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/matrix"
- it "github.com/certimate-go/certimate/pkg/core/notifier/testing"
)
var (
- fp = it.Args("MATRIX_")
+ fp = tester.InitArgs("MATRIX_")
fServerUrl string
fUserId string
fAccessToken string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./matrix_test.go -args \
+ go test -tags=tester -v ./matrix_test.go -args \
--MATRIX_SERVERURL="https://example.com/your-matrix-server" \
--MATRIX_USERID="@bot:example.org" \
--MATRIX_ACCESSTOKEN="your-access-token" \
@@ -45,6 +47,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestNotify(t, provider, it.TestNotifyArgs{})
+ tester.Notify(t, provider, tester.NotifyInput{})
})
}
diff --git a/pkg/core/notifier/providers/mattermost/mattermost_test.go b/pkg/core/notifier/providers-tester/mattermost/mattermost_test.go
similarity index 79%
rename from pkg/core/notifier/providers/mattermost/mattermost_test.go
rename to pkg/core/notifier/providers-tester/mattermost/mattermost_test.go
index 8bb176d94..a4c050040 100644
--- a/pkg/core/notifier/providers/mattermost/mattermost_test.go
+++ b/pkg/core/notifier/providers-tester/mattermost/mattermost_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package mattermost_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/mattermost"
- it "github.com/certimate-go/certimate/pkg/core/notifier/testing"
)
var (
- fp = it.Args("MATTERMOST_")
+ fp = tester.InitArgs("MATTERMOST_")
fServerUrl string
fChannelId string
fUsername string
@@ -27,7 +29,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./mattermost_test.go -args \
+ go test -tags=tester -v ./mattermost_test.go -args \
--MATTERMOST_SERVERURL="https://example.com/your-server-url" \
--MATTERMOST_CHANNELID="your-chanel-id" \
--MATTERMOST_USERNAME="your-username" \
@@ -45,6 +47,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestNotify(t, provider, it.TestNotifyArgs{})
+ tester.Notify(t, provider, tester.NotifyInput{})
})
}
diff --git a/pkg/core/notifier/providers/slackbot/slackbot_test.go b/pkg/core/notifier/providers-tester/slackbot/slackbot_test.go
similarity index 73%
rename from pkg/core/notifier/providers/slackbot/slackbot_test.go
rename to pkg/core/notifier/providers-tester/slackbot/slackbot_test.go
index 423b78c94..deb9a4a44 100644
--- a/pkg/core/notifier/providers/slackbot/slackbot_test.go
+++ b/pkg/core/notifier/providers-tester/slackbot/slackbot_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package slackbot_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/slackbot"
- it "github.com/certimate-go/certimate/pkg/core/notifier/testing"
)
var (
- fp = it.Args("SLACKBOT_")
+ fp = tester.InitArgs("SLACKBOT_")
fApiToken string
fChannelId string
)
@@ -23,7 +25,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./slackbot_test.go -args \
+ go test -tags=tester -v ./slackbot_test.go -args \
--SLACKBOT_APITOKEN="your-bot-token" \
--SLACKBOT_CHANNELID="your-channel-id"
*/
@@ -37,6 +39,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestNotify(t, provider, it.TestNotifyArgs{})
+ tester.Notify(t, provider, tester.NotifyInput{})
})
}
diff --git a/pkg/core/notifier/providers/telegrambot/telegrambot_test.go b/pkg/core/notifier/providers-tester/telegrambot/telegrambot_test.go
similarity index 72%
rename from pkg/core/notifier/providers/telegrambot/telegrambot_test.go
rename to pkg/core/notifier/providers-tester/telegrambot/telegrambot_test.go
index 91a2928f4..c8c7afe0d 100644
--- a/pkg/core/notifier/providers/telegrambot/telegrambot_test.go
+++ b/pkg/core/notifier/providers-tester/telegrambot/telegrambot_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package telegrambot_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/telegrambot"
- it "github.com/certimate-go/certimate/pkg/core/notifier/testing"
)
var (
- fp = it.Args("TELEGRAMBOT_")
+ fp = tester.InitArgs("TELEGRAMBOT_")
fApiToken string
fChatId string
)
@@ -23,7 +25,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./telegrambot_test.go -args \
+ go test -tags=tester -v ./telegrambot_test.go -args \
--TELEGRAMBOT_APITOKEN="your-api-token" \
--TELEGRAMBOT_CHATID="your-chat-id"
*/
@@ -37,6 +39,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestNotify(t, provider, it.TestNotifyArgs{})
+ tester.Notify(t, provider, tester.NotifyInput{})
})
}
diff --git a/pkg/core/notifier/testing/testing.go b/pkg/core/notifier/providers-tester/tester.go
similarity index 57%
rename from pkg/core/notifier/testing/testing.go
rename to pkg/core/notifier/providers-tester/tester.go
index e8eb51ec2..53e2e6c4e 100644
--- a/pkg/core/notifier/testing/testing.go
+++ b/pkg/core/notifier/providers-tester/tester.go
@@ -1,4 +1,6 @@
-package testing
+//go:build tester
+
+package tester
import (
"context"
@@ -17,21 +19,21 @@ const (
mockMessage = "test_message"
)
-type TestNotifyArgs struct {
+type NotifyInput struct {
Subject string
Message string
}
-func TestNotify(t *testing.T, testProvider notifier.Provider, testArgs TestNotifyArgs) {
+func Notify(t *testing.T, provider notifier.Provider, input NotifyInput) {
ctx := context.Background()
- message := lo.Ternary(testArgs.Message != "", testArgs.Message, mockMessage)
- subject := lo.Ternary(testArgs.Subject != "", testArgs.Subject, mockSubject)
+ message := lo.Ternary(input.Message != "", input.Message, mockMessage)
+ subject := lo.Ternary(input.Subject != "", input.Subject, mockSubject)
logger := slog.Default()
logger.Enabled(ctx, slog.LevelDebug)
- testProvider.SetLogger(logger)
+ provider.SetLogger(logger)
- res, err := testProvider.Notify(ctx, message, subject)
+ res, err := provider.Notify(ctx, message, subject)
require.NoError(t, err)
require.NotNil(t, res)
diff --git a/pkg/core/notifier/providers-tester/tester_args.go b/pkg/core/notifier/providers-tester/tester_args.go
new file mode 100644
index 000000000..110391f3d
--- /dev/null
+++ b/pkg/core/notifier/providers-tester/tester_args.go
@@ -0,0 +1,11 @@
+//go:build tester
+
+package tester
+
+import (
+ "github.com/certimate-go/certimate/pkg/core/internal/testing"
+)
+
+func InitArgs(prefix string) testing.ArgsParser {
+ return testing.InitArgs(prefix)
+}
diff --git a/pkg/core/notifier/providers/webhook/webhook_test.go b/pkg/core/notifier/providers-tester/webhook/webhook_test.go
similarity index 76%
rename from pkg/core/notifier/providers/webhook/webhook_test.go
rename to pkg/core/notifier/providers-tester/webhook/webhook_test.go
index ba0ad24d1..3c4dd78ce 100644
--- a/pkg/core/notifier/providers/webhook/webhook_test.go
+++ b/pkg/core/notifier/providers-tester/webhook/webhook_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package webhook_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/webhook"
- it "github.com/certimate-go/certimate/pkg/core/notifier/testing"
)
var (
- fp = it.Args("WEBHOOK_")
+ fp = tester.InitArgs("WEBHOOK_")
fWebhookUrl string
fWebhookContentType string
)
@@ -23,7 +25,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./webhook_test.go -args \
+ go test -tags=tester -v ./webhook_test.go -args \
--WEBHOOK_URL="https://example.com/your-webhook-url" \
--WEBHOOK_CONTENTTYPE="application/json"
*/
@@ -41,6 +43,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestNotify(t, provider, it.TestNotifyArgs{})
+ tester.Notify(t, provider, tester.NotifyInput{})
})
}
diff --git a/pkg/core/notifier/providers/wecombot/wecombot_test.go b/pkg/core/notifier/providers-tester/wecombot/wecombot_test.go
similarity index 69%
rename from pkg/core/notifier/providers/wecombot/wecombot_test.go
rename to pkg/core/notifier/providers-tester/wecombot/wecombot_test.go
index e249d49d5..c5128f649 100644
--- a/pkg/core/notifier/providers/wecombot/wecombot_test.go
+++ b/pkg/core/notifier/providers-tester/wecombot/wecombot_test.go
@@ -1,3 +1,5 @@
+//go:build tester
+
package wecombot_test
import (
@@ -5,12 +7,12 @@ import (
"github.com/stretchr/testify/require"
+ tester "github.com/certimate-go/certimate/pkg/core/notifier/providers-tester"
impl "github.com/certimate-go/certimate/pkg/core/notifier/providers/wecombot"
- it "github.com/certimate-go/certimate/pkg/core/notifier/testing"
)
var (
- fp = it.Args("WECOMBOT_")
+ fp = tester.InitArgs("WECOMBOT_")
fWebhookUrl string
)
@@ -21,7 +23,7 @@ func init() {
/*
Shell command to run this test:
- go test -v ./wecombot_test.go -args \
+ go test -tags=tester -v ./wecombot_test.go -args \
--WECOMBOT_WEBHOOKURL="https://example.com/your-webhook-url" \
*/
func TestProvider(t *testing.T) {
@@ -33,6 +35,6 @@ func TestProvider(t *testing.T) {
})
require.NoError(t, err)
- it.TestNotify(t, provider, it.TestNotifyArgs{})
+ tester.Notify(t, provider, tester.NotifyInput{})
})
}
diff --git a/pkg/core/notifier/testing/args.go b/pkg/core/notifier/testing/args.go
deleted file mode 100644
index 077fd3fa6..000000000
--- a/pkg/core/notifier/testing/args.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package testing
-
-import (
- "github.com/certimate-go/certimate/pkg/core/internal/testing"
-)
-
-func Args(prefix string) testing.ArgsParser {
- return testing.Args(prefix)
-}
diff --git a/pkg/core/shared.go b/pkg/core/shared.go
index fb9b0ea45..13f7522ed 100644
--- a/pkg/core/shared.go
+++ b/pkg/core/shared.go
@@ -1,4 +1,4 @@
-package core
+package core
import (
"log/slog"
diff --git a/pkg/logging/handler_named.go b/pkg/logging/handler_named.go
index e1a8fc40f..a3e7b77c5 100644
--- a/pkg/logging/handler_named.go
+++ b/pkg/logging/handler_named.go
@@ -1,4 +1,4 @@
-package logging
+package logging
import (
"context"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/client.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/client.go
index 81fb5ba9d..17a0f497c 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/client.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/client.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/client_context_func.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/client_context_func.go
index 94f58a4b2..b881f3492 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/client_context_func.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/client_context_func.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"context"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/models.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/models.go
index c78395287..209e472ef 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/models.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/alb-20200616/v2/client/models.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"github.com/alibabacloud-go/alb-20200616/v2/client"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/client.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/client.go
index 81fb5ba9d..17a0f497c 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/client.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/client.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/client_context_func.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/client_context_func.go
index 711387995..74ccad249 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/client_context_func.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/client_context_func.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"context"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/models.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/models.go
index d671c5e00..7620a95a8 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/models.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/apig-20240327/v10/client/models.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"github.com/alibabacloud-go/apig-20240327/v10/client"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cas-20200407/v4/client/client.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cas-20200407/v4/client/client.go
index 81fb5ba9d..17a0f497c 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cas-20200407/v4/client/client.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cas-20200407/v4/client/client.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cas-20200407/v4/client/models.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cas-20200407/v4/client/models.go
index 47eb85126..a0d64dee0 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cas-20200407/v4/client/models.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cas-20200407/v4/client/models.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"github.com/alibabacloud-go/cas-20200407/v4/client"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/client.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/client.go
index 81fb5ba9d..17a0f497c 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/client.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/client.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/client_context_func.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/client_context_func.go
index 1d92a66d6..ec3c8086c 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/client_context_func.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/client_context_func.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"context"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/models.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/models.go
index 3792f899e..923540a65 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/models.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/cloudapi-20160714/v5/client/models.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"github.com/alibabacloud-go/cloudapi-20160714/v5/client"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/fc-open-20210406/v2/client/models.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/fc-open-20210406/v2/client/models.go
index 76b28f0c8..65e09c609 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/fc-open-20210406/v2/client/models.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/fc-open-20210406/v2/client/models.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"github.com/alibabacloud-go/fc-open-20210406/v2/client"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/client.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/client.go
index 8ddf8a551..4056b04ea 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/client.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/client.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/client_context_func.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/client_context_func.go
index 73a499d15..b05013e21 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/client_context_func.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/client_context_func.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"context"
diff --git a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/models.go b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/models.go
index 47ed02102..250c56eee 100644
--- a/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/models.go
+++ b/pkg/sdk3rd-trimmed/github.com/alibabacloud-go/slb-20140515/v4/client/models.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"github.com/alibabacloud-go/slb-20140515/v4/client"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_listener_attributes.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_listener_attributes.go
index 5045a0a50..e93613ed9 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_listener_attributes.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_listener_attributes.go
@@ -1,4 +1,4 @@
-package alb
+package alb
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_listeners.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_listeners.go
index be071b31b..0edc42686 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_listeners.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_listeners.go
@@ -1,4 +1,4 @@
-package alb
+package alb
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_load_balancer_attributes.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_load_balancer_attributes.go
index 8f93668f0..740cdeedc 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_load_balancer_attributes.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_describe_load_balancer_attributes.go
@@ -1,4 +1,4 @@
-package alb
+package alb
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_modify_listener_attributes.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_modify_listener_attributes.go
index a755c1710..819b5cc38 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_modify_listener_attributes.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/api_modify_listener_attributes.go
@@ -1,4 +1,4 @@
-package alb
+package alb
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/service_alb.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/service_alb.go
index 4e7ced9fe..910ea3552 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/service_alb.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/alb/service_alb.go
@@ -1,4 +1,4 @@
-package alb
+package alb
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_get_custom_domain.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_get_custom_domain.go
index 12d8b6476..5a76a03e6 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_get_custom_domain.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_get_custom_domain.go
@@ -1,4 +1,4 @@
-package apig
+package apig
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_list_custom_domains.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_list_custom_domains.go
index 424299ed3..b285fc23a 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_list_custom_domains.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_list_custom_domains.go
@@ -1,4 +1,4 @@
-package apig
+package apig
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_update_custom_domain.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_update_custom_domain.go
index 5b726b07c..46370e621 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_update_custom_domain.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/api_update_custom_domain.go
@@ -1,4 +1,4 @@
-package apig
+package apig
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/service_apig.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/service_apig.go
index 3fff27caf..d72f9e813 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/service_apig.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/apig/service_apig.go
@@ -1,4 +1,4 @@
-package apig
+package apig
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/certificateservice/api_upload_certificate.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/certificateservice/api_upload_certificate.go
index 998cbe424..03e478c8d 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/certificateservice/api_upload_certificate.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/certificateservice/api_upload_certificate.go
@@ -1,4 +1,4 @@
-package certificateservice
+package certificateservice
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/certificateservice/service_certificateservice.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/certificateservice/service_certificateservice.go
index 520566ab2..592b8c0fb 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/certificateservice/service_certificateservice.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/certificateservice/service_certificateservice.go
@@ -1,4 +1,4 @@
-package certificateservice
+package certificateservice
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_describe_listeners.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_describe_listeners.go
index 448038345..4a1b08db9 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_describe_listeners.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_describe_listeners.go
@@ -1,4 +1,4 @@
-package clb
+package clb
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_describe_load_balancer_attributes.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_describe_load_balancer_attributes.go
index 97c472d3e..787fc20ff 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_describe_load_balancer_attributes.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_describe_load_balancer_attributes.go
@@ -1,4 +1,4 @@
-package clb
+package clb
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_modify_listener_attributes.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_modify_listener_attributes.go
index 842c1a9a7..b96f92de4 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_modify_listener_attributes.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/api_modify_listener_attributes.go
@@ -1,4 +1,4 @@
-package clb
+package clb
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/service_clb.go b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/service_clb.go
index b463a8344..d9ebb5c4c 100644
--- a/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/service_clb.go
+++ b/pkg/sdk3rd-trimmed/github.com/byteplus-sdk/byteplus-go-sdk-v2/service/clb/service_clb.go
@@ -1,4 +1,4 @@
-package clb
+package clb
import (
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
diff --git a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v1/aad_client.go b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v1/aad_client.go
index 3a2407978..698ab059a 100644
--- a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v1/aad_client.go
+++ b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v1/aad_client.go
@@ -1,4 +1,4 @@
-package v1
+package v1
import (
httpclient "github.com/huaweicloud/huaweicloud-sdk-go-v3/core"
diff --git a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v1/aad_meta.go b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v1/aad_meta.go
index f4765a64d..1e1ede44f 100644
--- a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v1/aad_meta.go
+++ b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v1/aad_meta.go
@@ -1,4 +1,4 @@
-package v1
+package v1
import (
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/def"
diff --git a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v2/aad_client.go b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v2/aad_client.go
index 093a68dd3..65af62270 100644
--- a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v2/aad_client.go
+++ b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v2/aad_client.go
@@ -1,4 +1,4 @@
-package v2
+package v2
import (
httpclient "github.com/huaweicloud/huaweicloud-sdk-go-v3/core"
diff --git a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v2/aad_meta.go b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v2/aad_meta.go
index 7422de62e..648b801bd 100644
--- a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v2/aad_meta.go
+++ b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/aad/v2/aad_meta.go
@@ -1,4 +1,4 @@
-package v2
+package v2
import (
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/def"
diff --git a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/elb_client.go b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/elb_client.go
index 43e30a4a5..88284297a 100644
--- a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/elb_client.go
+++ b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/elb_client.go
@@ -1,4 +1,4 @@
-package v3
+package v3
import (
httpclient "github.com/huaweicloud/huaweicloud-sdk-go-v3/core"
diff --git a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/elb_meta.go b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/elb_meta.go
index c56abea61..29fd1654e 100644
--- a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/elb_meta.go
+++ b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/elb_meta.go
@@ -1,4 +1,4 @@
-package v3
+package v3
import (
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/def"
diff --git a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/scm/v3/scm_client.go b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/scm/v3/scm_client.go
index 772924de2..e50ff7b8b 100644
--- a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/scm/v3/scm_client.go
+++ b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/scm/v3/scm_client.go
@@ -1,4 +1,4 @@
-package v3
+package v3
import (
httpclient "github.com/huaweicloud/huaweicloud-sdk-go-v3/core"
diff --git a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/scm/v3/scm_meta.go b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/scm/v3/scm_meta.go
index a4c811f42..0de3bef10 100644
--- a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/scm/v3/scm_meta.go
+++ b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/scm/v3/scm_meta.go
@@ -1,4 +1,4 @@
-package v3
+package v3
import (
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/def"
diff --git a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/waf/v1/waf_client.go b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/waf/v1/waf_client.go
index 71b79518d..0bf385ad1 100644
--- a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/waf/v1/waf_client.go
+++ b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/waf/v1/waf_client.go
@@ -1,4 +1,4 @@
-package v1
+package v1
import (
httpclient "github.com/huaweicloud/huaweicloud-sdk-go-v3/core"
diff --git a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/waf/v1/waf_meta.go b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/waf/v1/waf_meta.go
index 1f908807f..40106e203 100644
--- a/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/waf/v1/waf_meta.go
+++ b/pkg/sdk3rd-trimmed/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/waf/v1/waf_meta.go
@@ -1,4 +1,4 @@
-package v1
+package v1
import (
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/def"
diff --git a/pkg/sdk3rd-trimmed/github.com/jdcloud-api/jdcloud-sdk-go/services/lb/client/LbClient.go b/pkg/sdk3rd-trimmed/github.com/jdcloud-api/jdcloud-sdk-go/services/lb/client/LbClient.go
index 4042b82ce..c6b0984c3 100644
--- a/pkg/sdk3rd-trimmed/github.com/jdcloud-api/jdcloud-sdk-go/services/lb/client/LbClient.go
+++ b/pkg/sdk3rd-trimmed/github.com/jdcloud-api/jdcloud-sdk-go/services/lb/client/LbClient.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"encoding/json"
diff --git a/pkg/sdk3rd-trimmed/github.com/jdcloud-api/jdcloud-sdk-go/services/ssl/client/SslClient.go b/pkg/sdk3rd-trimmed/github.com/jdcloud-api/jdcloud-sdk-go/services/ssl/client/SslClient.go
index f1cab7786..3b1a734dd 100644
--- a/pkg/sdk3rd-trimmed/github.com/jdcloud-api/jdcloud-sdk-go/services/ssl/client/SslClient.go
+++ b/pkg/sdk3rd-trimmed/github.com/jdcloud-api/jdcloud-sdk-go/services/ssl/client/SslClient.go
@@ -1,4 +1,4 @@
-package client
+package client
import (
"encoding/json"
diff --git a/pkg/sdk3rd-trimmed/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205/client.go b/pkg/sdk3rd-trimmed/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205/client.go
index 597aea734..c800b4a40 100644
--- a/pkg/sdk3rd-trimmed/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205/client.go
+++ b/pkg/sdk3rd-trimmed/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205/client.go
@@ -1,4 +1,4 @@
-package v20191205
+package v20191205
import (
"context"
diff --git a/pkg/sdk3rd-trimmed/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205/models.go b/pkg/sdk3rd-trimmed/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205/models.go
index d3db09f79..4c39b70dd 100644
--- a/pkg/sdk3rd-trimmed/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205/models.go
+++ b/pkg/sdk3rd-trimmed/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205/models.go
@@ -1,4 +1,4 @@
-package v20191205
+package v20191205
import (
ssl "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_listener_attributes.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_listener_attributes.go
index ac7883838..1127181ca 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_listener_attributes.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_listener_attributes.go
@@ -1,4 +1,4 @@
-package alb
+package alb
import (
"github.com/volcengine/volcengine-go-sdk/service/alb"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_listeners.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_listeners.go
index 5d0320dd9..9c09931c0 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_listeners.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_listeners.go
@@ -1,4 +1,4 @@
-package alb
+package alb
import (
"github.com/volcengine/volcengine-go-sdk/service/alb"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_load_balancer_attributes.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_load_balancer_attributes.go
index 8aba0bad2..5972518f8 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_load_balancer_attributes.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_describe_load_balancer_attributes.go
@@ -1,4 +1,4 @@
-package alb
+package alb
import (
"github.com/volcengine/volcengine-go-sdk/service/alb"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_modify_listener_attributes.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_modify_listener_attributes.go
index 5e3ca03db..bde0f8fe8 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_modify_listener_attributes.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/api_modify_listener_attributes.go
@@ -1,4 +1,4 @@
-package alb
+package alb
import (
"github.com/volcengine/volcengine-go-sdk/service/alb"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/service_alb.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/service_alb.go
index 22796e7eb..700f72fe2 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/service_alb.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/alb/service_alb.go
@@ -1,4 +1,4 @@
-package alb
+package alb
import (
"github.com/volcengine/volcengine-go-sdk/service/alb"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_get_custom_domain.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_get_custom_domain.go
index 01dec31fa..4de7441b8 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_get_custom_domain.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_get_custom_domain.go
@@ -1,4 +1,4 @@
-package apig
+package apig
import (
"github.com/volcengine/volcengine-go-sdk/service/apig"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_list_custom_domains.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_list_custom_domains.go
index 42f2c1acc..a7af6ea04 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_list_custom_domains.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_list_custom_domains.go
@@ -1,4 +1,4 @@
-package apig
+package apig
import (
"github.com/volcengine/volcengine-go-sdk/service/apig"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_update_custom_domain.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_update_custom_domain.go
index a3c4011c4..000a695e6 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_update_custom_domain.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/api_update_custom_domain.go
@@ -1,4 +1,4 @@
-package apig
+package apig
import (
"github.com/volcengine/volcengine-go-sdk/service/apig"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/service_apig.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/service_apig.go
index db5148686..c69f6f7ea 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/service_apig.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/apig/service_apig.go
@@ -1,4 +1,4 @@
-package apig
+package apig
import (
"github.com/volcengine/volcengine-go-sdk/service/apig"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_add_certificate.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_add_certificate.go
index 972ad431b..18339e8ed 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_add_certificate.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_add_certificate.go
@@ -1,4 +1,4 @@
-package cdn
+package cdn
import (
"github.com/volcengine/volcengine-go-sdk/service/cdn"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_batch_deploy_cert.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_batch_deploy_cert.go
index abe92c74f..051723b31 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_batch_deploy_cert.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_batch_deploy_cert.go
@@ -1,4 +1,4 @@
-package cdn
+package cdn
import (
"github.com/volcengine/volcengine-go-sdk/service/cdn"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_describe_cert_config.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_describe_cert_config.go
index 02ea7ef6d..07faabb5f 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_describe_cert_config.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_describe_cert_config.go
@@ -1,4 +1,4 @@
-package cdn
+package cdn
import (
"github.com/volcengine/volcengine-go-sdk/service/cdn"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_list_cdn_domains.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_list_cdn_domains.go
index 69e9368ad..95194b529 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_list_cdn_domains.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_list_cdn_domains.go
@@ -1,4 +1,4 @@
-package cdn
+package cdn
import (
"github.com/volcengine/volcengine-go-sdk/service/cdn"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_list_cert_info.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_list_cert_info.go
index 710a60d8e..5dfc282df 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_list_cert_info.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/api_list_cert_info.go
@@ -1,4 +1,4 @@
-package cdn
+package cdn
import (
"github.com/volcengine/volcengine-go-sdk/service/cdn"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/service_cdn.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/service_cdn.go
index 2f493fbe5..0edb5c622 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/service_cdn.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/cdn/service_cdn.go
@@ -1,4 +1,4 @@
-package cdn
+package cdn
import (
"github.com/volcengine/volcengine-go-sdk/service/cdn"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/certificateservice/api_import_certificate.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/certificateservice/api_import_certificate.go
index 18383cc84..1b2e905b0 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/certificateservice/api_import_certificate.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/certificateservice/api_import_certificate.go
@@ -1,4 +1,4 @@
-package certificateservice
+package certificateservice
import (
"github.com/volcengine/volcengine-go-sdk/service/certificateservice"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/certificateservice/service_certificateservice.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/certificateservice/service_certificateservice.go
index 6bab97be0..1e51dbd93 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/certificateservice/service_certificateservice.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/certificateservice/service_certificateservice.go
@@ -1,4 +1,4 @@
-package certificateservice
+package certificateservice
import (
"github.com/volcengine/volcengine-go-sdk/service/certificateservice"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_describe_listeners.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_describe_listeners.go
index 012f18524..1ae254880 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_describe_listeners.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_describe_listeners.go
@@ -1,4 +1,4 @@
-package clb
+package clb
import (
"github.com/volcengine/volcengine-go-sdk/service/clb"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_describe_load_balancer_attributes.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_describe_load_balancer_attributes.go
index 2f58e08de..23c5cc980 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_describe_load_balancer_attributes.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_describe_load_balancer_attributes.go
@@ -1,4 +1,4 @@
-package clb
+package clb
import (
"github.com/volcengine/volcengine-go-sdk/service/clb"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_modify_listener_attributes.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_modify_listener_attributes.go
index 99a294da3..eaa967d5c 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_modify_listener_attributes.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/api_modify_listener_attributes.go
@@ -1,4 +1,4 @@
-package clb
+package clb
import (
"github.com/volcengine/volcengine-go-sdk/service/clb"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/service_clb.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/service_clb.go
index 69408a78d..42d6efedf 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/service_clb.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/clb/service_clb.go
@@ -1,4 +1,4 @@
-package clb
+package clb
import (
"github.com/volcengine/volcengine-go-sdk/service/clb"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/dcdn/api_create_cert_bind.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/dcdn/api_create_cert_bind.go
index 7fce850ed..ae6f7afc3 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/dcdn/api_create_cert_bind.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/dcdn/api_create_cert_bind.go
@@ -1,4 +1,4 @@
-package dcdn
+package dcdn
import (
"github.com/volcengine/volcengine-go-sdk/service/dcdn"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/dcdn/api_list_domain_config.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/dcdn/api_list_domain_config.go
index 38e3d2a0b..b070b420d 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/dcdn/api_list_domain_config.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/dcdn/api_list_domain_config.go
@@ -1,4 +1,4 @@
-package dcdn
+package dcdn
import (
"github.com/volcengine/volcengine-go-sdk/service/dcdn"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/vod20260101/service_vod20260101.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/vod20260101/service_vod20260101.go
index c8cd3a9be..ff5e14c99 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/vod20260101/service_vod20260101.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/vod20260101/service_vod20260101.go
@@ -1,4 +1,4 @@
-package vod20260101
+package vod20260101
import (
"github.com/volcengine/volcengine-go-sdk/service/vod20260101"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/api_list_domain.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/api_list_domain.go
index 27faabc5f..664a44d44 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/api_list_domain.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/api_list_domain.go
@@ -1,4 +1,4 @@
-package waf
+package waf
import (
"github.com/volcengine/volcengine-go-sdk/service/waf"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/api_update_domain.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/api_update_domain.go
index 8722c1c37..bd3f3e18f 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/api_update_domain.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/api_update_domain.go
@@ -1,4 +1,4 @@
-package waf
+package waf
import (
"github.com/volcengine/volcengine-go-sdk/service/waf"
diff --git a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/service_waf.go b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/service_waf.go
index 9ceec974e..dd74bca71 100644
--- a/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/service_waf.go
+++ b/pkg/sdk3rd-trimmed/github.com/volcengine/volcengine-go-sdk/service/waf/service_waf.go
@@ -1,4 +1,4 @@
-package waf
+package waf
import (
"github.com/volcengine/volcengine-go-sdk/service/waf"
diff --git a/pkg/sdk3rd/1panel/models.go b/pkg/sdk3rd/1panel/models.go
index eba3bdaae..d84571849 100644
--- a/pkg/sdk3rd/1panel/models.go
+++ b/pkg/sdk3rd/1panel/models.go
@@ -1,4 +1,4 @@
-package onepanel
+package onepanel
type Website struct {
ID int64 `json:"id"`
diff --git a/pkg/sdk3rd/1panel/options.go b/pkg/sdk3rd/1panel/options.go
index 0f47f7332..e53b57719 100644
--- a/pkg/sdk3rd/1panel/options.go
+++ b/pkg/sdk3rd/1panel/options.go
@@ -1,4 +1,4 @@
-package onepanel
+package onepanel
type Options struct {
ApiKey string
diff --git a/pkg/sdk3rd/1panel/signer.go b/pkg/sdk3rd/1panel/signer.go
index d075fd3f7..78f47e3cd 100644
--- a/pkg/sdk3rd/1panel/signer.go
+++ b/pkg/sdk3rd/1panel/signer.go
@@ -1,4 +1,4 @@
-package onepanel
+package onepanel
import (
"crypto/md5"
diff --git a/pkg/sdk3rd/1panel/v2/models.go b/pkg/sdk3rd/1panel/v2/models.go
index 69b50032d..11cd9a097 100644
--- a/pkg/sdk3rd/1panel/v2/models.go
+++ b/pkg/sdk3rd/1panel/v2/models.go
@@ -1,4 +1,4 @@
-package v2
+package v2
import (
v1 "github.com/certimate-go/certimate/pkg/sdk3rd/1panel"
diff --git a/pkg/sdk3rd/1panel/v2/options.go b/pkg/sdk3rd/1panel/v2/options.go
index 67846bc9e..b770b452e 100644
--- a/pkg/sdk3rd/1panel/v2/options.go
+++ b/pkg/sdk3rd/1panel/v2/options.go
@@ -1,4 +1,4 @@
-package v2
+package v2
type Options struct {
ApiKey string
diff --git a/pkg/sdk3rd/1panel/v2/signer.go b/pkg/sdk3rd/1panel/v2/signer.go
index fcaf758d0..0f1c00eaa 100644
--- a/pkg/sdk3rd/1panel/v2/signer.go
+++ b/pkg/sdk3rd/1panel/v2/signer.go
@@ -1,4 +1,4 @@
-package v2
+package v2
import (
"crypto/md5"
diff --git a/pkg/sdk3rd/alibabacloud/oss/client.go b/pkg/sdk3rd/alibabacloud/oss/client.go
index 702bc55a3..b74f7b8cc 100644
--- a/pkg/sdk3rd/alibabacloud/oss/client.go
+++ b/pkg/sdk3rd/alibabacloud/oss/client.go
@@ -1,4 +1,4 @@
-// A simple SDK client for AliababaCloud OSS.
+// A simple SDK client for AliababaCloud OSS.
// API documentation: https://www.alibabacloud.com/help/en/oss/developer-reference/list-of-operations-by-function
package oss
diff --git a/pkg/sdk3rd/alibabacloud/oss/options.go b/pkg/sdk3rd/alibabacloud/oss/options.go
index 69fad1124..85583fbc8 100644
--- a/pkg/sdk3rd/alibabacloud/oss/options.go
+++ b/pkg/sdk3rd/alibabacloud/oss/options.go
@@ -1,4 +1,4 @@
-package oss
+package oss
type Options struct {
AccessKeyId string
diff --git a/pkg/sdk3rd/alibabacloud/oss/signer.go b/pkg/sdk3rd/alibabacloud/oss/signer.go
index d710a64b2..0dc2fccab 100644
--- a/pkg/sdk3rd/alibabacloud/oss/signer.go
+++ b/pkg/sdk3rd/alibabacloud/oss/signer.go
@@ -1,4 +1,4 @@
-package oss
+package oss
import (
"bytes"
diff --git a/pkg/sdk3rd/apisix/options.go b/pkg/sdk3rd/apisix/options.go
index fe7b82b0c..a4a931574 100644
--- a/pkg/sdk3rd/apisix/options.go
+++ b/pkg/sdk3rd/apisix/options.go
@@ -1,4 +1,4 @@
-package apisix
+package apisix
type Options struct {
ApiKey string
diff --git a/pkg/sdk3rd/axisnow/api_add_certificate.go b/pkg/sdk3rd/axisnow/api_add_certificate.go
new file mode 100644
index 000000000..b708e651d
--- /dev/null
+++ b/pkg/sdk3rd/axisnow/api_add_certificate.go
@@ -0,0 +1,40 @@
+package axisnow
+
+import (
+ "context"
+ "net/http"
+)
+
+type AddCertificateRequest struct {
+ Name *string `json:"name,omitempty"`
+ Type *string `json:"type,omitempty"`
+ Certificate *string `json:"certificate,omitempty"`
+ PrivateKey *string `json:"private_key,omitempty"`
+}
+
+type AddCertificateResponse struct {
+ sdkResponseBase
+
+ Result *Certificate `json:"result,omitempty"`
+}
+
+func (c *Client) AddCertificate(req *AddCertificateRequest) (*AddCertificateResponse, error) {
+ return c.AddCertificateWithContext(context.Background(), req)
+}
+
+func (c *Client) AddCertificateWithContext(ctx context.Context, req *AddCertificateRequest) (*AddCertificateResponse, error) {
+ httpreq, err := c.newRequest(http.MethodPost, "/certificates")
+ if err != nil {
+ return nil, err
+ } else {
+ httpreq.SetBody(req)
+ httpreq.SetContext(ctx)
+ }
+
+ result := &AddCertificateResponse{}
+ if _, err := c.doRequestWithResult(httpreq, result); err != nil {
+ return result, err
+ }
+
+ return result, nil
+}
diff --git a/pkg/sdk3rd/axisnow/api_list_certificates.go b/pkg/sdk3rd/axisnow/api_list_certificates.go
new file mode 100644
index 000000000..06e8233e9
--- /dev/null
+++ b/pkg/sdk3rd/axisnow/api_list_certificates.go
@@ -0,0 +1,53 @@
+package axisnow
+
+import (
+ "context"
+ "net/http"
+
+ qs "github.com/google/go-querystring/query"
+)
+
+type ListCertificatesRequest struct {
+ Filter *string `json:"filter,omitempty" url:"filter,omitempty"`
+ Page *int `json:"page,omitempty" url:"page,omitempty"`
+ PerPage *int `json:"per_page,omitempty" url:"per_page,omitempty"`
+}
+
+type ListCertificatesResponse struct {
+ sdkResponseBase
+
+ ResultInfo *struct {
+ Page int `json:"page"`
+ PerPage int `json:"per_page"`
+ Count int `json:"count"`
+ TotalCount int `json:"total_count"`
+ SubscribedTotal int `json:"subscribed_total"`
+ } `json:"result_info,omitempty"`
+ Results []*Certificate `json:"result,omitempty"`
+}
+
+func (c *Client) ListCertificates(req *ListCertificatesRequest) (*ListCertificatesResponse, error) {
+ return c.ListCertificatesWithContext(context.Background(), req)
+}
+
+func (c *Client) ListCertificatesWithContext(ctx context.Context, req *ListCertificatesRequest) (*ListCertificatesResponse, error) {
+ httpreq, err := c.newRequest(http.MethodGet, "/certificates")
+ if err != nil {
+ return nil, err
+ } else {
+ values, err := qs.Values(req)
+ if err != nil {
+ return nil, err
+ }
+
+ httpreq.SetQueryParamsFromValues(values)
+ httpreq.SetContext(ctx)
+ }
+
+ result := &ListCertificatesResponse{}
+ if _, err := c.doRequestWithResult(httpreq, result); err != nil {
+ return result, err
+ }
+
+ return result, nil
+}
diff --git a/pkg/sdk3rd/axisnow/client.go b/pkg/sdk3rd/axisnow/client.go
new file mode 100644
index 000000000..fc0cf3a97
--- /dev/null
+++ b/pkg/sdk3rd/axisnow/client.go
@@ -0,0 +1,100 @@
+// A simple SDK client for AxisNow.
+// API documentation: https://developers.axisnow.io/api-reference/main/client/v1/#/
+package axisnow
+
+import (
+ "encoding/json"
+ "fmt"
+ "time"
+
+ "github.com/go-resty/resty/v2"
+
+ "github.com/certimate-go/certimate/internal/app"
+)
+
+type Client struct {
+ rc *resty.Client
+}
+
+func NewClient(optFns ...OptionsFunc) (*Client, error) {
+ opts := &Options{}
+ for _, fn := range optFns {
+ fn(opts)
+ }
+
+ if opts.ApiToken == "" {
+ return nil, fmt.Errorf("sdkerr: unset apiToken")
+ }
+
+ httper := resty.New().
+ SetBaseURL("https://api.axisnow.io/client/v1").
+ SetHeader("Accept", "application/json").
+ SetHeader("Authorization", "Bearer "+opts.ApiToken).
+ SetHeader("Content-Type", "application/json").
+ SetHeader("User-Agent", app.AppUserAgent)
+
+ return &Client{rc: httper}, nil
+}
+
+func (c *Client) SetTimeout(timeout time.Duration) *Client {
+ c.rc.SetTimeout(timeout)
+ return c
+}
+
+func (c *Client) newRequest(method string, path string) (*resty.Request, error) {
+ if method == "" {
+ return nil, fmt.Errorf("sdkerr: unset method")
+ }
+ if path == "" {
+ return nil, fmt.Errorf("sdkerr: unset path")
+ }
+
+ req := c.rc.R()
+ req.Method = method
+ req.URL = path
+
+ // WARN:
+ // DO NOT CALL `req.SetResult` or `req.SetError` AGAIN! USE `doRequestWithResult` INSTEAD.
+ return req, nil
+}
+
+func (c *Client) doRequest(req *resty.Request) (*resty.Response, error) {
+ if req == nil {
+ return nil, fmt.Errorf("sdkerr: nil request")
+ }
+
+ resp, err := req.Send()
+ if err != nil {
+ return resp, fmt.Errorf("sdkerr: failed to send request: %w", err)
+ } else if resp.IsError() {
+ return resp, fmt.Errorf("sdkerr: unexpected status code: %d (resp: %s)", resp.StatusCode(), resp.String())
+ }
+
+ return resp, nil
+}
+
+func (c *Client) doRequestWithResult(req *resty.Request, res sdkResponse) (*resty.Response, error) {
+ if req == nil {
+ return nil, fmt.Errorf("sdkerr: nil request")
+ }
+
+ resp, err := c.doRequest(req)
+ if err != nil {
+ if resp != nil {
+ json.Unmarshal(resp.Body(), &res)
+ }
+ return resp, err
+ }
+
+ if len(resp.Body()) != 0 {
+ if err := json.Unmarshal(resp.Body(), &res); err != nil {
+ return resp, fmt.Errorf("sdkerr: failed to unmarshal response: %w (resp: %s)", err, resp.String())
+ } else {
+ if err := res.GetAPIError(); err != nil {
+ return resp, fmt.Errorf("sdkerr: api error: %s", err.Error())
+ }
+ }
+ }
+
+ return resp, nil
+}
diff --git a/pkg/sdk3rd/axisnow/models.go b/pkg/sdk3rd/axisnow/models.go
new file mode 100644
index 000000000..d46265cd0
--- /dev/null
+++ b/pkg/sdk3rd/axisnow/models.go
@@ -0,0 +1,29 @@
+package axisnow
+
+type Certificate struct {
+ UUID string `json:"uuid,omitempty"`
+ Name string `json:"name,omitempty"`
+ Type string `json:"type,omitempty"`
+ SubjectName []string `json:"subject_name,omitempty"`
+ Issuer CertificateIssuer `json:"issuer,omitempty"`
+ Subject CertificateSubject `json:"subject,omitempty"`
+ IssueTime int64 `json:"issue_time,omitempty"`
+ ExpireTime int64 `json:"expire_time,omitempty"`
+ Certificate string `json:"certificate,omitempty"`
+ ReferencedCount int `json:"referenced_count,omitempty"`
+ CreatedAt string `json:"created_at,omitempty"`
+ UpdatedAt string `json:"updated_at,omitempty"`
+}
+
+type CertificateIssuer struct {
+ Country string `json:"country,omitempty"`
+ Organization string `json:"organization,omitempty"`
+ OrganizationUnit string `json:"organization_unit,omitempty"`
+ CommonName string `json:"common_name,omitempty"`
+}
+
+type CertificateSubject struct {
+ Organization string `json:"organization,omitempty"`
+ OrganizationUnit string `json:"organization_unit,omitempty"`
+ CommonName string `json:"common_name,omitempty"`
+}
diff --git a/pkg/sdk3rd/axisnow/options.go b/pkg/sdk3rd/axisnow/options.go
new file mode 100644
index 000000000..2acd98983
--- /dev/null
+++ b/pkg/sdk3rd/axisnow/options.go
@@ -0,0 +1,13 @@
+package axisnow
+
+type Options struct {
+ ApiToken string
+}
+
+type OptionsFunc func(*Options)
+
+func WithApiToken(apiToken string) OptionsFunc {
+ return func(o *Options) {
+ o.ApiToken = apiToken
+ }
+}
diff --git a/pkg/sdk3rd/axisnow/types.go b/pkg/sdk3rd/axisnow/types.go
new file mode 100644
index 000000000..f26f4d09a
--- /dev/null
+++ b/pkg/sdk3rd/axisnow/types.go
@@ -0,0 +1,46 @@
+package axisnow
+
+import (
+ "fmt"
+ "strings"
+)
+
+type sdkResponse interface {
+ GetAPIError() error
+ GetSuccess() bool
+}
+
+type sdkResponseBase struct {
+ Success bool `json:"success"`
+ Errors sdkAPIErrors `json:"errors,omitempty"`
+}
+
+type sdkAPIError struct {
+ Code int `json:"code"`
+ Message string `json:"message"`
+}
+
+type sdkAPIErrors []sdkAPIError
+
+func (e sdkAPIErrors) Error() string {
+ builder := &strings.Builder{}
+
+ for _, item := range e {
+ fmt.Fprintf(builder, "[%d] %s", item.Code, item.Message)
+ }
+
+ return strings.TrimSpace(builder.String())
+}
+
+func (r *sdkResponseBase) GetSuccess() bool {
+ return r.Success
+}
+
+func (r *sdkResponseBase) GetAPIError() error {
+ if len(r.Errors) > 0 {
+ return r.Errors
+ }
+ return nil
+}
+
+var _ sdkResponse = (*sdkResponseBase)(nil)
diff --git a/pkg/sdk3rd/baishan/options.go b/pkg/sdk3rd/baishan/options.go
index 8b7de7f26..bd9706667 100644
--- a/pkg/sdk3rd/baishan/options.go
+++ b/pkg/sdk3rd/baishan/options.go
@@ -1,4 +1,4 @@
-package baishan
+package baishan
type Options struct {
ApiToken string
diff --git a/pkg/sdk3rd/btpanel/options.go b/pkg/sdk3rd/btpanel/options.go
index 5b9d50495..c08fbdd89 100644
--- a/pkg/sdk3rd/btpanel/options.go
+++ b/pkg/sdk3rd/btpanel/options.go
@@ -1,4 +1,4 @@
-package btpanel
+package btpanel
type Options struct {
ApiKey string
diff --git a/pkg/sdk3rd/btpanelgo/options.go b/pkg/sdk3rd/btpanelgo/options.go
index 0007904e6..143b8e548 100644
--- a/pkg/sdk3rd/btpanelgo/options.go
+++ b/pkg/sdk3rd/btpanelgo/options.go
@@ -1,4 +1,4 @@
-package btpanelgo
+package btpanelgo
type Options struct {
ApiKey string
diff --git a/pkg/sdk3rd/btwaf/options.go b/pkg/sdk3rd/btwaf/options.go
index 9442b440f..a128909e9 100644
--- a/pkg/sdk3rd/btwaf/options.go
+++ b/pkg/sdk3rd/btwaf/options.go
@@ -1,4 +1,4 @@
-package btwaf
+package btwaf
type Options struct {
ApiKey string
diff --git a/pkg/sdk3rd/btwaf/signer.go b/pkg/sdk3rd/btwaf/signer.go
index e830d77a6..5d3ac59e5 100644
--- a/pkg/sdk3rd/btwaf/signer.go
+++ b/pkg/sdk3rd/btwaf/signer.go
@@ -1,4 +1,4 @@
-package btwaf
+package btwaf
import (
"crypto/md5"
diff --git a/pkg/sdk3rd/bunny/options.go b/pkg/sdk3rd/bunny/options.go
index f206e5341..caa5056ef 100644
--- a/pkg/sdk3rd/bunny/options.go
+++ b/pkg/sdk3rd/bunny/options.go
@@ -1,4 +1,4 @@
-package bunny
+package bunny
type Options struct {
ApiKey string
diff --git a/pkg/sdk3rd/cachefly/options.go b/pkg/sdk3rd/cachefly/options.go
index 7f4d686f9..c0aa53497 100644
--- a/pkg/sdk3rd/cachefly/options.go
+++ b/pkg/sdk3rd/cachefly/options.go
@@ -1,4 +1,4 @@
-package cachefly
+package cachefly
type Options struct {
ApiToken string
diff --git a/pkg/sdk3rd/cdnfly/options.go b/pkg/sdk3rd/cdnfly/options.go
index 487f05575..8100a1db5 100644
--- a/pkg/sdk3rd/cdnfly/options.go
+++ b/pkg/sdk3rd/cdnfly/options.go
@@ -1,4 +1,4 @@
-package cdnfly
+package cdnfly
type Options struct {
ApiKey string
diff --git a/pkg/sdk3rd/cloudflare/options.go b/pkg/sdk3rd/cloudflare/options.go
index 5d72f1eb1..1d7b8fb95 100644
--- a/pkg/sdk3rd/cloudflare/options.go
+++ b/pkg/sdk3rd/cloudflare/options.go
@@ -1,4 +1,4 @@
-package cloudflare
+package cloudflare
type Options struct {
ApiToken string
diff --git a/pkg/sdk3rd/conoha/vps/v3/options.go b/pkg/sdk3rd/conoha/vps/v3/options.go
index b21ce814a..40ff295db 100644
--- a/pkg/sdk3rd/conoha/vps/v3/options.go
+++ b/pkg/sdk3rd/conoha/vps/v3/options.go
@@ -1,4 +1,4 @@
-package v3
+package v3
type Options struct {
UserId string
diff --git a/pkg/sdk3rd/cpanel/options.go b/pkg/sdk3rd/cpanel/options.go
index d9a3bc4ae..6325f00dd 100644
--- a/pkg/sdk3rd/cpanel/options.go
+++ b/pkg/sdk3rd/cpanel/options.go
@@ -1,4 +1,4 @@
-package cpanel
+package cpanel
type Options struct {
Username string
diff --git a/pkg/sdk3rd/ctyun/ao/options.go b/pkg/sdk3rd/ctyun/ao/options.go
index 22023daa6..7409288ac 100644
--- a/pkg/sdk3rd/ctyun/ao/options.go
+++ b/pkg/sdk3rd/ctyun/ao/options.go
@@ -1,4 +1,4 @@
-package ao
+package ao
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/ctyun/zz-shared-common"
diff --git a/pkg/sdk3rd/ctyun/cdn/options.go b/pkg/sdk3rd/ctyun/cdn/options.go
index 21cf9ddd2..981cc1414 100644
--- a/pkg/sdk3rd/ctyun/cdn/options.go
+++ b/pkg/sdk3rd/ctyun/cdn/options.go
@@ -1,4 +1,4 @@
-package cdn
+package cdn
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/ctyun/zz-shared-common"
diff --git a/pkg/sdk3rd/ctyun/cms/options.go b/pkg/sdk3rd/ctyun/cms/options.go
index d38099024..d3ce3008b 100644
--- a/pkg/sdk3rd/ctyun/cms/options.go
+++ b/pkg/sdk3rd/ctyun/cms/options.go
@@ -1,4 +1,4 @@
-package cms
+package cms
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/ctyun/zz-shared-common"
diff --git a/pkg/sdk3rd/ctyun/dns/options.go b/pkg/sdk3rd/ctyun/dns/options.go
index 3082d65a7..78048912d 100644
--- a/pkg/sdk3rd/ctyun/dns/options.go
+++ b/pkg/sdk3rd/ctyun/dns/options.go
@@ -1,4 +1,4 @@
-package dns
+package dns
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/ctyun/zz-shared-common"
diff --git a/pkg/sdk3rd/ctyun/elb/options.go b/pkg/sdk3rd/ctyun/elb/options.go
index c73fd36d8..7bc8d6774 100644
--- a/pkg/sdk3rd/ctyun/elb/options.go
+++ b/pkg/sdk3rd/ctyun/elb/options.go
@@ -1,4 +1,4 @@
-package elb
+package elb
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/ctyun/zz-shared-common"
diff --git a/pkg/sdk3rd/ctyun/faas/options.go b/pkg/sdk3rd/ctyun/faas/options.go
index 36364def2..69da64bb9 100644
--- a/pkg/sdk3rd/ctyun/faas/options.go
+++ b/pkg/sdk3rd/ctyun/faas/options.go
@@ -1,4 +1,4 @@
-package faas
+package faas
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/ctyun/zz-shared-common"
diff --git a/pkg/sdk3rd/ctyun/icdn/options.go b/pkg/sdk3rd/ctyun/icdn/options.go
index cfa6dfa39..ebcca9e38 100644
--- a/pkg/sdk3rd/ctyun/icdn/options.go
+++ b/pkg/sdk3rd/ctyun/icdn/options.go
@@ -1,4 +1,4 @@
-package icdn
+package icdn
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/ctyun/zz-shared-common"
diff --git a/pkg/sdk3rd/ctyun/lvdn/options.go b/pkg/sdk3rd/ctyun/lvdn/options.go
index 29ba1d779..c187dfda8 100644
--- a/pkg/sdk3rd/ctyun/lvdn/options.go
+++ b/pkg/sdk3rd/ctyun/lvdn/options.go
@@ -1,4 +1,4 @@
-package lvdn
+package lvdn
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/ctyun/zz-shared-common"
diff --git a/pkg/sdk3rd/ctyun/zz-shared-common/options.go b/pkg/sdk3rd/ctyun/zz-shared-common/options.go
index 6b95015c5..e185ad677 100644
--- a/pkg/sdk3rd/ctyun/zz-shared-common/options.go
+++ b/pkg/sdk3rd/ctyun/zz-shared-common/options.go
@@ -1,4 +1,4 @@
-package common
+package common
type Options struct {
AccessKeyId string
diff --git a/pkg/sdk3rd/ctyun/zz-shared-common/signer.go b/pkg/sdk3rd/ctyun/zz-shared-common/signer.go
index c14c657fb..7af909e08 100644
--- a/pkg/sdk3rd/ctyun/zz-shared-common/signer.go
+++ b/pkg/sdk3rd/ctyun/zz-shared-common/signer.go
@@ -1,4 +1,4 @@
-package common
+package common
import (
"bytes"
diff --git a/pkg/sdk3rd/digitalocean/options.go b/pkg/sdk3rd/digitalocean/options.go
index e71e250ec..629a3a92c 100644
--- a/pkg/sdk3rd/digitalocean/options.go
+++ b/pkg/sdk3rd/digitalocean/options.go
@@ -1,4 +1,4 @@
-package digitalocean
+package digitalocean
type Options struct {
AccessToken string
diff --git a/pkg/sdk3rd/dokploy/models.go b/pkg/sdk3rd/dokploy/models.go
index 6518237ae..ae7a374a6 100644
--- a/pkg/sdk3rd/dokploy/models.go
+++ b/pkg/sdk3rd/dokploy/models.go
@@ -1,4 +1,4 @@
-package dokploy
+package dokploy
type Certificate struct {
CertificateId string `json:"certificateId"`
diff --git a/pkg/sdk3rd/flexcdn/options.go b/pkg/sdk3rd/flexcdn/options.go
index 26773c503..ee9867aea 100644
--- a/pkg/sdk3rd/flexcdn/options.go
+++ b/pkg/sdk3rd/flexcdn/options.go
@@ -1,4 +1,4 @@
-package flexcdn
+package flexcdn
type Options struct {
Role string
diff --git a/pkg/sdk3rd/flyio/options.go b/pkg/sdk3rd/flyio/options.go
index 25d4df7a6..df897c867 100644
--- a/pkg/sdk3rd/flyio/options.go
+++ b/pkg/sdk3rd/flyio/options.go
@@ -1,4 +1,4 @@
-package flyio
+package flyio
type Options struct {
ApiToken string
diff --git a/pkg/sdk3rd/goedge/options.go b/pkg/sdk3rd/goedge/options.go
index bb9eb1e38..f4bc78f2d 100644
--- a/pkg/sdk3rd/goedge/options.go
+++ b/pkg/sdk3rd/goedge/options.go
@@ -1,4 +1,4 @@
-package goedge
+package goedge
type Options struct {
Role string
diff --git a/pkg/sdk3rd/huaweicloud/obs/client.go b/pkg/sdk3rd/huaweicloud/obs/client.go
index ff9d6b6e1..0ee6927a4 100644
--- a/pkg/sdk3rd/huaweicloud/obs/client.go
+++ b/pkg/sdk3rd/huaweicloud/obs/client.go
@@ -1,4 +1,4 @@
-// A simple SDK client for HuaweiCloud OBS.
+// A simple SDK client for HuaweiCloud OBS.
// API documentation: https://support.huaweicloud.com/api-obs/obs_04_0005.html
package obs
diff --git a/pkg/sdk3rd/huaweicloud/obs/options.go b/pkg/sdk3rd/huaweicloud/obs/options.go
index b6ec50a3a..c069914e4 100644
--- a/pkg/sdk3rd/huaweicloud/obs/options.go
+++ b/pkg/sdk3rd/huaweicloud/obs/options.go
@@ -1,4 +1,4 @@
-package obs
+package obs
type Options struct {
AccessKeyId string
diff --git a/pkg/sdk3rd/huaweicloud/obs/signer.go b/pkg/sdk3rd/huaweicloud/obs/signer.go
index 01ac8f6ff..404047cc7 100644
--- a/pkg/sdk3rd/huaweicloud/obs/signer.go
+++ b/pkg/sdk3rd/huaweicloud/obs/signer.go
@@ -1,4 +1,4 @@
-package obs
+package obs
import (
"bytes"
diff --git a/pkg/sdk3rd/huaweiibmc/api_Managers.ListManagers.go b/pkg/sdk3rd/huaweiibmc/api_Managers.ListManagers.go
new file mode 100644
index 000000000..51416b7aa
--- /dev/null
+++ b/pkg/sdk3rd/huaweiibmc/api_Managers.ListManagers.go
@@ -0,0 +1,53 @@
+package huaweiibmc
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "regexp"
+)
+
+type GetManagersResponse struct {
+ sdkResponseBase
+
+ Members []*Entity `json:"Members"`
+}
+
+type ListManagersResponse struct {
+ sdkResponseBase
+
+ Members []*Entity `json:"Members"`
+}
+
+func (c *Client) ListManagers() (*ListManagersResponse, error) {
+ return c.ListManagersWithContext(context.Background())
+}
+
+func (c *Client) ListManagersWithContext(ctx context.Context) (*ListManagersResponse, error) {
+ httpreq, err := c.newRequest(http.MethodGet, "/redfish/v1/Managers")
+ if err != nil {
+ return nil, err
+ } else {
+ httpreq.SetContext(ctx)
+ }
+
+ result := &ListManagersResponse{}
+ if _, err := c.doRequestWithResult(httpreq, result); err != nil {
+ return result, err
+ } else {
+ for _, member := range result.Members {
+ if member.ODataID == "" && member.ID != "" {
+ member.ODataID = "/redfish/v1/Managers/" + url.PathEscape(member.ID)
+ }
+ if member.ID == "" && member.ODataID != "" {
+ re := regexp.MustCompile(`/redfish/v1/Managers/([^/]+)$`)
+ matches := re.FindStringSubmatch(member.ODataID)
+ if len(matches) == 2 {
+ member.ID = matches[1]
+ }
+ }
+ }
+ }
+
+ return result, nil
+}
diff --git a/pkg/sdk3rd/huaweiibmc/api_Managers.Reset.go b/pkg/sdk3rd/huaweiibmc/api_Managers.Reset.go
new file mode 100644
index 000000000..42a72244d
--- /dev/null
+++ b/pkg/sdk3rd/huaweiibmc/api_Managers.Reset.go
@@ -0,0 +1,80 @@
+package huaweiibmc
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+type ResetManagerRequest struct {
+ sdkResponseBase
+
+ ManagerID string `json:"-"`
+ ManagerLocation string `json:"-"`
+ ResetType string `json:"ResetType,omitempty"`
+}
+
+type ResetManagerResponse struct {
+ sdkResponseBase
+}
+
+func (r *ResetManagerResponse) GetAPIError() error {
+ if r.isSuccessfulResponse() {
+ return nil
+ }
+
+ return r.sdkResponseBase.GetAPIError()
+}
+
+func (r *ResetManagerResponse) isSuccessfulResponse() bool {
+ if r.Error == nil {
+ return false
+ }
+
+ var extendedInfo []struct {
+ MessageID string `json:"MessageId"`
+ }
+ if err := json.Unmarshal(r.Error.MessageExtendedInfo, &extendedInfo); err != nil {
+ return false
+ }
+
+ for _, info := range extendedInfo {
+ if info.MessageID == "Base.1.0.Success" {
+ return true
+ }
+ }
+
+ return false
+}
+
+func (c *Client) ResetManager(req *ResetManagerRequest) (*ResetManagerResponse, error) {
+ return c.ResetManagerWithContext(context.Background(), req)
+}
+
+func (c *Client) ResetManagerWithContext(ctx context.Context, req *ResetManagerRequest) (*ResetManagerResponse, error) {
+ managerLoc := strings.TrimRight(req.ManagerLocation, "/")
+ if managerLoc == "" && req.ManagerID != "" {
+ managerLoc = "/redfish/v1/Managers/" + url.PathEscape(req.ManagerID)
+ }
+ if managerLoc == "" {
+ return nil, fmt.Errorf("sdkerr: bad request: unset managerId")
+ }
+
+ httpreq, err := c.newRequest(http.MethodPost, managerLoc+"/Actions/Manager.Reset")
+ if err != nil {
+ return nil, err
+ } else {
+ httpreq.SetBody(req)
+ httpreq.SetContext(ctx)
+ }
+
+ result := &ResetManagerResponse{}
+ if _, err := c.doRequestWithResult(httpreq, result); err != nil {
+ return result, err
+ }
+
+ return result, nil
+}
diff --git a/pkg/sdk3rd/huaweiibmc/api_Managers.SecurityService.HttpsCert.ImportCustomCertificate.go b/pkg/sdk3rd/huaweiibmc/api_Managers.SecurityService.HttpsCert.ImportCustomCertificate.go
new file mode 100644
index 000000000..7a8866ab7
--- /dev/null
+++ b/pkg/sdk3rd/huaweiibmc/api_Managers.SecurityService.HttpsCert.ImportCustomCertificate.go
@@ -0,0 +1,81 @@
+package huaweiibmc
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+type ImportCustomCertificateToManagerRequest struct {
+ sdkResponseBase
+
+ ManagerID string `json:"-"`
+ ManagerLocation string `json:"-"`
+ Certificate string `json:"Certificate,omitempty"`
+ Password string `json:"Password,omitempty"`
+}
+
+type ImportCustomCertificateToManagerResponse struct {
+ sdkResponseBase
+}
+
+func (r *ImportCustomCertificateToManagerResponse) GetAPIError() error {
+ if r.isSuccessfulResponse() {
+ return nil
+ }
+
+ return r.sdkResponseBase.GetAPIError()
+}
+
+func (r *ImportCustomCertificateToManagerResponse) isSuccessfulResponse() bool {
+ if r.Error == nil {
+ return false
+ }
+
+ var extendedInfo []struct {
+ MessageID string `json:"MessageId"`
+ }
+ if err := json.Unmarshal(r.Error.MessageExtendedInfo, &extendedInfo); err != nil {
+ return false
+ }
+
+ for _, info := range extendedInfo {
+ if info.MessageID == "iBMC.1.0.CertImportOK" {
+ return true
+ }
+ }
+
+ return false
+}
+
+func (c *Client) ImportCustomCertificateToManager(req *ImportCustomCertificateToManagerRequest) (*ImportCustomCertificateToManagerResponse, error) {
+ return c.ImportCustomCertificateToManagerWithContext(context.Background(), req)
+}
+
+func (c *Client) ImportCustomCertificateToManagerWithContext(ctx context.Context, req *ImportCustomCertificateToManagerRequest) (*ImportCustomCertificateToManagerResponse, error) {
+ managerLoc := strings.TrimRight(req.ManagerLocation, "/")
+ if managerLoc == "" && req.ManagerID != "" {
+ managerLoc = "/redfish/v1/Managers/" + url.PathEscape(req.ManagerID)
+ }
+ if managerLoc == "" {
+ return nil, fmt.Errorf("sdkerr: bad request: unset managerId")
+ }
+
+ httpreq, err := c.newRequest(http.MethodPost, managerLoc+"/SecurityService/HttpsCert/Actions/HttpsCert.ImportCustomCertificate")
+ if err != nil {
+ return nil, err
+ } else {
+ httpreq.SetBody(req)
+ httpreq.SetContext(ctx)
+ }
+
+ result := &ImportCustomCertificateToManagerResponse{}
+ if _, err := c.doRequestWithResult(httpreq, result); err != nil {
+ return result, err
+ }
+
+ return result, nil
+}
diff --git a/pkg/sdk3rd/huaweiibmc/api_SessionService.CreateSession.go b/pkg/sdk3rd/huaweiibmc/api_SessionService.CreateSession.go
new file mode 100644
index 000000000..ac9cbf078
--- /dev/null
+++ b/pkg/sdk3rd/huaweiibmc/api_SessionService.CreateSession.go
@@ -0,0 +1,60 @@
+package huaweiibmc
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+)
+
+type CreateSessionResponse struct {
+ sdkResponseBase
+
+ XToken string `json:"-"`
+ XLocation string `json:"-"`
+}
+
+func (c *Client) CreateSession() (*CreateSessionResponse, error) {
+ return c.CreateSessionWithContext(context.Background())
+}
+
+func (c *Client) CreateSessionWithContext(ctx context.Context) (*CreateSessionResponse, error) {
+ c.tokenMu.Lock()
+ if c.token != "" {
+ c.tokenMu.Unlock()
+ return nil, fmt.Errorf("sdkerr: auth error: session already created")
+ }
+
+ c.tokenMu.Unlock()
+
+ httpreq, err := c.newRequest(http.MethodPost, "/redfish/v1/SessionService/Sessions")
+ if err != nil {
+ return nil, err
+ } else {
+ httpreq.SetBody(map[string]string{
+ "UserName": c.username,
+ "Password": c.password,
+ })
+ httpreq.SetContext(ctx)
+ }
+
+ result := &CreateSessionResponse{}
+ if httpresp, err := c.doRequestWithResult(httpreq, result); err != nil {
+ return result, err
+ } else {
+ token := httpresp.Header().Get("X-Auth-Token")
+ location := httpresp.Header().Get("Location")
+ result.XToken = token
+ result.XLocation = c.resolveLocation(location)
+
+ if result.XToken == "" {
+ return result, fmt.Errorf("sdkerr: auth error: received empty token")
+ }
+
+ c.tokenMu.Lock()
+ c.token = result.XToken
+ c.tokenLoc = result.XLocation
+ c.tokenMu.Unlock()
+ }
+
+ return result, nil
+}
diff --git a/pkg/sdk3rd/huaweiibmc/api_SessionService.DeleteSession.go b/pkg/sdk3rd/huaweiibmc/api_SessionService.DeleteSession.go
new file mode 100644
index 000000000..28dcaabde
--- /dev/null
+++ b/pkg/sdk3rd/huaweiibmc/api_SessionService.DeleteSession.go
@@ -0,0 +1,48 @@
+package huaweiibmc
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+)
+
+type DeleteSessionResponse struct {
+ sdkResponseBase
+}
+
+func (c *Client) DeleteSession() (*DeleteSessionResponse, error) {
+ return c.DeleteSessionWithContext(context.Background())
+}
+
+func (c *Client) DeleteSessionWithContext(ctx context.Context) (*DeleteSessionResponse, error) {
+ c.tokenMu.Lock()
+ if c.token == "" {
+ c.tokenMu.Unlock()
+ return nil, fmt.Errorf("sdkerr: auth error: session not created")
+ }
+ if c.tokenLoc == "" {
+ c.tokenMu.Unlock()
+ return &DeleteSessionResponse{}, nil
+ }
+
+ c.tokenMu.Unlock()
+
+ httpreq, err := c.newRequest(http.MethodDelete, c.tokenLoc)
+ if err != nil {
+ return nil, err
+ } else {
+ httpreq.SetContext(ctx)
+ }
+
+ result := &DeleteSessionResponse{}
+ if _, err := c.doRequestWithResult(httpreq, result); err != nil {
+ return result, err
+ } else {
+ c.tokenMu.Lock()
+ c.token = ""
+ c.tokenLoc = ""
+ c.tokenMu.Unlock()
+ }
+
+ return result, nil
+}
diff --git a/pkg/sdk3rd/huaweiibmc/client.go b/pkg/sdk3rd/huaweiibmc/client.go
new file mode 100644
index 000000000..4caca660a
--- /dev/null
+++ b/pkg/sdk3rd/huaweiibmc/client.go
@@ -0,0 +1,156 @@
+// A simple SDK client for Huawei iBMC Redfish.
+package huaweiibmc
+
+import (
+ "crypto/tls"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "net/url"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/go-resty/resty/v2"
+
+ "github.com/certimate-go/certimate/internal/app"
+)
+
+type Client struct {
+ username string
+ password string
+
+ token string
+ tokenLoc string
+ tokenMu sync.Mutex
+
+ rc *resty.Client
+}
+
+type sdkSuccessfulResponse interface {
+ isSuccessfulResponse() bool
+}
+
+func NewClient(serverUrl string, optFns ...OptionsFunc) (*Client, error) {
+ opts := &Options{}
+ for _, fn := range optFns {
+ fn(opts)
+ }
+
+ if serverUrl == "" {
+ return nil, fmt.Errorf("sdkerr: unset serverUrl")
+ }
+ if _, err := url.Parse(serverUrl); err != nil {
+ return nil, fmt.Errorf("sdkerr: invalid serverUrl: %w", err)
+ }
+ if opts.Username == "" {
+ return nil, fmt.Errorf("sdkerr: unset username")
+ }
+ if opts.Password == "" {
+ return nil, fmt.Errorf("sdkerr: unset password")
+ }
+
+ client := &Client{
+ username: opts.Username,
+ password: opts.Password,
+ }
+ client.rc = resty.New().
+ SetBaseURL(strings.TrimRight(serverUrl, "/")).
+ SetHeader("Accept", "application/json").
+ SetHeader("Content-Type", "application/json").
+ SetHeader("User-Agent", app.AppUserAgent).
+ SetPreRequestHook(func(_ *resty.Client, req *http.Request) error {
+ if client.token != "" {
+ req.Header.Set("X-Auth-Token", client.token)
+ }
+
+ return nil
+ })
+
+ return client, nil
+}
+
+func (c *Client) SetTimeout(timeout time.Duration) *Client {
+ c.rc.SetTimeout(timeout)
+ return c
+}
+
+func (c *Client) SetTLSConfig(config *tls.Config) *Client {
+ c.rc.SetTLSClientConfig(config)
+ return c
+}
+
+func (c *Client) newRequest(method string, path string) (*resty.Request, error) {
+ if method == "" {
+ return nil, fmt.Errorf("sdkerr: unset method")
+ }
+ if path == "" {
+ return nil, fmt.Errorf("sdkerr: unset path")
+ }
+
+ req := c.rc.R()
+ req.Method = method
+ req.URL = path
+
+ // WARN:
+ // DO NOT CALL `req.SetResult` or `req.SetError` AGAIN! USE `doRequestWithResult` INSTEAD.
+ return req, nil
+}
+
+func (c *Client) doRequest(req *resty.Request) (*resty.Response, error) {
+ if req == nil {
+ return nil, fmt.Errorf("sdkerr: nil request")
+ }
+
+ resp, err := req.Send()
+ if err != nil {
+ return resp, fmt.Errorf("sdkerr: failed to send request: %w", err)
+ } else if resp.IsError() {
+ return resp, fmt.Errorf("sdkerr: unexpected status code: %d (resp: %s)", resp.StatusCode(), resp.String())
+ }
+
+ return resp, nil
+}
+
+func (c *Client) doRequestWithResult(req *resty.Request, res sdkResponse) (*resty.Response, error) {
+ if req == nil {
+ return nil, fmt.Errorf("sdkerr: nil request")
+ }
+
+ resp, err := c.doRequest(req)
+ if err != nil {
+ if resp != nil {
+ json.Unmarshal(resp.Body(), &res)
+ if successful, ok := res.(sdkSuccessfulResponse); ok && successful.isSuccessfulResponse() {
+ return resp, nil
+ }
+ }
+ return resp, err
+ }
+
+ if len(resp.Body()) != 0 {
+ if err := json.Unmarshal(resp.Body(), &res); err != nil {
+ return resp, fmt.Errorf("sdkerr: failed to unmarshal response: %w (resp: %s)", err, resp.String())
+ } else {
+ if err := res.GetAPIError(); err != nil {
+ return resp, fmt.Errorf("sdkerr: api error: %s", err.Error())
+ }
+ }
+ }
+
+ return resp, nil
+}
+
+func (c *Client) resolveLocation(location string) string {
+ u, err := url.Parse(location)
+ if err != nil || u.IsAbs() {
+ return location
+ }
+
+ base, err := url.Parse(c.rc.BaseURL)
+ if err != nil {
+ return location
+ }
+
+ return base.ResolveReference(u).String()
+}
diff --git a/pkg/sdk3rd/huaweiibmc/models.go b/pkg/sdk3rd/huaweiibmc/models.go
new file mode 100644
index 000000000..261cea3e9
--- /dev/null
+++ b/pkg/sdk3rd/huaweiibmc/models.go
@@ -0,0 +1,9 @@
+package huaweiibmc
+
+type Entity struct {
+ ID string `json:"Id,omitempty"`
+ ODataID string `json:"@odata.id,omitempty"`
+ ODataType string `json:"@odata.type,omitempty"`
+ Name string `json:"Name,omitempty"`
+ Description string `json:"Description"`
+}
diff --git a/pkg/sdk3rd/huaweiibmc/options.go b/pkg/sdk3rd/huaweiibmc/options.go
new file mode 100644
index 000000000..e2305d057
--- /dev/null
+++ b/pkg/sdk3rd/huaweiibmc/options.go
@@ -0,0 +1,15 @@
+package huaweiibmc
+
+type Options struct {
+ Username string
+ Password string
+}
+
+type OptionsFunc func(*Options)
+
+func WithLogins(username, password string) OptionsFunc {
+ return func(o *Options) {
+ o.Username = username
+ o.Password = password
+ }
+}
diff --git a/pkg/sdk3rd/huaweiibmc/types.go b/pkg/sdk3rd/huaweiibmc/types.go
new file mode 100644
index 000000000..eb930c893
--- /dev/null
+++ b/pkg/sdk3rd/huaweiibmc/types.go
@@ -0,0 +1,34 @@
+package huaweiibmc
+
+import (
+ "encoding/json"
+ "fmt"
+)
+
+type sdkResponse interface {
+ GetAPIError() error
+}
+
+type sdkResponseBase struct {
+ ODataContext string `json:"@odata.context,omitempty"`
+ Error *sdkAPIError `json:"error,omitempty"`
+}
+
+type sdkAPIError struct {
+ Code string `json:"code"`
+ Message string `json:"message"`
+ MessageExtendedInfo json.RawMessage `json:"@Message.ExtendedInfo,omitempty"`
+}
+
+func (e sdkAPIError) Error() string {
+ return fmt.Sprintf("[%s] %s", e.Code, e.Message)
+}
+
+func (r *sdkResponseBase) GetAPIError() error {
+ if r.Error != nil {
+ return *r.Error
+ }
+ return nil
+}
+
+var _ sdkResponse = (*sdkResponseBase)(nil)
diff --git a/pkg/sdk3rd/kong/models.go b/pkg/sdk3rd/kong/models.go
index f30aa1478..397e9d25f 100644
--- a/pkg/sdk3rd/kong/models.go
+++ b/pkg/sdk3rd/kong/models.go
@@ -8,6 +8,6 @@ type Certificate struct {
KeyAlt *string `json:"key_alt,omitempty"`
SNIs []*string `json:"snis,omitempty"`
Tags []*string `json:"tags,omitempty"`
- CreatedAt *int64 `json:"created_at,omitempty"`
- UpdatedAt *int64 `json:"updated_at,omitempty"`
+ CreatedAt *int64 `json:"created_at,omitempty"`
+ UpdatedAt *int64 `json:"updated_at,omitempty"`
}
diff --git a/pkg/sdk3rd/kong/options.go b/pkg/sdk3rd/kong/options.go
index 33be7298b..8383dcb49 100644
--- a/pkg/sdk3rd/kong/options.go
+++ b/pkg/sdk3rd/kong/options.go
@@ -1,4 +1,4 @@
-package kong
+package kong
type Options struct {
ApiToken string
diff --git a/pkg/sdk3rd/ksyun/cdn/models.go b/pkg/sdk3rd/ksyun/cdn/models.go
index dc49504dd..c98b0685c 100644
--- a/pkg/sdk3rd/ksyun/cdn/models.go
+++ b/pkg/sdk3rd/ksyun/cdn/models.go
@@ -1,4 +1,4 @@
-package cdn
+package cdn
type CDNDomain struct {
Region string `json:"Region"`
diff --git a/pkg/sdk3rd/ksyun/cdn/options.go b/pkg/sdk3rd/ksyun/cdn/options.go
index 2d86735a6..cc901b248 100644
--- a/pkg/sdk3rd/ksyun/cdn/options.go
+++ b/pkg/sdk3rd/ksyun/cdn/options.go
@@ -1,4 +1,4 @@
-package cdn
+package cdn
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/ksyun/zz-shared-common"
diff --git a/pkg/sdk3rd/ksyun/kcm/models.go b/pkg/sdk3rd/ksyun/kcm/models.go
index 3b8010565..7079f6113 100644
--- a/pkg/sdk3rd/ksyun/kcm/models.go
+++ b/pkg/sdk3rd/ksyun/kcm/models.go
@@ -1,4 +1,4 @@
-package kcm
+package kcm
type UserCertificate struct {
CertId string `json:"CertID"`
diff --git a/pkg/sdk3rd/ksyun/kcm/options.go b/pkg/sdk3rd/ksyun/kcm/options.go
index 538ec5890..76ef48cd0 100644
--- a/pkg/sdk3rd/ksyun/kcm/options.go
+++ b/pkg/sdk3rd/ksyun/kcm/options.go
@@ -1,4 +1,4 @@
-package kcm
+package kcm
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/ksyun/zz-shared-common"
diff --git a/pkg/sdk3rd/ksyun/zz-shared-common/options.go b/pkg/sdk3rd/ksyun/zz-shared-common/options.go
index 6b95015c5..e185ad677 100644
--- a/pkg/sdk3rd/ksyun/zz-shared-common/options.go
+++ b/pkg/sdk3rd/ksyun/zz-shared-common/options.go
@@ -1,4 +1,4 @@
-package common
+package common
type Options struct {
AccessKeyId string
diff --git a/pkg/sdk3rd/ksyun/zz-shared-common/signer.go b/pkg/sdk3rd/ksyun/zz-shared-common/signer.go
index c2b78c6dd..daf5b9e73 100644
--- a/pkg/sdk3rd/ksyun/zz-shared-common/signer.go
+++ b/pkg/sdk3rd/ksyun/zz-shared-common/signer.go
@@ -1,4 +1,4 @@
-package common
+package common
import (
"bytes"
diff --git a/pkg/sdk3rd/lecdn/v3/client/options.go b/pkg/sdk3rd/lecdn/v3/client/options.go
index 46166fc6c..4e3b426c7 100644
--- a/pkg/sdk3rd/lecdn/v3/client/options.go
+++ b/pkg/sdk3rd/lecdn/v3/client/options.go
@@ -1,4 +1,4 @@
-package client
+package client
type Options struct {
Username string
diff --git a/pkg/sdk3rd/lecdn/v3/master/options.go b/pkg/sdk3rd/lecdn/v3/master/options.go
index 2a0799dc2..15af5eb1d 100644
--- a/pkg/sdk3rd/lecdn/v3/master/options.go
+++ b/pkg/sdk3rd/lecdn/v3/master/options.go
@@ -1,4 +1,4 @@
-package master
+package master
type Options struct {
Username string
diff --git a/pkg/sdk3rd/linode/options.go b/pkg/sdk3rd/linode/options.go
index f6f80d7b0..849bb671d 100644
--- a/pkg/sdk3rd/linode/options.go
+++ b/pkg/sdk3rd/linode/options.go
@@ -1,4 +1,4 @@
-package linode
+package linode
type Options struct {
AccessToken string
diff --git a/pkg/sdk3rd/matrix/options.go b/pkg/sdk3rd/matrix/options.go
index 583b6bd53..a462006fe 100644
--- a/pkg/sdk3rd/matrix/options.go
+++ b/pkg/sdk3rd/matrix/options.go
@@ -1,4 +1,4 @@
-package matrix
+package matrix
type Options struct {
UserId string
diff --git a/pkg/sdk3rd/mohua/options.go b/pkg/sdk3rd/mohua/options.go
index adfc63d80..64302cc32 100644
--- a/pkg/sdk3rd/mohua/options.go
+++ b/pkg/sdk3rd/mohua/options.go
@@ -1,4 +1,4 @@
-package mohua
+package mohua
type Options struct {
Username string
diff --git a/pkg/sdk3rd/netlify/options.go b/pkg/sdk3rd/netlify/options.go
index 08e60e8d0..e455d9cbc 100644
--- a/pkg/sdk3rd/netlify/options.go
+++ b/pkg/sdk3rd/netlify/options.go
@@ -1,4 +1,4 @@
-package netlify
+package netlify
type Options struct {
ApiToken string
diff --git a/pkg/sdk3rd/nginxproxymanager/options.go b/pkg/sdk3rd/nginxproxymanager/options.go
index 80ab27d80..1547a3c99 100644
--- a/pkg/sdk3rd/nginxproxymanager/options.go
+++ b/pkg/sdk3rd/nginxproxymanager/options.go
@@ -1,4 +1,4 @@
-package nginxproxymanager
+package nginxproxymanager
type Options struct {
Username string
diff --git a/pkg/sdk3rd/proxmoxbs/api_node_upload_custom_certificate.go b/pkg/sdk3rd/proxmoxbs/api_node_upload_custom_certificate.go
new file mode 100644
index 000000000..abb43e1de
--- /dev/null
+++ b/pkg/sdk3rd/proxmoxbs/api_node_upload_custom_certificate.go
@@ -0,0 +1,47 @@
+package proxmoxbs
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+)
+
+type NodeUploadCustomCertificateRequest CustomCertificate
+
+type NodeUploadCustomCertificateResponse struct {
+ Data []struct {
+ FileName string `json:"filename,omitempty"`
+ Fingerprint string `json:"fingerprint,omitempty"`
+ Subject string `json:"subject,omitempty"`
+ Issuer string `json:"issuer,omitempty"`
+ SAN []string `json:"san,omitempty"`
+ NotAfter int64 `json:"notafter,omitempty"`
+ NotBefore int64 `json:"notbefore,omitempty"`
+ } `json:"data,omitempty"`
+}
+
+func (c *Client) NodeUploadCustomCertificate(node string, req *NodeUploadCustomCertificateRequest) (*NodeUploadCustomCertificateResponse, error) {
+ return c.NodeUploadCustomCertificateWithContext(context.Background(), node, req)
+}
+
+func (c *Client) NodeUploadCustomCertificateWithContext(ctx context.Context, node string, req *NodeUploadCustomCertificateRequest) (*NodeUploadCustomCertificateResponse, error) {
+ if node == "" {
+ return nil, fmt.Errorf("sdkerr: bad request: unset node")
+ }
+
+ path := fmt.Sprintf("/nodes/%s/certificates/custom", node)
+ httpreq, err := c.newRequest(http.MethodPost, path)
+ if err != nil {
+ return nil, err
+ } else {
+ httpreq.SetBody(req)
+ httpreq.SetContext(ctx)
+ }
+
+ result := &NodeUploadCustomCertificateResponse{}
+ if _, err := c.doRequestWithResult(httpreq, result); err != nil {
+ return result, err
+ }
+
+ return result, nil
+}
diff --git a/pkg/sdk3rd/proxmoxbs/client.go b/pkg/sdk3rd/proxmoxbs/client.go
new file mode 100644
index 000000000..0c4740e1c
--- /dev/null
+++ b/pkg/sdk3rd/proxmoxbs/client.go
@@ -0,0 +1,113 @@
+// A simple SDK client for Proxmox Backup Server.
+// API documentation: https://pbs.proxmox.com/docs/api-viewer/
+package proxmoxbs
+
+import (
+ "crypto/tls"
+ "encoding/json"
+ "fmt"
+ "net/url"
+ "strings"
+ "time"
+
+ "github.com/go-resty/resty/v2"
+
+ "github.com/certimate-go/certimate/internal/app"
+)
+
+type Client struct {
+ rc *resty.Client
+}
+
+func NewClient(serverUrl string, optFns ...OptionsFunc) (*Client, error) {
+ opts := &Options{}
+ for _, fn := range optFns {
+ fn(opts)
+ }
+
+ if serverUrl == "" {
+ return nil, fmt.Errorf("sdkerr: unset serverUrl")
+ }
+ if _, err := url.Parse(serverUrl); err != nil {
+ return nil, fmt.Errorf("sdkerr: invalid serverUrl: %w", err)
+ }
+ if opts.TokenId == "" {
+ return nil, fmt.Errorf("sdkerr: unset token")
+ }
+ if opts.TokenSecret == "" {
+ return nil, fmt.Errorf("sdkerr: unset tokenSecret")
+ }
+
+ httper := resty.New().
+ SetBaseURL(strings.TrimSuffix(serverUrl, "/")+"/api2/json").
+ SetHeader("Accept", "application/json").
+ SetHeader("Authorization", fmt.Sprintf("PBSAPIToken=%s:%s", opts.TokenId, opts.TokenSecret)).
+ SetHeader("Content-Type", "application/json").
+ SetHeader("User-Agent", app.AppUserAgent)
+
+ return &Client{rc: httper}, nil
+}
+
+func (c *Client) SetTimeout(timeout time.Duration) *Client {
+ c.rc.SetTimeout(timeout)
+ return c
+}
+
+func (c *Client) SetTLSConfig(config *tls.Config) *Client {
+ c.rc.SetTLSClientConfig(config)
+ return c
+}
+
+func (c *Client) newRequest(method string, path string) (*resty.Request, error) {
+ if method == "" {
+ return nil, fmt.Errorf("sdkerr: unset method")
+ }
+ if path == "" {
+ return nil, fmt.Errorf("sdkerr: unset path")
+ }
+
+ req := c.rc.R()
+ req.Method = method
+ req.URL = path
+
+ // WARN:
+ // DO NOT CALL `req.SetResult` or `req.SetError` AGAIN! USE `doRequestWithResult` INSTEAD.
+ return req, nil
+}
+
+func (c *Client) doRequest(req *resty.Request) (*resty.Response, error) {
+ if req == nil {
+ return nil, fmt.Errorf("sdkerr: nil request")
+ }
+
+ resp, err := req.Send()
+ if err != nil {
+ return resp, fmt.Errorf("sdkerr: failed to send request: %w", err)
+ } else if resp.IsError() {
+ return resp, fmt.Errorf("sdkerr: unexpected status code: %d (resp: %s)", resp.StatusCode(), resp.String())
+ }
+
+ return resp, nil
+}
+
+func (c *Client) doRequestWithResult(req *resty.Request, res any) (*resty.Response, error) {
+ if req == nil {
+ return nil, fmt.Errorf("sdkerr: nil request")
+ }
+
+ resp, err := c.doRequest(req)
+ if err != nil {
+ if resp != nil {
+ json.Unmarshal(resp.Body(), &res)
+ }
+ return resp, err
+ }
+
+ if len(resp.Body()) != 0 {
+ if err := json.Unmarshal(resp.Body(), &res); err != nil {
+ return resp, fmt.Errorf("sdkerr: failed to unmarshal response: %w (resp: %s)", err, resp.String())
+ }
+ }
+
+ return resp, nil
+}
diff --git a/pkg/sdk3rd/proxmoxbs/models.go b/pkg/sdk3rd/proxmoxbs/models.go
new file mode 100644
index 000000000..acef210c1
--- /dev/null
+++ b/pkg/sdk3rd/proxmoxbs/models.go
@@ -0,0 +1,8 @@
+package proxmoxbs
+
+type CustomCertificate struct {
+ Certificates string `json:"certificates,omitempty"`
+ Force bool `json:"force,omitempty"`
+ Key string `json:"key,omitempty"`
+ Restart bool `json:"restart,omitempty"`
+}
diff --git a/pkg/sdk3rd/proxmoxbs/options.go b/pkg/sdk3rd/proxmoxbs/options.go
new file mode 100644
index 000000000..532bc4e40
--- /dev/null
+++ b/pkg/sdk3rd/proxmoxbs/options.go
@@ -0,0 +1,15 @@
+package proxmoxbs
+
+type Options struct {
+ TokenId string
+ TokenSecret string
+}
+
+type OptionsFunc func(*Options)
+
+func WithApiToken(tokenId string, tokenSecret string) OptionsFunc {
+ return func(o *Options) {
+ o.TokenId = tokenId
+ o.TokenSecret = tokenSecret
+ }
+}
diff --git a/pkg/sdk3rd/proxmoxve/client.go b/pkg/sdk3rd/proxmoxve/client.go
index d0c8618d1..da9a8bb1f 100644
--- a/pkg/sdk3rd/proxmoxve/client.go
+++ b/pkg/sdk3rd/proxmoxve/client.go
@@ -1,4 +1,4 @@
-// A simple SDK client for Proxmox VE.
+// A simple SDK client for Proxmox Virtual Environment.
// API documentation: https://pve.proxmox.com/pve-docs/api-viewer/index.html
package proxmoxve
diff --git a/pkg/sdk3rd/proxmoxve/options.go b/pkg/sdk3rd/proxmoxve/options.go
index ae7d83054..379da6e12 100644
--- a/pkg/sdk3rd/proxmoxve/options.go
+++ b/pkg/sdk3rd/proxmoxve/options.go
@@ -1,4 +1,4 @@
-package proxmoxve
+package proxmoxve
type Options struct {
TokenId string
diff --git a/pkg/sdk3rd/qingcloud/dns/options.go b/pkg/sdk3rd/qingcloud/dns/options.go
index 07a72cd90..8a0863e8d 100644
--- a/pkg/sdk3rd/qingcloud/dns/options.go
+++ b/pkg/sdk3rd/qingcloud/dns/options.go
@@ -1,4 +1,4 @@
-package dns
+package dns
type Options struct {
AccessKeyId string
diff --git a/pkg/sdk3rd/qingcloud/dns/signer.go b/pkg/sdk3rd/qingcloud/dns/signer.go
index 0896967e4..76aeeb6b3 100644
--- a/pkg/sdk3rd/qingcloud/dns/signer.go
+++ b/pkg/sdk3rd/qingcloud/dns/signer.go
@@ -1,4 +1,4 @@
-package dns
+package dns
import (
"crypto/hmac"
diff --git a/pkg/sdk3rd/qingcloud/lb/service.go b/pkg/sdk3rd/qingcloud/lb/service.go
index 47068931b..bd9a34fb6 100644
--- a/pkg/sdk3rd/qingcloud/lb/service.go
+++ b/pkg/sdk3rd/qingcloud/lb/service.go
@@ -1,4 +1,4 @@
-// An extension SDK client for QingCloud LB service.
+// An extension SDK client for QingCloud LB service.
// Based on github.com/yunify/qingcloud-sdk-go.
package lb
diff --git a/pkg/sdk3rd/qingcloud/lb/types.go b/pkg/sdk3rd/qingcloud/lb/types.go
index 2c99dcc9a..f9eb750f1 100644
--- a/pkg/sdk3rd/qingcloud/lb/types.go
+++ b/pkg/sdk3rd/qingcloud/lb/types.go
@@ -1,4 +1,4 @@
-package lb
+package lb
import (
"github.com/yunify/qingcloud-sdk-go/service"
diff --git a/pkg/sdk3rd/rainyun/options.go b/pkg/sdk3rd/rainyun/options.go
index 0ecf077d0..00be51a1b 100644
--- a/pkg/sdk3rd/rainyun/options.go
+++ b/pkg/sdk3rd/rainyun/options.go
@@ -1,4 +1,4 @@
-package rainyun
+package rainyun
type Options struct {
ApiKey string
diff --git a/pkg/sdk3rd/ratpanel/options.go b/pkg/sdk3rd/ratpanel/options.go
index 9b7e078b5..e7db68f2d 100644
--- a/pkg/sdk3rd/ratpanel/options.go
+++ b/pkg/sdk3rd/ratpanel/options.go
@@ -1,4 +1,4 @@
-package ratpanel
+package ratpanel
type Options struct {
AccessTokenId int64
diff --git a/pkg/sdk3rd/safeline/options.go b/pkg/sdk3rd/safeline/options.go
index 4a02b3fd2..d497a26e6 100644
--- a/pkg/sdk3rd/safeline/options.go
+++ b/pkg/sdk3rd/safeline/options.go
@@ -1,4 +1,4 @@
-package safeline
+package safeline
type Options struct {
ApiToken string
diff --git a/pkg/sdk3rd/samwaf/options.go b/pkg/sdk3rd/samwaf/options.go
index 86c9b67eb..f5e07ebcc 100644
--- a/pkg/sdk3rd/samwaf/options.go
+++ b/pkg/sdk3rd/samwaf/options.go
@@ -1,4 +1,4 @@
-package samwaf
+package samwaf
type Options struct {
ApiKey string
diff --git a/pkg/sdk3rd/synologydsm/api_auth_login.go b/pkg/sdk3rd/synologydsm/api_auth_login.go
index 72632bc84..1c5177285 100644
--- a/pkg/sdk3rd/synologydsm/api_auth_login.go
+++ b/pkg/sdk3rd/synologydsm/api_auth_login.go
@@ -1,4 +1,4 @@
-package synologydsm
+package synologydsm
import (
"fmt"
diff --git a/pkg/sdk3rd/synologydsm/api_auth_logout.go b/pkg/sdk3rd/synologydsm/api_auth_logout.go
index ac0d4aa2b..8c8661fbf 100644
--- a/pkg/sdk3rd/synologydsm/api_auth_logout.go
+++ b/pkg/sdk3rd/synologydsm/api_auth_logout.go
@@ -1,4 +1,4 @@
-package synologydsm
+package synologydsm
import (
"fmt"
diff --git a/pkg/sdk3rd/synologydsm/api_core_certificate_crt_list.go b/pkg/sdk3rd/synologydsm/api_core_certificate_crt_list.go
index 10f80600e..65a4c121a 100644
--- a/pkg/sdk3rd/synologydsm/api_core_certificate_crt_list.go
+++ b/pkg/sdk3rd/synologydsm/api_core_certificate_crt_list.go
@@ -1,4 +1,4 @@
-package synologydsm
+package synologydsm
import (
"net/http"
diff --git a/pkg/sdk3rd/synologydsm/api_core_certificate_import.go b/pkg/sdk3rd/synologydsm/api_core_certificate_import.go
index 07d678624..1df0f5894 100644
--- a/pkg/sdk3rd/synologydsm/api_core_certificate_import.go
+++ b/pkg/sdk3rd/synologydsm/api_core_certificate_import.go
@@ -1,4 +1,4 @@
-package synologydsm
+package synologydsm
import (
"fmt"
diff --git a/pkg/sdk3rd/synologydsm/api_core_certificate_service_set.go b/pkg/sdk3rd/synologydsm/api_core_certificate_service_set.go
index 74ee26f64..b7f5d9079 100644
--- a/pkg/sdk3rd/synologydsm/api_core_certificate_service_set.go
+++ b/pkg/sdk3rd/synologydsm/api_core_certificate_service_set.go
@@ -1,4 +1,4 @@
-package synologydsm
+package synologydsm
import (
"encoding/json"
diff --git a/pkg/sdk3rd/synologydsm/api_info_query.go b/pkg/sdk3rd/synologydsm/api_info_query.go
index 38924017c..941dcacdc 100644
--- a/pkg/sdk3rd/synologydsm/api_info_query.go
+++ b/pkg/sdk3rd/synologydsm/api_info_query.go
@@ -1,4 +1,4 @@
-package synologydsm
+package synologydsm
import (
"fmt"
diff --git a/pkg/sdk3rd/synologydsm/utils.go b/pkg/sdk3rd/synologydsm/utils.go
index 76f4518d0..e4fc397e4 100644
--- a/pkg/sdk3rd/synologydsm/utils.go
+++ b/pkg/sdk3rd/synologydsm/utils.go
@@ -1,4 +1,4 @@
-package synologydsm
+package synologydsm
func getAuthErrorDescription(code int) string {
switch code {
diff --git a/pkg/sdk3rd/tencentcloud/teomakers/options.go b/pkg/sdk3rd/tencentcloud/teomakers/options.go
index 55a5747d7..b4f4971b3 100644
--- a/pkg/sdk3rd/tencentcloud/teomakers/options.go
+++ b/pkg/sdk3rd/tencentcloud/teomakers/options.go
@@ -1,4 +1,4 @@
-package teomakers
+package teomakers
type Options struct {
BaseEndpoint string
diff --git a/pkg/sdk3rd/upyun/console/options.go b/pkg/sdk3rd/upyun/console/options.go
index 5e38f0535..228124424 100644
--- a/pkg/sdk3rd/upyun/console/options.go
+++ b/pkg/sdk3rd/upyun/console/options.go
@@ -1,4 +1,4 @@
-package console
+package console
type Options struct {
Username string
diff --git a/pkg/sdk3rd/vercel/options.go b/pkg/sdk3rd/vercel/options.go
index b9c385587..29e2025e3 100644
--- a/pkg/sdk3rd/vercel/options.go
+++ b/pkg/sdk3rd/vercel/options.go
@@ -1,4 +1,4 @@
-package vercel
+package vercel
type Options struct {
ApiToken string
diff --git a/pkg/sdk3rd/vercel/types.go b/pkg/sdk3rd/vercel/types.go
index 256a396ed..4ff5b2e3d 100644
--- a/pkg/sdk3rd/vercel/types.go
+++ b/pkg/sdk3rd/vercel/types.go
@@ -1,20 +1,20 @@
package vercel
type sdkResponse interface {
- GetError() *sdkError
+ GetError() *sdkAPIError
}
type sdkResponseBase struct {
- Error *sdkError `json:"error,omitempty"`
+ Error *sdkAPIError `json:"error,omitempty"`
}
-type sdkError struct {
+type sdkAPIError struct {
Code string `json:"code"`
Message string `json:"message"`
MissingToken bool `json:"missingToken,omitempty"`
}
-func (r *sdkResponseBase) GetError() *sdkError {
+func (r *sdkResponseBase) GetError() *sdkAPIError {
return r.Error
}
diff --git a/pkg/sdk3rd/volcengine/tos/client.go b/pkg/sdk3rd/volcengine/tos/client.go
index f6ea138b4..c2ae314e1 100644
--- a/pkg/sdk3rd/volcengine/tos/client.go
+++ b/pkg/sdk3rd/volcengine/tos/client.go
@@ -1,4 +1,4 @@
-// A simple SDK client for VolcEngine TOS.
+// A simple SDK client for VolcEngine TOS.
// API documentation: https://www.volcengine.com/docs/6349/74837
package tos
diff --git a/pkg/sdk3rd/volcengine/tos/options.go b/pkg/sdk3rd/volcengine/tos/options.go
index cb78a312a..08e207ab9 100644
--- a/pkg/sdk3rd/volcengine/tos/options.go
+++ b/pkg/sdk3rd/volcengine/tos/options.go
@@ -1,4 +1,4 @@
-package tos
+package tos
type Options struct {
AccessKeyId string
diff --git a/pkg/sdk3rd/volcengine/tos/signer.go b/pkg/sdk3rd/volcengine/tos/signer.go
index 5d4caffd3..455a0dd54 100644
--- a/pkg/sdk3rd/volcengine/tos/signer.go
+++ b/pkg/sdk3rd/volcengine/tos/signer.go
@@ -1,4 +1,4 @@
-package tos
+package tos
import (
"bytes"
diff --git a/pkg/sdk3rd/wangsu/cdn/options.go b/pkg/sdk3rd/wangsu/cdn/options.go
index eb41705be..eb9ffaf8a 100644
--- a/pkg/sdk3rd/wangsu/cdn/options.go
+++ b/pkg/sdk3rd/wangsu/cdn/options.go
@@ -1,4 +1,4 @@
-package cdn
+package cdn
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/wangsu/zz-shared-common"
diff --git a/pkg/sdk3rd/wangsu/cdnpro/options.go b/pkg/sdk3rd/wangsu/cdnpro/options.go
index 0b844fe3b..43ed1829f 100644
--- a/pkg/sdk3rd/wangsu/cdnpro/options.go
+++ b/pkg/sdk3rd/wangsu/cdnpro/options.go
@@ -1,4 +1,4 @@
-package cdnpro
+package cdnpro
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/wangsu/zz-shared-common"
diff --git a/pkg/sdk3rd/wangsu/certificate/options.go b/pkg/sdk3rd/wangsu/certificate/options.go
index 306738dee..397d936e7 100644
--- a/pkg/sdk3rd/wangsu/certificate/options.go
+++ b/pkg/sdk3rd/wangsu/certificate/options.go
@@ -1,4 +1,4 @@
-package certificate
+package certificate
import (
common "github.com/certimate-go/certimate/pkg/sdk3rd/wangsu/zz-shared-common"
diff --git a/pkg/sdk3rd/wangsu/zz-shared-common/options.go b/pkg/sdk3rd/wangsu/zz-shared-common/options.go
index fa1c29a00..03dae25e0 100644
--- a/pkg/sdk3rd/wangsu/zz-shared-common/options.go
+++ b/pkg/sdk3rd/wangsu/zz-shared-common/options.go
@@ -1,4 +1,4 @@
-package common
+package common
type Options struct {
AccessKey string
diff --git a/pkg/sdk3rd/wangsu/zz-shared-common/signer.go b/pkg/sdk3rd/wangsu/zz-shared-common/signer.go
index 5a9e74fb6..1dad628ed 100644
--- a/pkg/sdk3rd/wangsu/zz-shared-common/signer.go
+++ b/pkg/sdk3rd/wangsu/zz-shared-common/signer.go
@@ -1,4 +1,4 @@
-package common
+package common
import (
"bytes"
diff --git a/pkg/sdk3rd/zenlayer/cdn/client.go b/pkg/sdk3rd/zenlayer/cdn/client.go
index 6718bdcde..3be87ebdb 100644
--- a/pkg/sdk3rd/zenlayer/cdn/client.go
+++ b/pkg/sdk3rd/zenlayer/cdn/client.go
@@ -1,4 +1,4 @@
-// An extension SDK client for ZenlayerCloud CDN service.
+// An extension SDK client for ZenlayerCloud CDN service.
// Based on github.com/zenlayer/zenlayercloud-sdk-go.
package cdn
diff --git a/pkg/sdk3rd/zenlayer/cdn/models.go b/pkg/sdk3rd/zenlayer/cdn/models.go
index a1734dd47..55187acc1 100644
--- a/pkg/sdk3rd/zenlayer/cdn/models.go
+++ b/pkg/sdk3rd/zenlayer/cdn/models.go
@@ -1,4 +1,4 @@
-package cdn
+package cdn
import (
"github.com/zenlayer/zenlayercloud-sdk-go/zenlayercloud/common"
diff --git a/pkg/sdk3rd/zenlayer/zga/client.go b/pkg/sdk3rd/zenlayer/zga/client.go
index 92a4edbe4..2e7db14ee 100644
--- a/pkg/sdk3rd/zenlayer/zga/client.go
+++ b/pkg/sdk3rd/zenlayer/zga/client.go
@@ -1,4 +1,4 @@
-// An extension SDK client for ZenlayerCloud CDN service.
+// An extension SDK client for ZenlayerCloud CDN service.
// Based on github.com/zenlayer/zenlayercloud-sdk-go.
package zga
diff --git a/pkg/sdk3rd/zenlayer/zga/models.go b/pkg/sdk3rd/zenlayer/zga/models.go
index a8adc054f..e9c1f847e 100644
--- a/pkg/sdk3rd/zenlayer/zga/models.go
+++ b/pkg/sdk3rd/zenlayer/zga/models.go
@@ -1,4 +1,4 @@
-package zga
+package zga
import (
zga20230706 "github.com/zenlayer/zenlayercloud-sdk-go/zenlayercloud/zga20230706"
diff --git a/pkg/utils/cert/pfx/encoder.go b/pkg/utils/cert/pfx/encoder.go
index 0ee9906cc..0c12ab248 100644
--- a/pkg/utils/cert/pfx/encoder.go
+++ b/pkg/utils/cert/pfx/encoder.go
@@ -1,4 +1,4 @@
-package pfx
+package pfx
import (
"fmt"
diff --git a/pkg/utils/cert/x509/x509.go b/pkg/utils/cert/x509/x509.go
index fddfa0be2..ae6256433 100644
--- a/pkg/utils/cert/x509/x509.go
+++ b/pkg/utils/cert/x509/x509.go
@@ -1,4 +1,4 @@
-package x509
+package x509
import (
"crypto/x509"
diff --git a/pkg/utils/loop/forrange.go b/pkg/utils/loop/forrange.go
index 070ff3531..1818cc7af 100644
--- a/pkg/utils/loop/forrange.go
+++ b/pkg/utils/loop/forrange.go
@@ -1,4 +1,4 @@
-package loop
+package loop
import (
"context"
diff --git a/pkg/utils/maps/copy.go b/pkg/utils/maps/copy.go
index b17909917..b935877f4 100644
--- a/pkg/utils/maps/copy.go
+++ b/pkg/utils/maps/copy.go
@@ -1,4 +1,4 @@
-package maps
+package maps
// 将源字典中的所有键值对复制到目标字典中。
//
diff --git a/pkg/utils/maps/key.go b/pkg/utils/maps/key.go
index 2c97976ce..10f2f8714 100644
--- a/pkg/utils/maps/key.go
+++ b/pkg/utils/maps/key.go
@@ -1,4 +1,4 @@
-package maps
+package maps
// 获取字典中的所有键组成的切片。
//
diff --git a/pkg/utils/third-party/alibabacloud/intl.go b/pkg/utils/third-party/alibabacloud/intl.go
index df1f1f060..ade45e7e8 100644
--- a/pkg/utils/third-party/alibabacloud/intl.go
+++ b/pkg/utils/third-party/alibabacloud/intl.go
@@ -1,4 +1,4 @@
-package alibabacloud
+package alibabacloud
import (
"strings"
diff --git a/pkg/utils/third-party/tencentcloud/intl.go b/pkg/utils/third-party/tencentcloud/intl.go
index 6ff010388..fcbc1f387 100644
--- a/pkg/utils/third-party/tencentcloud/intl.go
+++ b/pkg/utils/third-party/tencentcloud/intl.go
@@ -1,4 +1,4 @@
-package tencentcloud
+package tencentcloud
import (
"strings"
diff --git a/pkg/utils/wait/delay.go b/pkg/utils/wait/delay.go
index a3867f178..f3e17374c 100644
--- a/pkg/utils/wait/delay.go
+++ b/pkg/utils/wait/delay.go
@@ -1,4 +1,4 @@
-package wait
+package wait
import (
"context"
diff --git a/pkg/utils/wait/until.go b/pkg/utils/wait/until.go
index ee0a5cb72..15dcdd5bb 100644
--- a/pkg/utils/wait/until.go
+++ b/pkg/utils/wait/until.go
@@ -1,4 +1,4 @@
-package wait
+package wait
import (
"context"
diff --git a/ui/.npmrc b/ui/.npmrc
index 946dc638b..4633eb2ba 100644
--- a/ui/.npmrc
+++ b/ui/.npmrc
@@ -1,2 +1,2 @@
ignore-scripts=true
-min-release-age=7
+min-release-age=3
diff --git a/ui/embed.go b/ui/embed.go
index dc02dac5a..9335e4fa1 100644
--- a/ui/embed.go
+++ b/ui/embed.go
@@ -1,4 +1,3 @@
-// Package ui handles the PocketBase Admin frontend embedding.
package ui
import (
@@ -10,5 +9,4 @@ import (
//go:embed all:dist
var distDir embed.FS
-// DistDirFS contains the embedded dist directory files (without the "dist" prefix)
var DistDirFS = apis.MustSubFS(distDir, "dist")
diff --git a/ui/eslint.config.mjs b/ui/eslint.config.mjs
index f0d32460b..ebbc81bf4 100644
--- a/ui/eslint.config.mjs
+++ b/ui/eslint.config.mjs
@@ -15,6 +15,9 @@ import noRootRelativeUrlRule from "./scripts/eslint/rules/no-root-relative-url.m
export default defineConfig(
// Basic
eslint.configs["recommended"],
+ {
+ ignores: ["**/node_modules/**", "**/dist/**", "**/*.min.js"],
+ },
{
name: "eslint/import",
extends: [importPlugin.flatConfigs["recommended"], importPlugin.flatConfigs["typescript"]],
diff --git a/ui/package-lock.json b/ui/package-lock.json
index 9bc3169fc..156c9d678 100644
--- a/ui/package-lock.json
+++ b/ui/package-lock.json
@@ -20,29 +20,29 @@
"@peculiar/asn1-rsa": "^2.8.0",
"@peculiar/asn1-schema": "^2.8.0",
"@peculiar/x509": "^2.0.0",
- "@tabler/icons-react": "^3.45.0",
+ "@tabler/icons-react": "^3.46.0",
"@uiw/codemirror-extensions-basic-setup": "^4.25.11",
"@uiw/codemirror-theme-vscode": "^4.25.11",
"@uiw/react-codemirror": "^4.25.11",
"ahooks": "^3.9.7",
- "antd": "^6.5.1",
+ "antd": "^6.5.3",
"antd-zod": "^8.0.0",
"clsx": "^2.1.1",
- "cron-parser": "^5.6.2",
+ "cron-parser": "^5.7.0",
"dayjs": "^1.11.21",
"file-saver": "^2.0.5",
"i18next": "^26.3.6",
"i18next-browser-languagedetector": "^8.2.1",
"immer": "^11.1.15",
"nanoid": "^6.0.0",
- "pocketbase": "^0.27.0",
+ "pocketbase": "^0.27.1",
"radash": "^12.1.1",
"react": "^18.3.1",
"react-copy-to-clipboard": "^5.1.1",
"react-dom": "^18.3.1",
- "react-i18next": "^17.0.10",
+ "react-i18next": "^17.0.11",
"react-router": "^7.18.0",
- "react-router-dom": "^7.18.1",
+ "react-router-dom": "^7.18.2",
"reflect-metadata": "^0.2.2",
"tailwind-merge": "^3.6.0",
"yaml": "^2.9.0",
@@ -61,8 +61,8 @@
"@types/react": "^18.3.31",
"@types/react-copy-to-clipboard": "^5.0.7",
"@types/react-dom": "^18.3.7",
- "@vitejs/plugin-legacy": "^8.2.1",
- "@vitejs/plugin-react": "^6.0.3",
+ "@vitejs/plugin-legacy": "^8.2.2",
+ "@vitejs/plugin-react": "^6.0.5",
"eslint": "^9.39.5",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.5",
@@ -71,13 +71,13 @@
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.3",
- "fs-extra": "^11.3.6",
+ "fs-extra": "^11.4.0",
"jsdom": "^29.1.1",
"prettier": "^3.9.6",
"tailwindcss": "^4.3.3",
"typescript": "^6.0.3",
- "typescript-eslint": "^8.64.0",
- "vite": "^8.0.16",
+ "typescript-eslint": "^8.65.0",
+ "vite": "^8.2.0",
"vitest": "^4.1.10"
},
"engines": {
@@ -89,7 +89,8 @@
"version": "4.5.0",
"resolved": "https://registry.npmmirror.com/@adobe/css-tools/-/css-tools-4.5.0.tgz",
"integrity": "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/@alloc/quick-lru": {
"version": "5.2.0",
@@ -181,9 +182,10 @@
"license": "MIT"
},
"node_modules/@ant-design/pro-components": {
- "version": "3.1.14-3",
- "resolved": "https://registry.npmmirror.com/@ant-design/pro-components/-/pro-components-3.1.14-3.tgz",
- "integrity": "sha512-K8idcrmfja5agoAwLaRedCLCxsK/y8bKCJFXhGfKfNvWX6YO35wdnmuQR6I43CTG9aLC7ocWegYXeqnYtzh3eg==",
+ "version": "3.1.14-6",
+ "resolved": "https://registry.npmmirror.com/@ant-design/pro-components/-/pro-components-3.1.14-6.tgz",
+ "integrity": "sha512-xAlrM2dSMvYh5MuwBiyylc749xKWhRLC4HAJHmMOUtM6NdGfTfEqlRqcHJeYZJonL0URdK80YLpzbgEJu7/vAA==",
+ "license": "MIT",
"dependencies": {
"@ant-design/cssinjs": "^2.1.2",
"@ant-design/cssinjs-utils": "2.1.2",
@@ -197,8 +199,8 @@
"@emotion/css": "^11.13.5",
"@rc-component/form": "^1.8.5",
"@rc-component/resize-observer": "^1.1.2",
- "@rc-component/table": "^1.10.2",
- "@rc-component/util": "^1.11.1",
+ "@rc-component/table": "^1.10.4",
+ "@rc-component/util": "^1.12.0",
"@umijs/route-utils": "^4.0.3",
"clsx": "^2.1.1",
"dayjs": "^1.11.21",
@@ -208,6 +210,9 @@
"safe-stable-stringify": "^2.5.0",
"swr": "^2.4.2"
},
+ "engines": {
+ "node": ">=22.12.0"
+ },
"peerDependencies": {
"antd": "^6.0.0",
"react": ">=18.0.0",
@@ -235,6 +240,7 @@
"resolved": "https://registry.npmmirror.com/@asamuzakjp/css-color/-/css-color-5.1.11.tgz",
"integrity": "sha512-KVw6qIiCTUQhByfTd78h2yD1/00waTmm9uy/R7Ck/ctUyAPj+AEDLkQIdJW0T8+qGgj3j5bpNKK7Q3G+LedJWg==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@asamuzakjp/generational-cache": "^1.0.1",
"@csstools/css-calc": "^3.2.0",
@@ -251,6 +257,7 @@
"resolved": "https://registry.npmmirror.com/@asamuzakjp/dom-selector/-/dom-selector-7.1.1.tgz",
"integrity": "sha512-67RZDnYRc8H/8MLDgQCDE//zoqVFwajkepHZgmXrbwybzXOEwOWGPYGmALYl9J2DOLfFPPs6kKCqmbzV895hTQ==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@asamuzakjp/generational-cache": "^1.0.1",
"@asamuzakjp/nwsapi": "^2.3.9",
@@ -267,6 +274,7 @@
"resolved": "https://registry.npmmirror.com/@asamuzakjp/generational-cache/-/generational-cache-1.0.1.tgz",
"integrity": "sha512-wajfB8KqzMCN2KGNFdLkReeHncd0AslUSrvHVvvYWuU8ghncRJoA50kT3zP9MVL0+9g4/67H+cdvBskj9THPzg==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
}
@@ -275,7 +283,8 @@
"version": "2.3.9",
"resolved": "https://registry.npmmirror.com/@asamuzakjp/nwsapi/-/nwsapi-2.3.9.tgz",
"integrity": "sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/@babel/code-frame": {
"version": "7.29.7",
@@ -1807,6 +1816,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.29.7.tgz",
"integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==",
+ "license": "MIT",
"engines": {
"node": ">=6.9.0"
}
@@ -1861,6 +1871,7 @@
"resolved": "https://registry.npmmirror.com/@bramus/specificity/-/specificity-2.4.2.tgz",
"integrity": "sha512-ctxtJ/eA+t+6q2++vj5j7FYX3nRu311q1wfYH3xjlLOsczhlhxAg2FWNUXhpGvAw3BWo1xBcvOV6/YLc2r5FJw==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"css-tree": "^3.0.0"
},
@@ -2001,6 +2012,7 @@
"url": "https://opencollective.com/csstools"
}
],
+ "license": "MIT-0",
"engines": {
"node": ">=20.19.0"
}
@@ -2020,6 +2032,7 @@
"url": "https://opencollective.com/csstools"
}
],
+ "license": "MIT",
"engines": {
"node": ">=20.19.0"
},
@@ -2043,6 +2056,7 @@
"url": "https://opencollective.com/csstools"
}
],
+ "license": "MIT",
"dependencies": {
"@csstools/color-helpers": "^6.1.0",
"@csstools/css-calc": "^3.3.0"
@@ -2070,6 +2084,7 @@
"url": "https://opencollective.com/csstools"
}
],
+ "license": "MIT",
"engines": {
"node": ">=20.19.0"
},
@@ -2092,6 +2107,7 @@
"url": "https://opencollective.com/csstools"
}
],
+ "license": "MIT-0",
"peerDependencies": {
"css-tree": "^3.2.1"
},
@@ -2116,6 +2132,7 @@
"url": "https://opencollective.com/csstools"
}
],
+ "license": "MIT",
"engines": {
"node": ">=20.19.0"
}
@@ -2124,6 +2141,7 @@
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-4.2.0.tgz",
"integrity": "sha512-kzyuwOAQnXJNLS9PSyrk0CWk35nWJW/zl/6KvnTBMFK65gm7U1/Z5BqjxeapjZCIhQcM/DsrEmcbRwDyXyXK4A==",
+ "license": "MIT",
"engines": {
"node": ">=14"
}
@@ -2132,6 +2150,7 @@
"version": "3.1.1",
"resolved": "https://registry.npmmirror.com/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz",
"integrity": "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw==",
+ "license": "MIT",
"dependencies": {
"tslib": "^2.0.0"
},
@@ -2143,6 +2162,7 @@
"version": "6.3.1",
"resolved": "https://registry.npmmirror.com/@dnd-kit/core/-/core-6.3.1.tgz",
"integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==",
+ "license": "MIT",
"dependencies": {
"@dnd-kit/accessibility": "^3.1.1",
"@dnd-kit/utilities": "^3.2.2",
@@ -2157,6 +2177,7 @@
"version": "9.0.0",
"resolved": "https://registry.npmmirror.com/@dnd-kit/modifiers/-/modifiers-9.0.0.tgz",
"integrity": "sha512-ybiLc66qRGuZoC20wdSSG6pDXFikui/dCNGthxv4Ndy8ylErY0N3KVxY2bgo7AWwIbxDmXDg3ylAFmnrjcbVvw==",
+ "license": "MIT",
"dependencies": {
"@dnd-kit/utilities": "^3.2.2",
"tslib": "^2.0.0"
@@ -2170,6 +2191,7 @@
"version": "10.0.0",
"resolved": "https://registry.npmmirror.com/@dnd-kit/sortable/-/sortable-10.0.0.tgz",
"integrity": "sha512-+xqhmIIzvAYMGfBYYnbKuNicfSsk4RksY2XdmJhT+HAC01nix6fHCztU68jooFiMUB01Ky3F0FyOvhG/BZrWkg==",
+ "license": "MIT",
"dependencies": {
"@dnd-kit/utilities": "^3.2.2",
"tslib": "^2.0.0"
@@ -2183,6 +2205,7 @@
"version": "3.2.2",
"resolved": "https://registry.npmmirror.com/@dnd-kit/utilities/-/utilities-3.2.2.tgz",
"integrity": "sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg==",
+ "license": "MIT",
"dependencies": {
"tslib": "^2.0.0"
},
@@ -2228,6 +2251,7 @@
"version": "11.13.5",
"resolved": "https://registry.npmmirror.com/@emotion/babel-plugin/-/babel-plugin-11.13.5.tgz",
"integrity": "sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ==",
+ "license": "MIT",
"dependencies": {
"@babel/helper-module-imports": "^7.16.7",
"@babel/runtime": "^7.18.3",
@@ -2245,17 +2269,20 @@
"node_modules/@emotion/babel-plugin/node_modules/@emotion/hash": {
"version": "0.9.2",
"resolved": "https://registry.npmmirror.com/@emotion/hash/-/hash-0.9.2.tgz",
- "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g=="
+ "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==",
+ "license": "MIT"
},
"node_modules/@emotion/babel-plugin/node_modules/convert-source-map": {
"version": "1.9.0",
"resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-1.9.0.tgz",
- "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="
+ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==",
+ "license": "MIT"
},
"node_modules/@emotion/babel-plugin/node_modules/source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==",
+ "license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
}
@@ -2263,12 +2290,14 @@
"node_modules/@emotion/babel-plugin/node_modules/stylis": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/stylis/-/stylis-4.2.0.tgz",
- "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw=="
+ "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==",
+ "license": "MIT"
},
"node_modules/@emotion/cache": {
"version": "11.14.0",
"resolved": "https://registry.npmmirror.com/@emotion/cache/-/cache-11.14.0.tgz",
"integrity": "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==",
+ "license": "MIT",
"dependencies": {
"@emotion/memoize": "^0.9.0",
"@emotion/sheet": "^1.4.0",
@@ -2280,12 +2309,14 @@
"node_modules/@emotion/cache/node_modules/stylis": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/stylis/-/stylis-4.2.0.tgz",
- "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw=="
+ "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==",
+ "license": "MIT"
},
"node_modules/@emotion/css": {
"version": "11.13.5",
"resolved": "https://registry.npmmirror.com/@emotion/css/-/css-11.13.5.tgz",
"integrity": "sha512-wQdD0Xhkn3Qy2VNcIzbLP9MR8TafI0MJb7BEAXKp+w4+XqErksWR4OXomuDzPsN4InLdGhVe6EYcn2ZIUCpB8w==",
+ "license": "MIT",
"dependencies": {
"@emotion/babel-plugin": "^11.13.5",
"@emotion/cache": "^11.13.5",
@@ -2303,12 +2334,14 @@
"node_modules/@emotion/memoize": {
"version": "0.9.0",
"resolved": "https://registry.npmmirror.com/@emotion/memoize/-/memoize-0.9.0.tgz",
- "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ=="
+ "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==",
+ "license": "MIT"
},
"node_modules/@emotion/serialize": {
"version": "1.3.3",
"resolved": "https://registry.npmmirror.com/@emotion/serialize/-/serialize-1.3.3.tgz",
"integrity": "sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA==",
+ "license": "MIT",
"dependencies": {
"@emotion/hash": "^0.9.2",
"@emotion/memoize": "^0.9.0",
@@ -2320,17 +2353,20 @@
"node_modules/@emotion/serialize/node_modules/@emotion/hash": {
"version": "0.9.2",
"resolved": "https://registry.npmmirror.com/@emotion/hash/-/hash-0.9.2.tgz",
- "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g=="
+ "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==",
+ "license": "MIT"
},
"node_modules/@emotion/serialize/node_modules/@emotion/unitless": {
"version": "0.10.0",
"resolved": "https://registry.npmmirror.com/@emotion/unitless/-/unitless-0.10.0.tgz",
- "integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg=="
+ "integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==",
+ "license": "MIT"
},
"node_modules/@emotion/sheet": {
"version": "1.4.0",
"resolved": "https://registry.npmmirror.com/@emotion/sheet/-/sheet-1.4.0.tgz",
- "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg=="
+ "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==",
+ "license": "MIT"
},
"node_modules/@emotion/unitless": {
"version": "0.7.5",
@@ -2341,12 +2377,14 @@
"node_modules/@emotion/utils": {
"version": "1.4.2",
"resolved": "https://registry.npmmirror.com/@emotion/utils/-/utils-1.4.2.tgz",
- "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA=="
+ "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==",
+ "license": "MIT"
},
"node_modules/@emotion/weak-memoize": {
"version": "0.4.0",
"resolved": "https://registry.npmmirror.com/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz",
- "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg=="
+ "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==",
+ "license": "MIT"
},
"node_modules/@eslint-community/eslint-utils": {
"version": "4.9.1",
@@ -2419,13 +2457,13 @@
}
},
"node_modules/@eslint/css-tree": {
- "version": "4.0.4",
- "resolved": "https://registry.npmmirror.com/@eslint/css-tree/-/css-tree-4.0.4.tgz",
- "integrity": "sha512-nxMparyhqVWQvadx9x8dIfubfIPOE+X2b2waua8fzdnM9vdp9rgVtwEZlG0TmCwEUz/d/f40fzvO/eqBwdxz0A==",
+ "version": "4.0.5",
+ "resolved": "https://registry.npmmirror.com/@eslint/css-tree/-/css-tree-4.0.5.tgz",
+ "integrity": "sha512-iPmijIAq4hlIJB86PYmY/fcZORHtjphSqICDbwuw32A/JmkhZQ/K/6TjHE03zqf3n5yABpVcbRAMG8Mi9ojy8g==",
"dev": true,
"license": "MIT",
"dependencies": {
- "mdn-data": "2.28.1",
+ "mdn-data": "2.29.0",
"source-map-js": "^1.2.1"
},
"engines": {
@@ -2498,6 +2536,7 @@
"resolved": "https://registry.npmmirror.com/@exodus/bytes/-/bytes-1.15.1.tgz",
"integrity": "sha512-S6mL0yNB/Abt9Ei4tq8gDhcczc4S3+vQ4ra7vxnAf+YHC02srtqxKKZghx2Dq6p0e66THKwR6r8N6P95wEty7Q==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
},
@@ -3385,9 +3424,9 @@
}
},
"node_modules/@oxc-project/types": {
- "version": "0.133.0",
- "resolved": "https://registry.npmmirror.com/@oxc-project/types/-/types-0.133.0.tgz",
- "integrity": "sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==",
+ "version": "0.143.0",
+ "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.143.0.tgz",
+ "integrity": "sha512-u6JZdLBTLotrNC9Vd6vPssINdzcCzleKAH6EJKImQb7GtYvX5keN2dxkoK44stCc4tffE6QQRtZTXVSzsLUlWA==",
"dev": true,
"license": "MIT",
"funding": {
@@ -3722,9 +3761,9 @@
}
},
"node_modules/@rc-component/form": {
- "version": "1.8.5",
- "resolved": "https://registry.npmmirror.com/@rc-component/form/-/form-1.8.5.tgz",
- "integrity": "sha512-d24EYtvUOBhxEtSd/EqIu9DaMuqrWF2IRIvAFCTM6NQ/GJIYNr8DvEpUSUlv2uPxEJ0ZPwYQ+wwlGIAaiHvdrw==",
+ "version": "1.8.6",
+ "resolved": "https://registry.npmmirror.com/@rc-component/form/-/form-1.8.6.tgz",
+ "integrity": "sha512-1EXVsSKPZC6kGrIqxVck7kAWM6T65b6et/n5wIcyiaIa41VrDshD0nVLHoBDEIZr2ATQsOP6icb4XQkNFMLBAw==",
"license": "MIT",
"dependencies": {
"@rc-component/async-validator": "^6.0.0",
@@ -3910,9 +3949,9 @@
}
},
"node_modules/@rc-component/picker": {
- "version": "1.11.0",
- "resolved": "https://registry.npmmirror.com/@rc-component/picker/-/picker-1.11.0.tgz",
- "integrity": "sha512-6qXGKtoJvO8sUd17m5cyNEbEJub0zflCHnaZTBBmj63DPRZYc0WEHN8rp6hFSl+yMCJS/dJY5G+1fQ8bLCuD7A==",
+ "version": "1.12.0",
+ "resolved": "https://registry.npmjs.org/@rc-component/picker/-/picker-1.12.0.tgz",
+ "integrity": "sha512-0FZGgDiDZFMm2hcfGv4jyjm7yWIj2MiwfeTzLL0vWkO+8cCSKdiM9XhWpkn1aAsoI2EwUy48Oz2cGfvL8ZKrfw==",
"license": "MIT",
"dependencies": {
"@rc-component/overflow": "^1.0.0",
@@ -4253,13 +4292,13 @@
}
},
"node_modules/@rc-component/util": {
- "version": "1.11.1",
- "resolved": "https://registry.npmmirror.com/@rc-component/util/-/util-1.11.1.tgz",
- "integrity": "sha512-awVlI3ub2vqfqkYxOBc/uQ0efm3jw0wcrhtO/YWLyZfxiKXczKwNbVuhlnyxytDt7H9pbbVQiqr+O6MLATtRYg==",
+ "version": "1.12.0",
+ "resolved": "https://registry.npmmirror.com/@rc-component/util/-/util-1.12.0.tgz",
+ "integrity": "sha512-AEjPL8JVdohIITaiXokyjL9WQ6tKWWjAYK9QU16tGNE9JaQABBQy+hA4H2Lup5MgXy9yY3iLrbZJheuU13hTdQ==",
"license": "MIT",
"dependencies": {
"is-mobile": "^5.0.0",
- "react-is": "^18.2.0"
+ "react-is": "^19.2.7"
},
"peerDependencies": {
"react": ">=18.0.0",
@@ -4267,12 +4306,12 @@
}
},
"node_modules/@rc-component/virtual-list": {
- "version": "1.2.0",
- "resolved": "https://registry.npmmirror.com/@rc-component/virtual-list/-/virtual-list-1.2.0.tgz",
- "integrity": "sha512-iavRm1Jo4GDbASQwdGa7jFyk93RvSOo9xHyBT4QL1pgFJj/Fdf1G+3RErH7/7BmAMvx2AkF62mjGYxDbXsK9TQ==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmmirror.com/@rc-component/virtual-list/-/virtual-list-1.4.0.tgz",
+ "integrity": "sha512-qoyNStkTJQDezPjBibGA5HNxS9NiKJvemD1bLp7qfyxDlwy7ofPLUP0ZqJ47hR8AKcFaizd0AP/7QWLTLpudKQ==",
"license": "MIT",
"dependencies": {
- "@babel/runtime": "^7.20.0",
+ "@babel/runtime": "^8.0.0",
"@rc-component/resize-observer": "^1.0.1",
"@rc-component/util": "^1.4.0",
"clsx": "^2.1.1"
@@ -4285,10 +4324,16 @@
"react-dom": ">=18.0.0"
}
},
+ "node_modules/@rc-component/virtual-list/node_modules/@babel/runtime": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-8.0.0.tgz",
+ "integrity": "sha512-sL6cvO2IfkSu/iU+zs2S/w01B7A8V7suXSIKEN4hPFFdZoiPGxrj5pAG0lCaqLWiEIrjKzdznIWuaLcxPR53qw==",
+ "license": "MIT"
+ },
"node_modules/@rolldown/binding-android-arm64": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.3.tgz",
- "integrity": "sha512-454rs7jHngixp/NMxd5srYD57OnzSlZ/eFTETjORQHLwJG1lRtmNOJcBerZlfu4GjKqeq8aCCIQrMdHyhI51Hw==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.3.tgz",
+ "integrity": "sha512-zrJtHDcaZJ1Fp7xf4hNl+7seH9Cn/N5TwLYkhgXREtBwAd/jaqW3uqeHxpDugJLVICWg4eW44kOQEGJ1r6jCGw==",
"cpu": [
"arm64"
],
@@ -4303,9 +4348,9 @@
}
},
"node_modules/@rolldown/binding-darwin-arm64": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.3.tgz",
- "integrity": "sha512-PcAhP+ynjURNyy8SKGl5DQP94aGuB/7JrXJb/t7P+hanXvQVMWzUvRRhBAcg/lNRadBhoUPqSoP4xw5tR/KBEA==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.3.tgz",
+ "integrity": "sha512-ieIiibVCp0tX7TLu2cafoNPv8wJyYi01ekXpbf8q2j7F4rGAhhXb/eQh7ge9DRBY78GwmRQtvjZDux7EDbA8kA==",
"cpu": [
"arm64"
],
@@ -4320,9 +4365,9 @@
}
},
"node_modules/@rolldown/binding-darwin-x64": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.3.tgz",
- "integrity": "sha512-9YpfeUvSE2RS7wysJ81uOZkXJz7f7Q55H2Gvp3VEw/EsahqDtrphrZ0EwDLK5vvKOzaCrBsjF8JmnMLcUt78Gg==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.3.tgz",
+ "integrity": "sha512-Zh9tCon19eDXJoihx0rqKhMUlMYqzwj3aPsSuHmI4RWZh62dWUL+DJN4C5YQya5TcQBJU/Fe8+rY0jhXTQITqA==",
"cpu": [
"x64"
],
@@ -4337,9 +4382,9 @@
}
},
"node_modules/@rolldown/binding-freebsd-x64": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.3.tgz",
- "integrity": "sha512-yB1IlAsSNHncV6SCTL27/MVGR5htvQsoGxIv5KMGXALp+Ll1wYsn+x98M9MW7qa+NdSbvrrY7ANI4wLJ0n1e6g==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.3.tgz",
+ "integrity": "sha512-nGbJWewA1wrXXZiQhjAT5rhibGfns5ZNkDVqxsO6zJ3f3YvpoDNNmGMSbbhLuXKjNScaBJVOAboztAWVespQMg==",
"cpu": [
"x64"
],
@@ -4354,9 +4399,9 @@
}
},
"node_modules/@rolldown/binding-linux-arm-gnueabihf": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.3.tgz",
- "integrity": "sha512-Yi30IVAAfLUCy2MseFjbB1jAMDl1VMCAas5StnYp8da9+CKvMd2H2cbEjWcw5NPaPqzvYkVIaF1nNUG+b7u/sw==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.3.tgz",
+ "integrity": "sha512-QNniJr5Kml0kDEB98jiDOJjXNroxIIi0IXIbdYzY26Xt1pVbeP62+KnoIZLwirOymX/0jDk/2gI/bNUv7A7OIw==",
"cpu": [
"arm"
],
@@ -4371,13 +4416,16 @@
}
},
"node_modules/@rolldown/binding-linux-arm64-gnu": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.3.tgz",
- "integrity": "sha512-jsO7R8To+AdlYgUmN5sHSCZbfhtMBkO0WUx8iORQnPcMMdgr7qM2DQmMwgabs3GhNztdmoKkMKQFHD6DTMCIQw==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.3.tgz",
+ "integrity": "sha512-TkqEAcmmvH3I/q4114NB4RVt6241Dao48pF45uLcFGrwAaIn0iITgTAKP/dLjbN0R4buJjGb91+UHSoFmpgIWw==",
"cpu": [
"arm64"
],
"dev": true,
+ "libc": [
+ "glibc"
+ ],
"license": "MIT",
"optional": true,
"os": [
@@ -4388,13 +4436,16 @@
}
},
"node_modules/@rolldown/binding-linux-arm64-musl": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.3.tgz",
- "integrity": "sha512-VWkUHwWriDciit80wleYwKILoR/KMvxh/IdwS/paX+ZgpuRpCrKLUdadJbc0NpBEiyhpYawsJ73j9aCvOH+f7Q==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.3.tgz",
+ "integrity": "sha512-NHqjnxpsndf4MPymxteFAWHHfkTL8HjWh1KB7z23ofZ6QO2euONuxDXjat69dKZRALnGypg8k8SsK8vZJoXv1Q==",
"cpu": [
"arm64"
],
"dev": true,
+ "libc": [
+ "musl"
+ ],
"license": "MIT",
"optional": true,
"os": [
@@ -4405,13 +4456,16 @@
}
},
"node_modules/@rolldown/binding-linux-ppc64-gnu": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.3.tgz",
- "integrity": "sha512-5f1laC0SlIR0yDbFCd8acUhvJIag6N3zC5P7oUPN6wX0aOma+uKJ0wBDH5aq7I1PVI2ttTlhJwzwRIBnLiSGEg==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.3.tgz",
+ "integrity": "sha512-6tbrbwfz5GB9DQ4Jwo6hy9v+vR31xZlvzZ6n5Xut6Hhx5PvrA9q/HsK8KMaYQp063iqZGXwNvZtYNLD7EM/x0w==",
"cpu": [
"ppc64"
],
"dev": true,
+ "libc": [
+ "glibc"
+ ],
"license": "MIT",
"optional": true,
"os": [
@@ -4422,13 +4476,16 @@
}
},
"node_modules/@rolldown/binding-linux-s390x-gnu": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.3.tgz",
- "integrity": "sha512-Iq4ko0r4XsgbrF/LunNgHtAGLRRVE2kXonAXQ/MV0mC6jQpMOhW1SvtZja2EhC/kd05++bP78dsqBeIQyYJ6Yg==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.3.tgz",
+ "integrity": "sha512-oyuXxXmoZHjXC917IAPFAAv4wWAa0cM9afk8nx1+9/jNNOX1uPf8yDA6p7G0RypOfw/X0PQt5IfoquY1um+zSg==",
"cpu": [
"s390x"
],
"dev": true,
+ "libc": [
+ "glibc"
+ ],
"license": "MIT",
"optional": true,
"os": [
@@ -4439,13 +4496,16 @@
}
},
"node_modules/@rolldown/binding-linux-x64-gnu": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.3.tgz",
- "integrity": "sha512-B8m6tD5+/N5FeNQFbKlLA/2yVq9ycQP1SeedyEYYKWBNR3ZQbkvIUcNnDNM03lO1l5F2roiiFJGgvoLLyZXtSg==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.3.tgz",
+ "integrity": "sha512-TytMwF2KVGqP2tgd0I1OY0PAv78dZRAYcF5ssDzjM34SUXCED3uXvSd5+lHoC0bTD6eEdFz7LdQNCO1y0oVk9w==",
"cpu": [
"x64"
],
"dev": true,
+ "libc": [
+ "glibc"
+ ],
"license": "MIT",
"optional": true,
"os": [
@@ -4456,13 +4516,16 @@
}
},
"node_modules/@rolldown/binding-linux-x64-musl": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.3.tgz",
- "integrity": "sha512-pSdpdUJHkuCxun9LE7jvgUB9qsRgaiyNNCX7m/AvHTcq67AiT/Yhoxvw5zPfhrM8k/BfP8ce/hMOpthKDpEUow==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.3.tgz",
+ "integrity": "sha512-/E9m3qstrJFVPoULV25mVQblSNExY2+kBsYe4sy0Tn0yOOgJ8wZbZt3KnRbF/XeU2Gl1STKUQnDNTqhIE5MD4A==",
"cpu": [
"x64"
],
"dev": true,
+ "libc": [
+ "musl"
+ ],
"license": "MIT",
"optional": true,
"os": [
@@ -4473,9 +4536,9 @@
}
},
"node_modules/@rolldown/binding-openharmony-arm64": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.3.tgz",
- "integrity": "sha512-OXXS3RKJgX2uLwM+gYyuH5omcH8fL1LJs96pZGgtetVCahON57+d4SJHzTgZiOjxgGkSnpXpOsWuPDGAKAigEg==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.3.tgz",
+ "integrity": "sha512-Kr0OcsoQI816i6HOl3vFHpd1K0eZyh76zgfj4c1nTyaTsd5r2Mj1lwM4R90y/qaCfmTn9eHy0SKwi98eitRxug==",
"cpu": [
"arm64"
],
@@ -4489,59 +4552,10 @@
"node": "^20.19.0 || >=22.12.0"
}
},
- "node_modules/@rolldown/binding-wasm32-wasi": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.3.tgz",
- "integrity": "sha512-JTtb8BWFynicNSoPrehsCzBtOKjZ6jhMiPFEmOiuXg1Fl8dn2KHQob+GuPSGR0dryQa1PQJbzjF3dqO/whhjLg==",
- "cpu": [
- "wasm32"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@emnapi/core": "1.10.0",
- "@emnapi/runtime": "1.10.0",
- "@napi-rs/wasm-runtime": "^1.1.4"
- },
- "engines": {
- "node": "^20.19.0 || >=22.12.0"
- }
- },
- "node_modules/@rolldown/binding-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": {
- "version": "1.1.4",
- "resolved": "https://registry.npmmirror.com/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz",
- "integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==",
- "dev": true,
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@tybys/wasm-util": "^0.10.1"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/Brooooooklyn"
- },
- "peerDependencies": {
- "@emnapi/core": "^1.7.1",
- "@emnapi/runtime": "^1.7.1"
- }
- },
- "node_modules/@rolldown/binding-wasm32-wasi/node_modules/@tybys/wasm-util": {
- "version": "0.10.2",
- "resolved": "https://registry.npmmirror.com/@tybys/wasm-util/-/wasm-util-0.10.2.tgz",
- "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==",
- "dev": true,
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "tslib": "^2.4.0"
- }
- },
"node_modules/@rolldown/binding-win32-arm64-msvc": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.3.tgz",
- "integrity": "sha512-gEdFFEN70A/jxb2svrWsN3aDL7OUtmvlOy+6fa2jxG8K0wQ1ZbdeLGnidov6Yu5/733dI5ySfzFlQ/cb0bSz1g==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.3.tgz",
+ "integrity": "sha512-hOtMwTqnME+/gJcH/PCZ0wn0zPUjiWOgkHpxbSJpfGKMezHltx1S7/k1SitzVa7Ww2cqrDDaFbZEhcJZO8o+Jw==",
"cpu": [
"arm64"
],
@@ -4556,9 +4570,9 @@
}
},
"node_modules/@rolldown/binding-win32-x64-msvc": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.3.tgz",
- "integrity": "sha512-eXB7CHuaQdqmJcc3koCNtNPmT/bj2gc999kUFgBxG8Ac0NdgXc4rkCHhqrgrhN3zddvvvrgzj1e90SuSfmyIXA==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.3.tgz",
+ "integrity": "sha512-ekcqMMkI2PlhYnfzQnB/cEdYUVVJViWvoUyLrbzgDoi3Snfc1mVBwdnc306ufA5ejy8JSPjT2RlW1nQSjW7efg==",
"cpu": [
"x64"
],
@@ -4589,12 +4603,13 @@
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/@standard-schema/spec/-/spec-1.1.0.tgz",
"integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/@tabler/icons": {
- "version": "3.45.0",
- "resolved": "https://registry.npmmirror.com/@tabler/icons/-/icons-3.45.0.tgz",
- "integrity": "sha512-jiATwV8+zGYLTZ7gMLGivCic+KtsMZXcDmufIG8umlLxoHhI6902hGYIEt0Oa9Y9SXblNzUlrisHm5jOFMxOQA==",
+ "version": "3.46.0",
+ "resolved": "https://registry.npmmirror.com/@tabler/icons/-/icons-3.46.0.tgz",
+ "integrity": "sha512-f2RYFl3fzPwj5WO82x6en0dmkjefxEfOm16D1ByM6cj/McNiwOkL4VaPUoP9VVIrXAD9WnTSVFr70px703b//A==",
"license": "MIT",
"funding": {
"type": "github",
@@ -4602,12 +4617,12 @@
}
},
"node_modules/@tabler/icons-react": {
- "version": "3.45.0",
- "resolved": "https://registry.npmmirror.com/@tabler/icons-react/-/icons-react-3.45.0.tgz",
- "integrity": "sha512-t/AuKs7ALMDDTY+B9IvfZnlO0mbLlP/lJxP/HnGC49QkM8mCsTN38kYyxjXxgrb1+TeK53ioVBJqIV7n/eysXQ==",
+ "version": "3.46.0",
+ "resolved": "https://registry.npmmirror.com/@tabler/icons-react/-/icons-react-3.46.0.tgz",
+ "integrity": "sha512-CCm7xJWhDT2PH4ZIFkP6AgYKtVhq0gpYkjUN+GVh1AzmIQaa77OW0bQPBPQiTE0PsXMR9oSxFqA3qBglzPyrVQ==",
"license": "MIT",
"dependencies": {
- "@tabler/icons": "3.45.0"
+ "@tabler/icons": "3.46.0"
},
"funding": {
"type": "github",
@@ -4750,6 +4765,9 @@
"arm64"
],
"dev": true,
+ "libc": [
+ "glibc"
+ ],
"license": "MIT",
"optional": true,
"os": [
@@ -4767,6 +4785,9 @@
"arm64"
],
"dev": true,
+ "libc": [
+ "musl"
+ ],
"license": "MIT",
"optional": true,
"os": [
@@ -4784,6 +4805,9 @@
"x64"
],
"dev": true,
+ "libc": [
+ "glibc"
+ ],
"license": "MIT",
"optional": true,
"os": [
@@ -4801,6 +4825,9 @@
"x64"
],
"dev": true,
+ "libc": [
+ "musl"
+ ],
"license": "MIT",
"optional": true,
"os": [
@@ -4908,6 +4935,7 @@
"resolved": "https://registry.npmmirror.com/@testing-library/dom/-/dom-10.4.1.tgz",
"integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==",
"dev": true,
+ "license": "MIT",
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.10.4",
@@ -4928,6 +4956,7 @@
"resolved": "https://registry.npmmirror.com/@testing-library/jest-dom/-/jest-dom-7.0.0.tgz",
"integrity": "sha512-HKAH9C6mBo5yBG6yRO5i43L2iisencAo5z+o5P/saHUoY+miC5ivXRxHBJcFyB5ypPNxHJdK3BoF/3O4DIptMg==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@adobe/css-tools": "^4.4.0",
"aria-query": "^5.0.0",
@@ -4949,13 +4978,15 @@
"version": "0.6.3",
"resolved": "https://registry.npmmirror.com/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz",
"integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/@testing-library/react": {
"version": "16.3.2",
"resolved": "https://registry.npmmirror.com/@testing-library/react/-/react-16.3.2.tgz",
"integrity": "sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@babel/runtime": "^7.12.5"
},
@@ -4999,6 +5030,7 @@
"resolved": "https://registry.npmmirror.com/@types/aria-query/-/aria-query-5.0.4.tgz",
"integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==",
"dev": true,
+ "license": "MIT",
"peer": true
},
"node_modules/@types/chai": {
@@ -5006,6 +5038,7 @@
"resolved": "https://registry.npmmirror.com/@types/chai/-/chai-5.2.3.tgz",
"integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@types/deep-eql": "*",
"assertion-error": "^2.0.1"
@@ -5015,7 +5048,8 @@
"version": "4.0.2",
"resolved": "https://registry.npmmirror.com/@types/deep-eql/-/deep-eql-4.0.2.tgz",
"integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/@types/estree": {
"version": "1.0.8",
@@ -5079,7 +5113,8 @@
"node_modules/@types/parse-json": {
"version": "4.0.2",
"resolved": "https://registry.npmmirror.com/@types/parse-json/-/parse-json-4.0.2.tgz",
- "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw=="
+ "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==",
+ "license": "MIT"
},
"node_modules/@types/prop-types": {
"version": "15.7.12",
@@ -5315,26 +5350,26 @@
}
},
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
- "version": "5.0.7",
- "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-5.0.7.tgz",
- "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
+ "version": "5.0.9",
+ "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-5.0.9.tgz",
+ "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
"dev": true,
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
- "node": "18 || 20 || >=22"
+ "node": "20 || >=22"
}
},
"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
- "version": "10.2.5",
- "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-10.2.5.tgz",
- "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==",
+ "version": "10.2.6",
+ "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-10.2.6.tgz",
+ "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
- "brace-expansion": "^5.0.5"
+ "brace-expansion": "^5.0.8"
},
"engines": {
"node": "18 || 20 || >=22"
@@ -5485,7 +5520,8 @@
"node_modules/@umijs/route-utils": {
"version": "4.0.3",
"resolved": "https://registry.npmmirror.com/@umijs/route-utils/-/route-utils-4.0.3.tgz",
- "integrity": "sha512-zPEcYhl1cSfkSRDzzGgoD1mDvGjxoOTJFvkn55srfgdQ3NZe2ZMCScCU6DEnOxuKP1XDVf8pqyqCDVd2+RCQIw=="
+ "integrity": "sha512-zPEcYhl1cSfkSRDzzGgoD1mDvGjxoOTJFvkn55srfgdQ3NZe2ZMCScCU6DEnOxuKP1XDVf8pqyqCDVd2+RCQIw==",
+ "license": "MIT"
},
"node_modules/@unrs/resolver-binding-android-arm-eabi": {
"version": "1.9.2",
@@ -5748,9 +5784,9 @@
}
},
"node_modules/@vitejs/plugin-legacy": {
- "version": "8.2.1",
- "resolved": "https://registry.npmmirror.com/@vitejs/plugin-legacy/-/plugin-legacy-8.2.1.tgz",
- "integrity": "sha512-2X1iCnV8uW5hT187sLr8eJobx9SYrkSWNALaxkx6DGtoOOJ9xRn261w9iNJ2iDW1pW4YtV3Tq2i0xyzwC2ZhWw==",
+ "version": "8.2.2",
+ "resolved": "https://registry.npmmirror.com/@vitejs/plugin-legacy/-/plugin-legacy-8.2.2.tgz",
+ "integrity": "sha512-4RpSqLedwx9Ffu2MH3iCadVBIu7Swfr5O6R9SDnzPmBzQ6gyfKgNuQZKlBDYl5dM8XDsR7srPqbjbBgHVUWV3g==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -5763,7 +5799,7 @@
"browserslist": "^4.28.6",
"browserslist-to-esbuild": "^2.1.1",
"core-js": "^3.49.0",
- "magic-string": "^0.30.21",
+ "magic-string": "^1.0.0",
"regenerator-runtime": "^0.14.1",
"systemjs": "^6.15.1"
},
@@ -5778,10 +5814,20 @@
"vite": "^8.0.0"
}
},
+ "node_modules/@vitejs/plugin-legacy/node_modules/magic-string": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-1.1.0.tgz",
+ "integrity": "sha512-kS3VHe0nEPST2saQV4Rbkchcd3UBRkVTQHo1D3h/ZTwFDhai/mfKkmtPAtD129EOI7K3HlHIsFOt0WrI2/oU9g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.5"
+ }
+ },
"node_modules/@vitejs/plugin-react": {
- "version": "6.0.3",
- "resolved": "https://registry.npmmirror.com/@vitejs/plugin-react/-/plugin-react-6.0.3.tgz",
- "integrity": "sha512-vmFvco5/QuC2f9Oj+wTk0+9XeDFkHxSamwZKYc7MxYwKICfvUvlMhqKI0VuICPltGqh1neqBKDvO4kes1ya8vg==",
+ "version": "6.0.5",
+ "resolved": "https://registry.npmmirror.com/@vitejs/plugin-react/-/plugin-react-6.0.5.tgz",
+ "integrity": "sha512-BOVzne/NL162sMdResB25mUv+vWMF5NoAjNf09TeGlE7ZpszZWSD3winycicLJw72yeVsoCn/2kOhEuCvEShMA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -5809,6 +5855,7 @@
"resolved": "https://registry.npmmirror.com/@vitest/expect/-/expect-4.1.10.tgz",
"integrity": "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@standard-schema/spec": "^1.1.0",
"@types/chai": "^5.2.2",
@@ -5826,6 +5873,7 @@
"resolved": "https://registry.npmmirror.com/@vitest/mocker/-/mocker-4.1.10.tgz",
"integrity": "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@vitest/spy": "4.1.10",
"estree-walker": "^3.0.3",
@@ -5852,6 +5900,7 @@
"resolved": "https://registry.npmmirror.com/@vitest/pretty-format/-/pretty-format-4.1.10.tgz",
"integrity": "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"tinyrainbow": "^3.1.0"
},
@@ -5864,6 +5913,7 @@
"resolved": "https://registry.npmmirror.com/@vitest/runner/-/runner-4.1.10.tgz",
"integrity": "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@vitest/utils": "4.1.10",
"pathe": "^2.0.3"
@@ -5877,6 +5927,7 @@
"resolved": "https://registry.npmmirror.com/@vitest/snapshot/-/snapshot-4.1.10.tgz",
"integrity": "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@vitest/pretty-format": "4.1.10",
"@vitest/utils": "4.1.10",
@@ -5892,6 +5943,7 @@
"resolved": "https://registry.npmmirror.com/@vitest/spy/-/spy-4.1.10.tgz",
"integrity": "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==",
"dev": true,
+ "license": "MIT",
"funding": {
"url": "https://opencollective.com/vitest"
}
@@ -5901,6 +5953,7 @@
"resolved": "https://registry.npmmirror.com/@vitest/utils/-/utils-4.1.10.tgz",
"integrity": "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@vitest/pretty-format": "4.1.10",
"convert-source-map": "^2.0.0",
@@ -5976,6 +6029,7 @@
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
+ "license": "MIT",
"peer": true,
"engines": {
"node": ">=8"
@@ -5997,9 +6051,9 @@
}
},
"node_modules/antd": {
- "version": "6.5.1",
- "resolved": "https://registry.npmmirror.com/antd/-/antd-6.5.1.tgz",
- "integrity": "sha512-VZVVF9zYI6S0NHqboVhCoY9Iiqj6dphW1NPB+sEaAf2HuIQ0haXWXj7ZvAXTRDzusktV6+cvvrSZEdRi4twATg==",
+ "version": "6.5.4",
+ "resolved": "https://registry.npmjs.org/antd/-/antd-6.5.4.tgz",
+ "integrity": "sha512-jchA6i0rEwHjLpgC+l6HeLHP0gL4Q4yjs6Mxqt6PlhGD5ArxCj3ZH+fKFbNquCtd6Rlzzi+emfNFpP2dGLwZzg==",
"license": "MIT",
"dependencies": {
"@ant-design/colors": "^8.0.1",
@@ -6016,7 +6070,7 @@
"@rc-component/dialog": "~1.10.0",
"@rc-component/drawer": "~1.4.2",
"@rc-component/dropdown": "~1.0.3",
- "@rc-component/form": "~1.8.5",
+ "@rc-component/form": "~1.8.6",
"@rc-component/image": "~1.9.0",
"@rc-component/input": "~1.3.1",
"@rc-component/input-number": "~1.6.2",
@@ -6026,7 +6080,7 @@
"@rc-component/mutate-observer": "^2.0.1",
"@rc-component/notification": "~2.0.7",
"@rc-component/pagination": "~1.4.0",
- "@rc-component/picker": "~1.11.0",
+ "@rc-component/picker": "~1.12.0",
"@rc-component/progress": "~1.0.2",
"@rc-component/qrcode": "~2.0.0",
"@rc-component/rate": "~1.0.1",
@@ -6042,9 +6096,9 @@
"@rc-component/tour": "~2.4.0",
"@rc-component/tree": "~1.3.2",
"@rc-component/tree-select": "~1.11.0",
- "@rc-component/trigger": "^3.10.0",
+ "@rc-component/trigger": "^3.10.1",
"@rc-component/upload": "~1.1.1",
- "@rc-component/util": "^1.11.1",
+ "@rc-component/util": "^1.12.0",
"clsx": "^2.1.1",
"dayjs": "^1.11.11",
"scroll-into-view-if-needed": "^3.1.0",
@@ -6084,6 +6138,7 @@
"resolved": "https://registry.npmmirror.com/aria-query/-/aria-query-5.3.0.tgz",
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
"dev": true,
+ "license": "Apache-2.0",
"dependencies": {
"dequal": "^2.0.3"
}
@@ -6223,6 +6278,7 @@
"resolved": "https://registry.npmmirror.com/assertion-error/-/assertion-error-2.0.1.tgz",
"integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=12"
}
@@ -6246,6 +6302,7 @@
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz",
"integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==",
+ "license": "MIT",
"dependencies": {
"@babel/runtime": "^7.12.5",
"cosmiconfig": "^7.0.0",
@@ -6316,9 +6373,9 @@
"license": "MIT"
},
"node_modules/baseline-browser-mapping": {
- "version": "2.10.44",
- "resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.44.tgz",
- "integrity": "sha512-T3ghW+sl/ZJ8w1v/yQx3qvJ9040DWoLBz8JT/CILbAKcFyG9b2MRe75v6W5uXjv6uH1lumK2Kv46y2zSkcej0Q==",
+ "version": "2.11.8",
+ "resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.11.8.tgz",
+ "integrity": "sha512-zAgkquC2WYF0PIc6XbNYkA2uuxxFavzgmX61R+dHDUa558V8Ejf8ozTZFR6QzM24RWu4kBcRkhJ5kpz77j9fnQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@@ -6333,14 +6390,15 @@
"resolved": "https://registry.npmmirror.com/bidi-js/-/bidi-js-1.0.3.tgz",
"integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"require-from-string": "^2.0.2"
}
},
"node_modules/bignumber.js": {
- "version": "11.1.4",
- "resolved": "https://registry.npmmirror.com/bignumber.js/-/bignumber.js-11.1.4.tgz",
- "integrity": "sha512-AJ9dSeaUGj2xu7tEwmdqb51dqdb633xo4njI9K8ZFfcLrNr0XN8/EPkkZUNaF9fkCblGt2zVwZymesUdGynEkQ==",
+ "version": "11.1.5",
+ "resolved": "https://registry.npmmirror.com/bignumber.js/-/bignumber.js-11.1.5.tgz",
+ "integrity": "sha512-6WmzCNtUnfKpbozq+hOgWaZMMzORmYBwF1xZScyoIX3QRYWeKTtxxwDOW5tIz7C9BdjkIYHGTcelCLkXg0mndw==",
"license": "MIT"
},
"node_modules/brace-expansion": {
@@ -6355,9 +6413,9 @@
}
},
"node_modules/browserslist": {
- "version": "4.28.6",
- "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.28.6.tgz",
- "integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==",
+ "version": "4.28.7",
+ "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.28.7.tgz",
+ "integrity": "sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==",
"dev": true,
"funding": [
{
@@ -6375,9 +6433,9 @@
],
"license": "MIT",
"dependencies": {
- "baseline-browser-mapping": "^2.10.42",
- "caniuse-lite": "^1.0.30001803",
- "electron-to-chromium": "^1.5.389",
+ "baseline-browser-mapping": "^2.10.44",
+ "caniuse-lite": "^1.0.30001806",
+ "electron-to-chromium": "^1.5.393",
"node-releases": "^2.0.51",
"update-browserslist-db": "^1.2.3"
},
@@ -6495,6 +6553,7 @@
"resolved": "https://registry.npmmirror.com/chai/-/chai-6.2.2.tgz",
"integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=18"
}
@@ -6620,6 +6679,7 @@
"version": "7.1.0",
"resolved": "https://registry.npmmirror.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
+ "license": "MIT",
"dependencies": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
@@ -6635,6 +6695,7 @@
"version": "1.10.3",
"resolved": "https://registry.npmmirror.com/yaml/-/yaml-1.10.3.tgz",
"integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==",
+ "license": "ISC",
"engines": {
"node": ">= 6"
}
@@ -6645,9 +6706,9 @@
"integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g=="
},
"node_modules/cron-parser": {
- "version": "5.6.2",
- "resolved": "https://registry.npmmirror.com/cron-parser/-/cron-parser-5.6.2.tgz",
- "integrity": "sha512-yJ/G1LVir6CnlkLI40CsampPLKl1SprGGlUagWtGJxewytRVYezv5xVyzzbT+Pvzx+VIRvZVF7/a0eEMTxdnTA==",
+ "version": "5.7.0",
+ "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-5.7.0.tgz",
+ "integrity": "sha512-iSpDHpwwW/GhIg4JVODYlWUEpMNSimaHvqOhHpOz1W+Y97z1lL1nf+dpcF17cNwFRpTtKN9devgi1fxflp3Phw==",
"license": "MIT",
"dependencies": {
"luxon": "^3.7.2"
@@ -6675,6 +6736,7 @@
"resolved": "https://registry.npmmirror.com/css-tree/-/css-tree-3.2.1.tgz",
"integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"mdn-data": "2.27.1",
"source-map-js": "^1.2.1"
@@ -6687,13 +6749,15 @@
"version": "2.27.1",
"resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.27.1.tgz",
"integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==",
- "dev": true
+ "dev": true,
+ "license": "CC0-1.0"
},
"node_modules/css.escape": {
"version": "1.5.1",
"resolved": "https://registry.npmmirror.com/css.escape/-/css.escape-1.5.1.tgz",
"integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/csstype": {
"version": "3.2.3",
@@ -6706,6 +6770,7 @@
"resolved": "https://registry.npmmirror.com/data-urls/-/data-urls-7.0.0.tgz",
"integrity": "sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"whatwg-mimetype": "^5.0.0",
"whatwg-url": "^16.0.0"
@@ -6792,7 +6857,8 @@
"version": "10.6.0",
"resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.6.0.tgz",
"integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/deep-is": {
"version": "0.1.4",
@@ -6838,6 +6904,7 @@
"version": "2.0.3",
"resolved": "https://registry.npmmirror.com/dequal/-/dequal-2.0.3.tgz",
"integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
+ "license": "MIT",
"engines": {
"node": ">=6"
}
@@ -6856,6 +6923,7 @@
"resolved": "https://registry.npmmirror.com/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz",
"integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==",
"dev": true,
+ "license": "MIT",
"peer": true
},
"node_modules/dunder-proto": {
@@ -6873,16 +6941,16 @@
}
},
"node_modules/electron-to-chromium": {
- "version": "1.5.394",
- "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.394.tgz",
- "integrity": "sha512-Wmt2Gm0o8JWBuGgmc4XZ0u9s1RaCRqhxP47phplmfg04+qypTUurpeJGP45A7Fhv7jdrrVH44PLlR9qXo37cVQ==",
+ "version": "1.5.398",
+ "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.398.tgz",
+ "integrity": "sha512-AsvhAxopJGh6museTDMIjn6JpDYOfgu4RLlygomt87MUwBUqTfd/1EiPtx10/LZE8xpTvkP2E9Gafq7lkLtodQ==",
"dev": true,
"license": "ISC"
},
"node_modules/enhanced-resolve": {
- "version": "5.24.3",
- "resolved": "https://registry.npmmirror.com/enhanced-resolve/-/enhanced-resolve-5.24.3.tgz",
- "integrity": "sha512-PwKooW9JUzh5chmYfHM3IQl5OkK2u2Nm011MgeZrss3JmFraUx/fqrf78kk8GUMYoibx/14MdwTl/1WKkG7TpQ==",
+ "version": "5.24.5",
+ "resolved": "https://registry.npmmirror.com/enhanced-resolve/-/enhanced-resolve-5.24.5.tgz",
+ "integrity": "sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -6898,6 +6966,7 @@
"resolved": "https://registry.npmmirror.com/entities/-/entities-8.0.0.tgz",
"integrity": "sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==",
"dev": true,
+ "license": "BSD-2-Clause",
"engines": {
"node": ">=20.19.0"
},
@@ -6909,6 +6978,7 @@
"version": "1.3.4",
"resolved": "https://registry.npmmirror.com/error-ex/-/error-ex-1.3.4.tgz",
"integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==",
+ "license": "MIT",
"dependencies": {
"is-arrayish": "^0.2.1"
}
@@ -7002,7 +7072,8 @@
"version": "2.3.1",
"resolved": "https://registry.npmmirror.com/es-module-lexer/-/es-module-lexer-2.3.1.tgz",
"integrity": "sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/es-object-atoms": {
"version": "1.1.1",
@@ -7074,6 +7145,7 @@
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
+ "license": "MIT",
"engines": {
"node": ">=10"
},
@@ -7527,6 +7599,7 @@
"resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-3.0.3.tgz",
"integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@types/estree": "^1.0.0"
}
@@ -7545,6 +7618,7 @@
"resolved": "https://registry.npmmirror.com/expect-type/-/expect-type-1.4.0.tgz",
"integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==",
"dev": true,
+ "license": "Apache-2.0",
"engines": {
"node": ">=12.0.0"
}
@@ -7602,7 +7676,8 @@
"node_modules/find-root": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/find-root/-/find-root-1.1.0.tgz",
- "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng=="
+ "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==",
+ "license": "MIT"
},
"node_modules/find-up": {
"version": "5.0.0",
@@ -7655,9 +7730,9 @@
}
},
"node_modules/fs-extra": {
- "version": "11.3.6",
- "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-11.3.6.tgz",
- "integrity": "sha512-w8ZNZr2mKIc7qeNaQ9AVPT1+iFaI+Avd4xudVOvdDJ8VytREi1Ft5Ih7hd9jjehod8vAM5GMsfQ/TpPf4EyoEA==",
+ "version": "11.4.0",
+ "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-11.4.0.tgz",
+ "integrity": "sha512-EQsFzMUJkCKGr1ePqlYADkIUmHW1s3ZXr5Yqy6wbGrfUCphpl2maM/kyOIRA2HpP3AaFQTZXD4ldjek+nccddA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -7961,6 +8036,7 @@
"resolved": "https://registry.npmmirror.com/html-encoding-sniffer/-/html-encoding-sniffer-6.0.0.tgz",
"integrity": "sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@exodus/bytes": "^1.6.0"
},
@@ -7969,11 +8045,12 @@
}
},
"node_modules/html-parse-stringify": {
- "version": "3.0.1",
- "resolved": "https://registry.npmmirror.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz",
- "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==",
- "dependencies": {
- "void-elements": "3.1.0"
+ "version": "4.0.1",
+ "resolved": "https://registry.npmmirror.com/html-parse-stringify/-/html-parse-stringify-4.0.1.tgz",
+ "integrity": "sha512-0zHsZJrK7S3K2aucXWL6ycoYJ/iNtIcFHC/nYQgFklPtrv5LpJctIiSCroWZWeuoXvuyFdzp6KzjJQ+OT5MfFw==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://locize.com"
}
},
"node_modules/i18n-js": {
@@ -8074,6 +8151,7 @@
"resolved": "https://registry.npmmirror.com/indent-string/-/indent-string-4.0.0.tgz",
"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=8"
}
@@ -8129,7 +8207,8 @@
"node_modules/is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmmirror.com/is-arrayish/-/is-arrayish-0.2.1.tgz",
- "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="
+ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
+ "license": "MIT"
},
"node_modules/is-async-function": {
"version": "2.0.0",
@@ -8346,7 +8425,8 @@
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
"integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/is-regex": {
"version": "1.2.1",
@@ -8541,6 +8621,7 @@
"resolved": "https://registry.npmmirror.com/jsdom/-/jsdom-29.1.1.tgz",
"integrity": "sha512-ECi4Fi2f7BdJtUKTflYRTiaMxIB0O6zfR1fX0GXpUrf6flp8QIYn1UT20YQqdSOfk2dfkCwS8LAFoJDEppNK5Q==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@asamuzakjp/css-color": "^5.1.11",
"@asamuzakjp/dom-selector": "^7.1.1",
@@ -8581,6 +8662,7 @@
"resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-11.5.2.tgz",
"integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==",
"dev": true,
+ "license": "BlueOak-1.0.0",
"engines": {
"node": "20 || >=22"
}
@@ -8589,7 +8671,6 @@
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-3.1.0.tgz",
"integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
- "license": "MIT",
"bin": {
"jsesc": "bin/jsesc"
},
@@ -8606,7 +8687,8 @@
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmmirror.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
- "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
+ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
+ "license": "MIT"
},
"node_modules/json-schema-traverse": {
"version": "0.4.1",
@@ -8940,7 +9022,8 @@
"node_modules/lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmmirror.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
- "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="
+ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
+ "license": "MIT"
},
"node_modules/locate-path": {
"version": "6.0.0",
@@ -8965,7 +9048,8 @@
"node_modules/lodash-es": {
"version": "4.18.1",
"resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.18.1.tgz",
- "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A=="
+ "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==",
+ "license": "MIT"
},
"node_modules/lodash.debounce": {
"version": "4.0.8",
@@ -9014,6 +9098,7 @@
"resolved": "https://registry.npmmirror.com/lz-string/-/lz-string-1.5.0.tgz",
"integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==",
"dev": true,
+ "license": "MIT",
"peer": true,
"bin": {
"lz-string": "bin/bin.js"
@@ -9045,9 +9130,9 @@
}
},
"node_modules/mdn-data": {
- "version": "2.28.1",
- "resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.28.1.tgz",
- "integrity": "sha512-U9w+PzSZ00Z5m9rZ5ARVFL5xOfuCHdKYi/1RRwDCJsboFgJDNT3zT6PIPD7mZQYaQLhsZM3GfDRgSMRHhSmVng==",
+ "version": "2.29.0",
+ "resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.29.0.tgz",
+ "integrity": "sha512-pVxQFCcaYUEAH853+v7yoI/qzhxXSq1bTb9obMYGYAN1c3Hen+XDCEvr296XhstrwlSTNgOR7mCSD4JPjbJe5A==",
"dev": true,
"license": "CC0-1.0"
},
@@ -9068,6 +9153,7 @@
"resolved": "https://registry.npmmirror.com/min-indent/-/min-indent-1.0.1.tgz",
"integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=4"
}
@@ -9256,6 +9342,7 @@
"https://github.com/sponsors/sxzz",
"https://opencollective.com/debug"
],
+ "license": "MIT",
"engines": {
"node": ">=12.20.0"
}
@@ -9340,6 +9427,7 @@
"version": "5.2.0",
"resolved": "https://registry.npmmirror.com/parse-json/-/parse-json-5.2.0.tgz",
"integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
+ "license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
@@ -9358,6 +9446,7 @@
"resolved": "https://registry.npmmirror.com/parse5/-/parse5-8.0.1.tgz",
"integrity": "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"entities": "^8.0.0"
},
@@ -9392,6 +9481,7 @@
"version": "8.4.2",
"resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
"integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
+ "license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
@@ -9401,6 +9491,7 @@
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
+ "license": "MIT",
"engines": {
"node": ">=8"
}
@@ -9409,7 +9500,8 @@
"version": "2.0.3",
"resolved": "https://registry.npmmirror.com/pathe/-/pathe-2.0.3.tgz",
"integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/picocolors": {
"version": "1.1.1",
@@ -9417,9 +9509,9 @@
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="
},
"node_modules/picomatch": {
- "version": "4.0.4",
- "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-4.0.4.tgz",
- "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz",
+ "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==",
"dev": true,
"license": "MIT",
"engines": {
@@ -9430,9 +9522,9 @@
}
},
"node_modules/pocketbase": {
- "version": "0.27.0",
- "resolved": "https://registry.npmmirror.com/pocketbase/-/pocketbase-0.27.0.tgz",
- "integrity": "sha512-K5N6d93UP/BNMbMnlZ6BUfy9VPCIvLyqhJFOsNI8OsZwzvKWEAfyD36boi5K4ECIOl5HMlo0TzuaeGdKpMwizQ==",
+ "version": "0.27.1",
+ "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.27.1.tgz",
+ "integrity": "sha512-5WXhgCZzkm34eLbsuKv5jlGace4NIu43jk8CHxXn2dlSflrLkso/M8eNwoq6J4INVeZ6fP3nIbO+wm9PI5kGnA==",
"license": "MIT"
},
"node_modules/possible-typed-array-names": {
@@ -9445,9 +9537,9 @@
}
},
"node_modules/postcss": {
- "version": "8.5.20",
- "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.20.tgz",
- "integrity": "sha512-lW616l85ucIQL+FocMmL7pQFPqBmwejrCMg+iPxyImlrANNJG9NHq/RkyCZopDhd8C3LA03PHRJDjkbGu8vvug==",
+ "version": "8.5.25",
+ "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.25.tgz",
+ "integrity": "sha512-DTPx3RWSSnWyzLxQnlH0rJP+EW5ekl16ZU4/psbIhA0e53kJfdgaN5vKM+xP7yJtXVu+nfdVFmlgFDEKAe4Pyw==",
"dev": true,
"funding": [
{
@@ -9535,6 +9627,7 @@
"resolved": "https://registry.npmmirror.com/pretty-format/-/pretty-format-27.5.1.tgz",
"integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
"dev": true,
+ "license": "MIT",
"peer": true,
"dependencies": {
"ansi-regex": "^5.0.1",
@@ -9550,6 +9643,7 @@
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-5.2.0.tgz",
"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
"dev": true,
+ "license": "MIT",
"peer": true,
"engines": {
"node": ">=10"
@@ -9563,6 +9657,7 @@
"resolved": "https://registry.npmmirror.com/react-is/-/react-is-17.0.2.tgz",
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
"dev": true,
+ "license": "MIT",
"peer": true
},
"node_modules/prop-types": {
@@ -9656,6 +9751,7 @@
"version": "4.4.6",
"resolved": "https://registry.npmmirror.com/react-draggable/-/react-draggable-4.4.6.tgz",
"integrity": "sha512-LtY5Xw1zTPqHkVmtM3X8MUOxNDOUhv/khTgBgrUvwaS064bwVvxT+q5El0uUFNx5IEPKXuRejr7UqLwBIg5pdw==",
+ "license": "MIT",
"dependencies": {
"clsx": "^1.1.1",
"prop-types": "^15.8.1"
@@ -9669,6 +9765,7 @@
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/clsx/-/clsx-1.2.1.tgz",
"integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==",
+ "license": "MIT",
"engines": {
"node": ">=6"
}
@@ -9679,13 +9776,13 @@
"integrity": "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ=="
},
"node_modules/react-i18next": {
- "version": "17.0.10",
- "resolved": "https://registry.npmmirror.com/react-i18next/-/react-i18next-17.0.10.tgz",
- "integrity": "sha512-XneHftyYA774MJkkccSkZ5oKrUpCnXIPmxio3wemqrVzCRLWiGXOMbIzObrer03fNDEnm8g8R5yYls4HcE+esg==",
+ "version": "17.0.11",
+ "resolved": "https://registry.npmmirror.com/react-i18next/-/react-i18next-17.0.11.tgz",
+ "integrity": "sha512-cDtkXgxjuFTWUH6V+aQn1Ve5vDiUztCNPWW5GtSHDccsgRXO1nE6QFWCEmc1KAutrb3OUv87wFShJL5RhUwPXg==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.29.2",
- "html-parse-stringify": "^3.0.1",
+ "html-parse-stringify": "^4.0.1",
"use-sync-external-store": "^1.6.0"
},
"peerDependencies": {
@@ -9706,15 +9803,15 @@
}
},
"node_modules/react-is": {
- "version": "18.3.1",
- "resolved": "https://registry.npmmirror.com/react-is/-/react-is-18.3.1.tgz",
- "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==",
+ "version": "19.2.8",
+ "resolved": "https://registry.npmmirror.com/react-is/-/react-is-19.2.8.tgz",
+ "integrity": "sha512-s5un28nYxKJw5gvUHyW5PCC28CvBqLu9r3cWgzHT4Vo/5fqqkFcdRYsGcKf50WMPpjjFZS5d76fn3YCo2njKwQ==",
"license": "MIT"
},
"node_modules/react-router": {
- "version": "7.18.1",
- "resolved": "https://registry.npmmirror.com/react-router/-/react-router-7.18.1.tgz",
- "integrity": "sha512-GDLgg3i3uM0aeJO3Fm+TCS+sDQ7gu12T6x0qdTEzcwqEfleci7JwugVNIF3U//0FWKnJT7ptG+20B2jfDqnZAg==",
+ "version": "7.18.2",
+ "resolved": "https://registry.npmmirror.com/react-router/-/react-router-7.18.2.tgz",
+ "integrity": "sha512-aUVMjFm3GAPTTZL7oYr5E7ETiqfQCHRLH+B+5afnICvf0r7kkK4eR6SMuwbSTJw/7t+12khT/Kahij49fqOCIg==",
"license": "MIT",
"dependencies": {
"cookie": "^1.0.1",
@@ -9734,12 +9831,12 @@
}
},
"node_modules/react-router-dom": {
- "version": "7.18.1",
- "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-7.18.1.tgz",
- "integrity": "sha512-KaZh+X/6UtEp28x51AUYZDMg9NGoz2ja3dNHa+ta/tk40vCzKhQ/RypCWBMLbmDr6//E24Vv5uPsrqXFozdkAg==",
+ "version": "7.18.2",
+ "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-7.18.2.tgz",
+ "integrity": "sha512-AIKJ/jgGlFb3EbfCXk5Gzshiwt+l3mqbCrNjmEWMMjqQxNJ3svBa6bgzFyCC2Sw3RA0VWF1kg3uQf2OFhxb8hw==",
"license": "MIT",
"dependencies": {
- "react-router": "7.18.1"
+ "react-router": "7.18.2"
},
"engines": {
"node": ">=20.0.0"
@@ -9754,6 +9851,7 @@
"resolved": "https://registry.npmmirror.com/redent/-/redent-3.0.0.tgz",
"integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"indent-string": "^4.0.0",
"strip-indent": "^3.0.0"
@@ -9879,6 +9977,7 @@
"resolved": "https://registry.npmmirror.com/require-from-string/-/require-from-string-2.0.2.tgz",
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=0.10.0"
}
@@ -9928,13 +10027,13 @@
}
},
"node_modules/rolldown": {
- "version": "1.0.3",
- "resolved": "https://registry.npmmirror.com/rolldown/-/rolldown-1.0.3.tgz",
- "integrity": "sha512-i00lAJ2ks1BYr7rjNjKC7BcqAS7nVfiT3QX1SI5aY+AFHblCmaUf9OE9dbdzDvW6dJxbi2ZCZiy9v3CcwOiX3g==",
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.3.tgz",
+ "integrity": "sha512-rn9wpmxplLf7NLNyCk9FyWh3FM43DbY8jOzCdEPzH7uflhTftRbCEpqi6Ly2osgoU8OwObtmavMbWLaWy4LX7A==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@oxc-project/types": "=0.133.0",
+ "@oxc-project/types": "=0.143.0",
"@rolldown/pluginutils": "^1.0.0"
},
"bin": {
@@ -9944,21 +10043,20 @@
"node": "^20.19.0 || >=22.12.0"
},
"optionalDependencies": {
- "@rolldown/binding-android-arm64": "1.0.3",
- "@rolldown/binding-darwin-arm64": "1.0.3",
- "@rolldown/binding-darwin-x64": "1.0.3",
- "@rolldown/binding-freebsd-x64": "1.0.3",
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.3",
- "@rolldown/binding-linux-arm64-gnu": "1.0.3",
- "@rolldown/binding-linux-arm64-musl": "1.0.3",
- "@rolldown/binding-linux-ppc64-gnu": "1.0.3",
- "@rolldown/binding-linux-s390x-gnu": "1.0.3",
- "@rolldown/binding-linux-x64-gnu": "1.0.3",
- "@rolldown/binding-linux-x64-musl": "1.0.3",
- "@rolldown/binding-openharmony-arm64": "1.0.3",
- "@rolldown/binding-wasm32-wasi": "1.0.3",
- "@rolldown/binding-win32-arm64-msvc": "1.0.3",
- "@rolldown/binding-win32-x64-msvc": "1.0.3"
+ "@rolldown/binding-android-arm64": "1.2.3",
+ "@rolldown/binding-darwin-arm64": "1.2.3",
+ "@rolldown/binding-darwin-x64": "1.2.3",
+ "@rolldown/binding-freebsd-x64": "1.2.3",
+ "@rolldown/binding-linux-arm-gnueabihf": "1.2.3",
+ "@rolldown/binding-linux-arm64-gnu": "1.2.3",
+ "@rolldown/binding-linux-arm64-musl": "1.2.3",
+ "@rolldown/binding-linux-ppc64-gnu": "1.2.3",
+ "@rolldown/binding-linux-s390x-gnu": "1.2.3",
+ "@rolldown/binding-linux-x64-gnu": "1.2.3",
+ "@rolldown/binding-linux-x64-musl": "1.2.3",
+ "@rolldown/binding-openharmony-arm64": "1.2.3",
+ "@rolldown/binding-win32-arm64-msvc": "1.2.3",
+ "@rolldown/binding-win32-x64-msvc": "1.2.3"
}
},
"node_modules/rxjs": {
@@ -10038,6 +10136,7 @@
"version": "2.5.0",
"resolved": "https://registry.npmmirror.com/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz",
"integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==",
+ "license": "MIT",
"engines": {
"node": ">=10"
}
@@ -10047,6 +10146,7 @@
"resolved": "https://registry.npmmirror.com/saxes/-/saxes-6.0.0.tgz",
"integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==",
"dev": true,
+ "license": "ISC",
"dependencies": {
"xmlchars": "^2.2.0"
},
@@ -10243,7 +10343,8 @@
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/siginfo/-/siginfo-2.0.0.tgz",
"integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
- "dev": true
+ "dev": true,
+ "license": "ISC"
},
"node_modules/source-map": {
"version": "0.6.1",
@@ -10289,13 +10390,15 @@
"version": "0.0.2",
"resolved": "https://registry.npmmirror.com/stackback/-/stackback-0.0.2.tgz",
"integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/std-env": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/std-env/-/std-env-4.2.0.tgz",
"integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/stop-iteration-iterator": {
"version": "1.1.0",
@@ -10386,6 +10489,7 @@
"resolved": "https://registry.npmmirror.com/strip-indent/-/strip-indent-3.0.0.tgz",
"integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"min-indent": "^1.0.0"
},
@@ -10444,6 +10548,7 @@
"version": "2.4.2",
"resolved": "https://registry.npmmirror.com/swr/-/swr-2.4.2.tgz",
"integrity": "sha512-ej644Y2bvkIajfR32KGeSSdBXQW+ScjGjkybZgSE7kFpk9eGnV44XY9FJylXi+W75pavSX1PVNB57W5EbhGIYw==",
+ "license": "MIT",
"dependencies": {
"dequal": "^2.0.3",
"use-sync-external-store": "^1.6.0"
@@ -10456,7 +10561,8 @@
"version": "3.2.4",
"resolved": "https://registry.npmmirror.com/symbol-tree/-/symbol-tree-3.2.4.tgz",
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/synckit": {
"version": "0.11.13",
@@ -10572,13 +10678,15 @@
"version": "2.9.0",
"resolved": "https://registry.npmmirror.com/tinybench/-/tinybench-2.9.0.tgz",
"integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/tinyexec": {
"version": "1.2.4",
"resolved": "https://registry.npmmirror.com/tinyexec/-/tinyexec-1.2.4.tgz",
"integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=18"
}
@@ -10622,6 +10730,7 @@
"resolved": "https://registry.npmmirror.com/tinyrainbow/-/tinyrainbow-3.1.1.tgz",
"integrity": "sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=14.0.0"
}
@@ -10631,6 +10740,7 @@
"resolved": "https://registry.npmmirror.com/tldts/-/tldts-7.4.10.tgz",
"integrity": "sha512-GgouD1B+sWwvkaEq8vXC15DjQitxbvs12oIXELpconwm+Tg3zfcEv4jgzq3vtKverDXsg3VI8aRgNL2Nra0Iog==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"tldts-core": "^7.4.10"
},
@@ -10642,7 +10752,8 @@
"version": "7.4.10",
"resolved": "https://registry.npmmirror.com/tldts-core/-/tldts-core-7.4.10.tgz",
"integrity": "sha512-KnQjp53ZekKgm/r3l+u8kJGGzYgrWdP8+Mql7a4vijh2WE0IrZWspQj/TpTxDho/YxO+AnOZnIjQcCD+q6iJsw==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/toggle-selection": {
"version": "1.0.6",
@@ -10654,6 +10765,7 @@
"resolved": "https://registry.npmmirror.com/tough-cookie/-/tough-cookie-6.0.2.tgz",
"integrity": "sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==",
"dev": true,
+ "license": "BSD-3-Clause",
"dependencies": {
"tldts": "^7.0.5"
},
@@ -10666,6 +10778,7 @@
"resolved": "https://registry.npmmirror.com/tr46/-/tr46-6.0.0.tgz",
"integrity": "sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"punycode": "^2.3.1"
},
@@ -10909,6 +11022,7 @@
"resolved": "https://registry.npmmirror.com/undici/-/undici-7.29.0.tgz",
"integrity": "sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=20.18.1"
}
@@ -11073,16 +11187,16 @@
}
},
"node_modules/vite": {
- "version": "8.0.16",
- "resolved": "https://registry.npmmirror.com/vite/-/vite-8.0.16.tgz",
- "integrity": "sha512-h9bXPmJichP5fLmVQo3PyaGSDE2n3aPuomeAlVRm0JLmt4rY6zmPKd59HYI4LNW8oTK7tlTsuC7l/m7awx9Jcw==",
+ "version": "8.2.1",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-8.2.1.tgz",
+ "integrity": "sha512-EU/eS7BH3XROHh2YnBefjM6DBKA6ZeMZEYQbj7NLWg5wHYlhB8B/Mayd5XsgWq+NFYccDOTemRpdETWR6Ka/lw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "lightningcss": "^1.32.0",
- "picomatch": "^4.0.4",
- "postcss": "^8.5.15",
- "rolldown": "1.0.3",
+ "lightningcss": "^1.33.0",
+ "picomatch": "^4.0.5",
+ "postcss": "^8.5.25",
+ "rolldown": "~1.2.1",
"tinyglobby": "^0.2.17"
},
"bin": {
@@ -11099,7 +11213,7 @@
},
"peerDependencies": {
"@types/node": "^20.19.0 || >=22.12.0",
- "@vitejs/devtools": "^0.1.18",
+ "@vitejs/devtools": "^0.4.0",
"esbuild": "^0.27.0 || ^0.28.0",
"jiti": ">=1.21.0",
"less": "^4.0.0",
@@ -11150,11 +11264,285 @@
}
}
},
+ "node_modules/vite/node_modules/lightningcss": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",
+ "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==",
+ "dev": true,
+ "license": "MPL-2.0",
+ "dependencies": {
+ "detect-libc": "^2.0.3"
+ },
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ },
+ "optionalDependencies": {
+ "lightningcss-android-arm64": "1.33.0",
+ "lightningcss-darwin-arm64": "1.33.0",
+ "lightningcss-darwin-x64": "1.33.0",
+ "lightningcss-freebsd-x64": "1.33.0",
+ "lightningcss-linux-arm-gnueabihf": "1.33.0",
+ "lightningcss-linux-arm64-gnu": "1.33.0",
+ "lightningcss-linux-arm64-musl": "1.33.0",
+ "lightningcss-linux-x64-gnu": "1.33.0",
+ "lightningcss-linux-x64-musl": "1.33.0",
+ "lightningcss-win32-arm64-msvc": "1.33.0",
+ "lightningcss-win32-x64-msvc": "1.33.0"
+ }
+ },
+ "node_modules/vite/node_modules/lightningcss-android-arm64": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz",
+ "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/vite/node_modules/lightningcss-darwin-arm64": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz",
+ "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/vite/node_modules/lightningcss-darwin-x64": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz",
+ "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/vite/node_modules/lightningcss-freebsd-x64": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz",
+ "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/vite/node_modules/lightningcss-linux-arm-gnueabihf": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz",
+ "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/vite/node_modules/lightningcss-linux-arm64-gnu": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz",
+ "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/vite/node_modules/lightningcss-linux-arm64-musl": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz",
+ "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/vite/node_modules/lightningcss-linux-x64-gnu": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz",
+ "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/vite/node_modules/lightningcss-linux-x64-musl": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz",
+ "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/vite/node_modules/lightningcss-win32-arm64-msvc": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz",
+ "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/vite/node_modules/lightningcss-win32-x64-msvc": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz",
+ "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
"node_modules/vitest": {
"version": "4.1.10",
"resolved": "https://registry.npmmirror.com/vitest/-/vitest-4.1.10.tgz",
"integrity": "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@vitest/expect": "4.1.10",
"@vitest/mocker": "4.1.10",
@@ -11239,14 +11627,6 @@
}
}
},
- "node_modules/void-elements": {
- "version": "3.1.0",
- "resolved": "https://registry.npmmirror.com/void-elements/-/void-elements-3.1.0.tgz",
- "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==",
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/w3c-keyname": {
"version": "2.2.8",
"resolved": "https://registry.npmmirror.com/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
@@ -11257,6 +11637,7 @@
"resolved": "https://registry.npmmirror.com/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz",
"integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"xml-name-validator": "^5.0.0"
},
@@ -11269,6 +11650,7 @@
"resolved": "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-8.0.1.tgz",
"integrity": "sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==",
"dev": true,
+ "license": "BSD-2-Clause",
"engines": {
"node": ">=20"
}
@@ -11278,6 +11660,7 @@
"resolved": "https://registry.npmmirror.com/whatwg-mimetype/-/whatwg-mimetype-5.0.0.tgz",
"integrity": "sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=20"
}
@@ -11287,6 +11670,7 @@
"resolved": "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-16.0.1.tgz",
"integrity": "sha512-1to4zXBxmXHV3IiSSEInrreIlu02vUOvrhxJJH5vcxYTBDAx51cqZiKdyTxlecdKNSjj8EcxGBxNf6Vg+945gw==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@exodus/bytes": "^1.11.0",
"tr46": "^6.0.0",
@@ -11407,6 +11791,7 @@
"resolved": "https://registry.npmmirror.com/why-is-node-running/-/why-is-node-running-2.3.0.tgz",
"integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"siginfo": "^2.0.0",
"stackback": "0.0.2"
@@ -11432,6 +11817,7 @@
"resolved": "https://registry.npmmirror.com/xml-name-validator/-/xml-name-validator-5.0.0.tgz",
"integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==",
"dev": true,
+ "license": "Apache-2.0",
"engines": {
"node": ">=18"
}
@@ -11440,7 +11826,8 @@
"version": "2.2.0",
"resolved": "https://registry.npmmirror.com/xmlchars/-/xmlchars-2.2.0.tgz",
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/yallist": {
"version": "3.1.1",
diff --git a/ui/package.json b/ui/package.json
index 4d57eb78f..1839b4dfa 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -41,29 +41,29 @@
"@peculiar/asn1-rsa": "^2.8.0",
"@peculiar/asn1-schema": "^2.8.0",
"@peculiar/x509": "^2.0.0",
- "@tabler/icons-react": "^3.45.0",
+ "@tabler/icons-react": "^3.46.0",
"@uiw/codemirror-extensions-basic-setup": "^4.25.11",
"@uiw/codemirror-theme-vscode": "^4.25.11",
"@uiw/react-codemirror": "^4.25.11",
"ahooks": "^3.9.7",
- "antd": "^6.5.1",
+ "antd": "^6.5.3",
"antd-zod": "^8.0.0",
"clsx": "^2.1.1",
- "cron-parser": "^5.6.2",
+ "cron-parser": "^5.7.0",
"dayjs": "^1.11.21",
"file-saver": "^2.0.5",
"i18next": "^26.3.6",
"i18next-browser-languagedetector": "^8.2.1",
"immer": "^11.1.15",
"nanoid": "^6.0.0",
- "pocketbase": "^0.27.0",
+ "pocketbase": "^0.27.1",
"radash": "^12.1.1",
"react": "^18.3.1",
"react-copy-to-clipboard": "^5.1.1",
"react-dom": "^18.3.1",
- "react-i18next": "^17.0.10",
+ "react-i18next": "^17.0.11",
"react-router": "^7.18.0",
- "react-router-dom": "^7.18.1",
+ "react-router-dom": "^7.18.2",
"reflect-metadata": "^0.2.2",
"tailwind-merge": "^3.6.0",
"yaml": "^2.9.0",
@@ -82,8 +82,8 @@
"@types/react": "^18.3.31",
"@types/react-copy-to-clipboard": "^5.0.7",
"@types/react-dom": "^18.3.7",
- "@vitejs/plugin-legacy": "^8.2.1",
- "@vitejs/plugin-react": "^6.0.3",
+ "@vitejs/plugin-legacy": "^8.2.2",
+ "@vitejs/plugin-react": "^6.0.5",
"eslint": "^9.39.5",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.5",
@@ -92,13 +92,13 @@
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.3",
- "fs-extra": "^11.3.6",
+ "fs-extra": "^11.4.0",
"jsdom": "^29.1.1",
"prettier": "^3.9.6",
"tailwindcss": "^4.3.3",
"typescript": "^6.0.3",
- "typescript-eslint": "^8.64.0",
- "vite": "^8.0.16",
+ "typescript-eslint": "^8.65.0",
+ "vite": "^8.2.0",
"vitest": "^4.1.10"
}
}
diff --git a/ui/public/imgs/providers/axisnow.png b/ui/public/imgs/providers/axisnow.png
new file mode 100644
index 000000000..bea9f00b1
Binary files /dev/null and b/ui/public/imgs/providers/axisnow.png differ
diff --git a/ui/public/imgs/providers/huawei.svg b/ui/public/imgs/providers/huawei.svg
new file mode 100644
index 000000000..acd9f3182
--- /dev/null
+++ b/ui/public/imgs/providers/huawei.svg
@@ -0,0 +1 @@
+
diff --git a/ui/public/imgs/providers/proxmoxbs.svg b/ui/public/imgs/providers/proxmoxbs.svg
new file mode 100644
index 000000000..f99099155
--- /dev/null
+++ b/ui/public/imgs/providers/proxmoxbs.svg
@@ -0,0 +1 @@
+
diff --git a/ui/src/api/acmeAccounts.ts b/ui/src/api/acmeAccounts.ts
new file mode 100644
index 000000000..f4e5a1609
--- /dev/null
+++ b/ui/src/api/acmeAccounts.ts
@@ -0,0 +1,59 @@
+import { type ACMEAccountImportPayload, type ACMEAccountView } from "@/domain/acmeAccount";
+
+import { get as httpGet, post as httpPost } from "./_api";
+
+export type ListACMEAccountsParams = {
+ page?: number;
+ perPage?: number;
+ ca?: string;
+};
+
+export const list = (params?: ListACMEAccountsParams) => {
+ type RespData = {
+ items: ACMEAccountView[];
+ totalItems: number;
+ page: number;
+ perPage: number;
+ };
+
+ const qs = new URLSearchParams();
+ if (params?.page != null) qs.set("page", String(params.page));
+ if (params?.perPage != null) qs.set("perPage", String(params.perPage));
+ if (params?.ca) qs.set("ca", params.ca);
+ const query = qs.toString();
+
+ return httpGet({
+ url: query ? `/api/acme-accounts?${query}` : "/api/acme-accounts",
+ });
+};
+
+export const importAccount = (payload: ACMEAccountImportPayload) => {
+ type RespData = {
+ item: ACMEAccountView;
+ };
+
+ return httpPost({
+ url: "/api/acme-accounts/import",
+ body: payload,
+ });
+};
+
+export const exportAccount = (accountId: string) => {
+ type RespData = {
+ privateKeyPem: string;
+ };
+
+ return httpPost({
+ url: `/api/acme-accounts/${encodeURIComponent(accountId)}/export`,
+ });
+};
+
+export const rotateAccount = (accountId: string) => {
+ type RespData = {
+ item: ACMEAccountView;
+ };
+
+ return httpPost({
+ url: `/api/acme-accounts/${encodeURIComponent(accountId)}/rotate`,
+ });
+};
diff --git a/ui/src/components/Empty.tsx b/ui/src/components/Empty.tsx
index 08b087be2..778f7d961 100644
--- a/ui/src/components/Empty.tsx
+++ b/ui/src/components/Empty.tsx
@@ -26,7 +26,7 @@ const Empty = (props: EmptyProps) => {
return (
-
+
diff --git a/ui/src/components/access/forms/AccessConfigFieldsProvider.tsx b/ui/src/components/access/forms/AccessConfigFieldsProvider.tsx
index 0d67e9a87..3d3c45b12 100644
--- a/ui/src/components/access/forms/AccessConfigFieldsProvider.tsx
+++ b/ui/src/components/access/forms/AccessConfigFieldsProvider.tsx
@@ -15,6 +15,7 @@ import AccessConfigFieldsProviderAkamai from "./AccessConfigFieldsProviderAkamai
import AccessConfigFieldsProviderAPISIX from "./AccessConfigFieldsProviderAPISIX";
import AccessConfigFieldsProviderArvanCloud from "./AccessConfigFieldsProviderArvanCloud";
import AccessConfigFieldsProviderAWS from "./AccessConfigFieldsProviderAWS";
+import AccessConfigFieldsProviderAxisNow from "./AccessConfigFieldsProviderAxisNow";
import AccessConfigFieldsProviderAzure from "./AccessConfigFieldsProviderAzure";
import AccessConfigFieldsProviderBaiduCloud from "./AccessConfigFieldsProviderBaiduCloud";
import AccessConfigFieldsProviderBaishan from "./AccessConfigFieldsProviderBaishan";
@@ -63,6 +64,7 @@ import AccessConfigFieldsProviderHetzner from "./AccessConfigFieldsProviderHetzn
import AccessConfigFieldsProviderHostingde from "./AccessConfigFieldsProviderHostingde";
import AccessConfigFieldsProviderHostinger from "./AccessConfigFieldsProviderHostinger";
import AccessConfigFieldsProviderHuaweiCloud from "./AccessConfigFieldsProviderHuaweiCloud";
+import AccessConfigFieldsProviderHuaweiIBMC from "./AccessConfigFieldsProviderHuaweiIBMC";
import AccessConfigFieldsProviderInfomaniak from "./AccessConfigFieldsProviderInfomaniak";
import AccessConfigFieldsProviderIONOS from "./AccessConfigFieldsProviderIONOS";
import AccessConfigFieldsProviderJDCloud from "./AccessConfigFieldsProviderJDCloud";
@@ -86,6 +88,7 @@ import AccessConfigFieldsProviderOracleCloud from "./AccessConfigFieldsProviderO
import AccessConfigFieldsProviderOVHcloud from "./AccessConfigFieldsProviderOVHcloud";
import AccessConfigFieldsProviderPorkbun from "./AccessConfigFieldsProviderPorkbun";
import AccessConfigFieldsProviderPowerDNS from "./AccessConfigFieldsProviderPowerDNS";
+import AccessConfigFieldsProviderProxmoxBS from "./AccessConfigFieldsProviderProxmoxBS";
import AccessConfigFieldsProviderProxmoxVE from "./AccessConfigFieldsProviderProxmoxVE";
import AccessConfigFieldsProviderQingCloud from "./AccessConfigFieldsProviderQingCloud";
import AccessConfigFieldsProviderRainYun from "./AccessConfigFieldsProviderRainYun";
@@ -138,6 +141,7 @@ const providerComponentMap: Partial {
+ const { i18n, t } = useTranslation();
+
+ const { parentNamePath } = useFormNestedFieldsContext();
+ const formSchema = z.object({
+ [parentNamePath]: getSchema({ i18n }),
+ });
+ const formRule = createSchemaFieldRule(formSchema);
+ const initialValues = getInitialValues();
+
+ return (
+ <>
+ }
+ >
+
+
+ >
+ );
+};
+
+const getInitialValues = (): Nullish>> => {
+ return {
+ apiToken: "",
+ };
+};
+
+const getSchema = ({ i18n = getI18n() }: { i18n: ReturnType }) => {
+ const { t: _ } = i18n;
+
+ return z.object({
+ apiToken: z.string().nonempty(),
+ });
+};
+
+const _default = Object.assign(AccessConfigFormFieldsProviderAxisNow, {
+ getInitialValues,
+ getSchema,
+});
+
+export default _default;
diff --git a/ui/src/components/access/forms/AccessConfigFieldsProviderHuaweiIBMC.tsx b/ui/src/components/access/forms/AccessConfigFieldsProviderHuaweiIBMC.tsx
new file mode 100644
index 000000000..a33e28076
--- /dev/null
+++ b/ui/src/components/access/forms/AccessConfigFieldsProviderHuaweiIBMC.tsx
@@ -0,0 +1,73 @@
+import { getI18n, useTranslation } from "react-i18next";
+import { Form, Input, Switch } from "antd";
+import { createSchemaFieldRule } from "antd-zod";
+import { z } from "zod";
+
+import { isHostname, isUrlWithHttpOrHttps } from "@/utils/validator";
+
+import { useFormNestedFieldsContext } from "./_context";
+
+const AccessConfigFieldsProviderHuaweiIBMC = () => {
+ const { i18n, t } = useTranslation();
+ const { parentNamePath } = useFormNestedFieldsContext();
+ const formSchema = z.object({ [parentNamePath]: getSchema({ i18n }) });
+ const formRule = createSchemaFieldRule(formSchema);
+ const initialValues = getInitialValues();
+
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+
+const getInitialValues = (): Nullish>> => {
+ return {
+ host: "",
+ username: "",
+ password: "",
+ allowInsecureConnections: true,
+ };
+};
+
+const getSchema = ({ i18n = getI18n() }: { i18n: ReturnType }) => {
+ const { t } = i18n;
+
+ return z.object({
+ host: z.string().refine((v) => isHostname(v) || isUrlWithHttpOrHttps(v), t("common.errmsg.host_invalid")),
+ username: z.string().nonempty(),
+ password: z.string().nonempty(),
+ allowInsecureConnections: z.boolean().nullish(),
+ });
+};
+
+export default Object.assign(AccessConfigFieldsProviderHuaweiIBMC, { getInitialValues, getSchema });
diff --git a/ui/src/components/access/forms/AccessConfigFieldsProviderProxmoxBS.tsx b/ui/src/components/access/forms/AccessConfigFieldsProviderProxmoxBS.tsx
new file mode 100644
index 000000000..cefe184a9
--- /dev/null
+++ b/ui/src/components/access/forms/AccessConfigFieldsProviderProxmoxBS.tsx
@@ -0,0 +1,85 @@
+import { getI18n, useTranslation } from "react-i18next";
+import { Form, Input, Switch } from "antd";
+import { createSchemaFieldRule } from "antd-zod";
+import { z } from "zod";
+
+import { useFormNestedFieldsContext } from "./_context";
+
+const AccessConfigFormFieldsProviderProxmoxBS = () => {
+ const { i18n, t } = useTranslation();
+
+ const { parentNamePath } = useFormNestedFieldsContext();
+ const formSchema = z.object({
+ [parentNamePath]: getSchema({ i18n }),
+ });
+ const formRule = createSchemaFieldRule(formSchema);
+ const initialValues = getInitialValues();
+
+ return (
+ <>
+
+
+
+
+ }
+ >
+
+
+
+ }
+ >
+
+
+
+
+
+
+ >
+ );
+};
+
+const getInitialValues = (): Nullish>> => {
+ return {
+ serverUrl: "http://:8007/",
+ apiToken: "",
+ apiTokenSecret: "",
+ };
+};
+
+const getSchema = ({ i18n = getI18n() }: { i18n: ReturnType }) => {
+ const { t: _ } = i18n;
+
+ return z.object({
+ serverUrl: z.url({ protocol: z.core.regexes.httpProtocol }),
+ apiToken: z.string().nonempty(),
+ apiTokenSecret: z.string().nonempty(),
+ allowInsecureConnections: z.boolean().nullish(),
+ });
+};
+
+const _default = Object.assign(AccessConfigFormFieldsProviderProxmoxBS, {
+ getInitialValues,
+ getSchema,
+});
+
+export default _default;
diff --git a/ui/src/components/access/forms/AccessConfigFieldsProviderProxmoxVE.tsx b/ui/src/components/access/forms/AccessConfigFieldsProviderProxmoxVE.tsx
index fe051c678..91881e414 100644
--- a/ui/src/components/access/forms/AccessConfigFieldsProviderProxmoxVE.tsx
+++ b/ui/src/components/access/forms/AccessConfigFieldsProviderProxmoxVE.tsx
@@ -43,7 +43,7 @@ const AccessConfigFormFieldsProviderProxmoxVE = () => {
rules={[formRule]}
tooltip={}
>
-
+
>> => {
return {
serverUrl: "http://:8006/",
apiToken: "",
+ apiTokenSecret: "",
};
};
@@ -71,7 +72,7 @@ const getSchema = ({ i18n = getI18n() }: { i18n: ReturnType }) =
return z.object({
serverUrl: z.url({ protocol: z.core.regexes.httpProtocol }),
apiToken: z.string().nonempty(),
- apiTokenSecret: z.string().nullish(),
+ apiTokenSecret: z.string().nonempty(),
allowInsecureConnections: z.boolean().nullish(),
});
};
diff --git a/ui/src/components/workflow/WorkflowRunDetail.tsx b/ui/src/components/workflow/WorkflowRunDetail.tsx
index 979a03772..4591403a3 100644
--- a/ui/src/components/workflow/WorkflowRunDetail.tsx
+++ b/ui/src/components/workflow/WorkflowRunDetail.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { EditorState, FlowLayoutDefault } from "@flowgram.ai/fixed-layout-editor";
import { IconBrowserShare, IconBug, IconCheck, IconDots, IconDownload, IconSettings2, IconTransferOut } from "@tabler/icons-react";
import { useRequest } from "ahooks";
-import { Alert, App, Button, Card, Divider, Dropdown, Empty, Skeleton, Table, type TableProps, Tooltip, Typography, theme } from "antd";
+import { Alert, App, Button, Card, Divider, Dropdown, Empty, Skeleton, Table, type TableProps, Tag, Tooltip, Typography, theme } from "antd";
import dayjs from "dayjs";
import { ClientResponseError } from "pocketbase";
@@ -24,6 +24,9 @@ import WorkflowToolbar from "./designer/Toolbar";
import WorkflowGraphExportModal from "./WorkflowGraphExportModal";
import WorkflowStatus from "./WorkflowStatus";
+const RENEWAL_TRIGGER_ARI_PATTERN = "ARI suggestedWindow";
+const RENEWAL_TRIGGER_THRESHOLD_PATTERN = "SkipBeforeExpiryDays threshold";
+
export interface WorkflowRunDetailProps {
className?: string;
style?: React.CSSProperties;
@@ -237,15 +240,45 @@ const WorkflowRunLogs = ({ runData }: { runData: WorkflowRunModel }) => {
const [showTimestamp, setShowTimestamp] = useState(true);
const [showWhitespace, setShowWhitespace] = useState(true);
+ const renderRenewalTriggerTags = (message: string) => {
+ const tags = [];
+ if (message.includes(RENEWAL_TRIGGER_ARI_PATTERN)) {
+ tags.push(
+
+ {t("workflow_run.logs.renewal_trigger.ari")}
+
+ );
+ }
+
+ if (message.includes(RENEWAL_TRIGGER_THRESHOLD_PATTERN)) {
+ tags.push(
+
+ {t("workflow_run.logs.renewal_trigger.threshold")}
+
+ );
+ }
+
+ return tags.length > 0 ? tags : null;
+ };
+
const renderLogRecord = (record: Log) => {
let timestamp = dayjs(record.timestamp).format("YYYY-MM-DD HH:mm:ss");
timestamp = `[${timestamp}]`;
- let message = <>{record.message}>;
+ const renewalTriggerTags = renderRenewalTriggerTags(record.message);
+ let message = (
+ <>
+ {record.message}
+ {renewalTriggerTags}
+ >
+ );
if (record.data != null && Object.keys(record.data).length > 0) {
message = (
- {record.message}
+
+ {record.message}
+ {renewalTriggerTags}
+
{Object.entries(record.data).map(([key, value]) => (
{key}:
diff --git a/ui/src/components/workflow/designer/forms/BizApplyNodeConfigForm.tsx b/ui/src/components/workflow/designer/forms/BizApplyNodeConfigForm.tsx
index a7b23177a..2d3ffb384 100644
--- a/ui/src/components/workflow/designer/forms/BizApplyNodeConfigForm.tsx
+++ b/ui/src/components/workflow/designer/forms/BizApplyNodeConfigForm.tsx
@@ -5,6 +5,7 @@ import { type FlowNodeEntity } from "@flowgram.ai/fixed-layout-editor";
import { IconArrowRight, IconChevronRight, IconCircleMinus, IconMapPin, IconPlus, IconWorldWww } from "@tabler/icons-react";
import { useControllableValue, useMount } from "ahooks";
import {
+ Alert,
type AnchorProps,
AutoComplete,
Avatar,
@@ -103,6 +104,7 @@ const BizApplyNodeConfigForm = ({ node, ...props }: BizApplyNodeConfigFormProps)
const fieldKeySource = Form.useWatch("keySource", { form: formInst, preserve: true });
const fieldCAProvider = Form.useWatch("caProvider", { form: formInst, preserve: true });
const fieldCAProviderAccessId = Form.useWatch("caProviderAccessId", { form: formInst, preserve: true });
+ const fieldDisableARI = Form.useWatch("disableARI", { form: formInst, preserve: true });
const renderNestedFieldProviderComponent = BizApplyNodeConfigFieldsProvider.useComponent(fieldChallengeType, fieldProvider, {});
@@ -769,7 +771,17 @@ const BizApplyNodeConfigForm = ({ node, ...props }: BizApplyNodeConfigFormProps)
-
+
+ {t("workflow_node.apply.form.skip_before_expiry_days.help")}
+ {!fieldDisableARI && (
+
+ )}
+ >
+ }
+ >
{t("workflow_node.apply.form.skip_before_expiry_days.prefix")}
diff --git a/ui/src/components/workflow/designer/forms/BizDeployNodeConfigFieldsProvider.tsx b/ui/src/components/workflow/designer/forms/BizDeployNodeConfigFieldsProvider.tsx
index 1eef6dfa3..8001027f3 100644
--- a/ui/src/components/workflow/designer/forms/BizDeployNodeConfigFieldsProvider.tsx
+++ b/ui/src/components/workflow/designer/forms/BizDeployNodeConfigFieldsProvider.tsx
@@ -73,6 +73,7 @@ import BizDeployNodeConfigFieldsProviderHuaweiCloudLive from "./BizDeployNodeCon
import BizDeployNodeConfigFieldsProviderHuaweiCloudOBS from "./BizDeployNodeConfigFieldsProviderHuaweiCloudOBS";
import BizDeployNodeConfigFieldsProviderHuaweiCloudVOD from "./BizDeployNodeConfigFieldsProviderHuaweiCloudVOD";
import BizDeployNodeConfigFieldsProviderHuaweiCloudWAF from "./BizDeployNodeConfigFieldsProviderHuaweiCloudWAF";
+import BizDeployNodeConfigFieldsProviderHuaweiIBMC from "./BizDeployNodeConfigFieldsProviderHuaweiIBMC";
import BizDeployNodeConfigFieldsProviderJDCloudALB from "./BizDeployNodeConfigFieldsProviderJDCloudALB";
import BizDeployNodeConfigFieldsProviderJDCloudCDN from "./BizDeployNodeConfigFieldsProviderJDCloudCDN";
import BizDeployNodeConfigFieldsProviderJDCloudLive from "./BizDeployNodeConfigFieldsProviderJDCloudLive";
@@ -88,6 +89,7 @@ import BizDeployNodeConfigFieldsProviderMohuaMVH from "./BizDeployNodeConfigFiel
import BizDeployNodeConfigFieldsProviderNetlify from "./BizDeployNodeConfigFieldsProviderNetlify";
import BizDeployNodeConfigFieldsProviderNginxProxyManager from "./BizDeployNodeConfigFieldsProviderNginxProxyManager";
import BizDeployNodeConfigFieldsProviderOracleCloudCertificatesMgmt from "./BizDeployNodeConfigFieldsProviderOracleCloudCertificatesMgmt";
+import BizDeployNodeConfigFieldsProviderProxmoxBS from "./BizDeployNodeConfigFieldsProviderProxmoxBS";
import BizDeployNodeConfigFieldsProviderProxmoxVE from "./BizDeployNodeConfigFieldsProviderProxmoxVE";
import BizDeployNodeConfigFieldsProviderQingCloudLB from "./BizDeployNodeConfigFieldsProviderQingCloudLB";
import BizDeployNodeConfigFieldsProviderRainYunRCDN from "./BizDeployNodeConfigFieldsProviderRainYunRCDN";
@@ -219,6 +221,7 @@ const providerComponentMap: Partial {
+ const { i18n, t } = useTranslation();
+ const { parentNamePath } = useFormNestedFieldsContext();
+ const formSchema = z.object({ [parentNamePath]: getSchema({ i18n }) });
+ const formRule = createSchemaFieldRule(formSchema);
+ const initialValues = getInitialValues();
+
+ return (
+
+
+
+ );
+};
+
+const getInitialValues = (): Nullish>> => {
+ return {
+ autoRestart: true,
+ };
+};
+
+const getSchema = ({ i18n = getI18n() }: { i18n?: ReturnType }) => {
+ const { t: _ } = i18n;
+
+ return z.object({
+ autoRestart: z.boolean().nullish(),
+ });
+};
+
+export default Object.assign(BizDeployNodeConfigFieldsProviderHuaweiIBMC, { getInitialValues, getSchema });
diff --git a/ui/src/components/workflow/designer/forms/BizDeployNodeConfigFieldsProviderProxmoxBS.tsx b/ui/src/components/workflow/designer/forms/BizDeployNodeConfigFieldsProviderProxmoxBS.tsx
new file mode 100644
index 000000000..6910c187f
--- /dev/null
+++ b/ui/src/components/workflow/designer/forms/BizDeployNodeConfigFieldsProviderProxmoxBS.tsx
@@ -0,0 +1,68 @@
+import { getI18n, useTranslation } from "react-i18next";
+import { Form, Input, Switch } from "antd";
+import { createSchemaFieldRule } from "antd-zod";
+import { z } from "zod";
+
+import Tips from "@/components/Tips";
+
+import { useFormNestedFieldsContext } from "./_context";
+
+const BizDeployNodeConfigFieldsProviderProxmoxBS = () => {
+ const { i18n, t } = useTranslation();
+
+ const { parentNamePath } = useFormNestedFieldsContext();
+ const formSchema = z.object({
+ [parentNamePath]: getSchema({ i18n }),
+ });
+ const formRule = createSchemaFieldRule(formSchema);
+ const initialValues = getInitialValues();
+
+ return (
+ <>
+
+ } />
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+
+const getInitialValues = (): Nullish>> => {
+ return {
+ nodeName: "",
+ autoRestart: true,
+ };
+};
+
+const getSchema = ({ i18n = getI18n() }: { i18n?: ReturnType }) => {
+ const { t: _ } = i18n;
+
+ return z.object({
+ nodeName: z.string().nonempty(),
+ autoRestart: z.boolean().nullish(),
+ });
+};
+
+const _default = Object.assign(BizDeployNodeConfigFieldsProviderProxmoxBS, {
+ getInitialValues,
+ getSchema,
+});
+
+export default _default;
diff --git a/ui/src/domain/acmeAccount.ts b/ui/src/domain/acmeAccount.ts
new file mode 100644
index 000000000..e44f2563f
--- /dev/null
+++ b/ui/src/domain/acmeAccount.ts
@@ -0,0 +1,16 @@
+export interface ACMEAccountView {
+ id: string;
+ ca: string;
+ email: string;
+ acmeDirUrl: string;
+ acmeAcctUrl: string;
+ created: string;
+ updated: string;
+}
+
+export interface ACMEAccountImportPayload {
+ privateKeyPem: string;
+ ca: string;
+ acmeDirUrl?: string;
+ email?: string;
+}
diff --git a/ui/src/domain/provider.ts b/ui/src/domain/provider.ts
index faa9c70b5..dab012076 100644
--- a/ui/src/domain/provider.ts
+++ b/ui/src/domain/provider.ts
@@ -32,6 +32,7 @@ export const ACCESS_PROVIDERS = Object.freeze({
APISIX: "apisix",
ARVANCLOUD: "arvancloud",
AWS: "aws",
+ AXISNOW: "axisnow",
AZURE: "azure",
BAIDUCLOUD: "baiducloud",
BAISHAN: "baishan",
@@ -80,6 +81,7 @@ export const ACCESS_PROVIDERS = Object.freeze({
HOSTINGDE: "hostingde",
HOSTINGER: "hostinger",
HUAWEICLOUD: "huaweicloud",
+ HUAWEIIBMC: "huaweiibmc",
INFOMANIAK: "infomaniak",
IONOS: "ionos",
JDCLOUD: "jdcloud",
@@ -106,6 +108,7 @@ export const ACCESS_PROVIDERS = Object.freeze({
OVHCLOUD: "ovhcloud",
PORKBUN: "porkbun",
POWERDNS: "powerdns",
+ PROXMOXBS: "proxmoxbs",
PROXMOXVE: "proxmoxve",
QINGCLOUD: "qingcloud",
RAINYUN: "rainyun",
@@ -214,16 +217,19 @@ export const accessProvidersMap: Map
).map(([type, name, category, builtin]) => [
type,
diff --git a/ui/src/i18n/resources/en/nls.access.json b/ui/src/i18n/resources/en/nls.access.json
index faf783697..7b9e2cf39 100644
--- a/ui/src/i18n/resources/en/nls.access.json
+++ b/ui/src/i18n/resources/en/nls.access.json
@@ -243,6 +243,11 @@
"placeholder": "Please enter AWS SecretAccessKey",
"tooltip": "For more information, see https://docs.aws.amazon.com/en_us/IAM/latest/UserGuide/id_credentials_access-keys.html"
},
+ "axisnow_api_token": {
+ "label": "AxisNow API token",
+ "placeholder": "Please enter AxisNow API token",
+ "tooltip": "For more information, see https://www.axisnow.io/zh/docs/edge/tenant/api-tokens"
+ },
"azure_tenant_id": {
"label": "Azure tenant ID",
"placeholder": "Please enter Azure tenant ID",
@@ -791,6 +796,18 @@
"placeholder": "Please enter Huawei Cloud enterprise project ID",
"tooltip": "For more information, see https://support.huaweicloud.com/intl/en-us/usermanual-em/em_03_0000.html"
},
+ "huaweiibmc_host": {
+ "label": "iBMC Redfish server host",
+ "placeholder": "Please enter iBMC Redfish server host"
+ },
+ "huaweiibmc_username": {
+ "label": "iBMC username",
+ "placeholder": "Please enter the iBMC username"
+ },
+ "huaweiibmc_password": {
+ "label": "iBMC password",
+ "placeholder": "Please enter the iBMC password"
+ },
"infomaniak_access_token": {
"label": "Infomaniak access token",
"placeholder": "Please enter Infomaniak access token",
@@ -1117,6 +1134,20 @@
"placeholder": "Please enter PowerDNS API key",
"tooltip": "For more information, see https://doc.powerdns.com/authoritative/http-api/index.html#enabling-the-api"
},
+ "proxmoxbs_server_url": {
+ "label": "Proxmox BS server URL",
+ "placeholder": "Please enter Proxmox BS server URL"
+ },
+ "proxmoxbs_api_token": {
+ "label": "Proxmox BS API token",
+ "placeholder": "Please enter Proxmox BS API token",
+ "tooltip": "For more information, see https://pbs.proxmox.com/docs/user-management.html#api-tokens"
+ },
+ "proxmoxbs_api_token_secret": {
+ "label": "Proxmox BS API token secret",
+ "placeholder": "Please enter Proxmox BS API token secret",
+ "tooltip": "For more information, see https://pbs.proxmox.com/docs/user-management.html#api-tokens"
+ },
"proxmoxve_server_url": {
"label": "Proxmox VE server URL",
"placeholder": "Please enter Proxmox VE server URL"
@@ -1127,7 +1158,7 @@
"tooltip": "For more information, see https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens"
},
"proxmoxve_api_token_secret": {
- "label": "Proxmox VE API token secret (Optional)",
+ "label": "Proxmox VE API token secret",
"placeholder": "Please enter Proxmox VE API token secret",
"tooltip": "For more information, see https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens"
},
diff --git a/ui/src/i18n/resources/en/nls.certificate.json b/ui/src/i18n/resources/en/nls.certificate.json
index b16244656..fa247e32f 100644
--- a/ui/src/i18n/resources/en/nls.certificate.json
+++ b/ui/src/i18n/resources/en/nls.certificate.json
@@ -121,6 +121,17 @@
"issuer_name": "Issuer common name",
"issuer_org": "Issuer organization",
"key_algorithm": "Key algorithm",
+ "ari_supported": {
+ "": "ARI",
+ "supported": "Supported",
+ "not_supported": "Not supported"
+ },
+ "ari_window": "ARI Suggested Renewal Window (CA Guidance)",
+ "ari_window_expiry_context": "Certificate expires: {{validityNotAfter}}, {{daysLeft}} days remaining",
+ "ari_window_active_tip": "The CA recommends renewing within this window. If the current time falls within this window on the next workflow run, the certificate will be renewed early (regardless of your configured threshold).",
+ "ari_window_passed_tip": "The CA's suggested renewal window has ended. The certificate will be renewed immediately on the next workflow run.",
+ "ari_next_refresh": "Next ARI refresh",
+ "ari_not_supported_tip": "This CA does not support ARI (RFC 9773).",
"created_at": "Created at",
"updated_at": "Updated at"
}
diff --git a/ui/src/i18n/resources/en/nls.common.json b/ui/src/i18n/resources/en/nls.common.json
index 4d670f497..ac1d3c727 100644
--- a/ui/src/i18n/resources/en/nls.common.json
+++ b/ui/src/i18n/resources/en/nls.common.json
@@ -53,7 +53,7 @@
"errmsg": {
"domain_invalid": "Invalid domain name",
- "host_invalid": "Invalid domain name or IP address",
+ "host_invalid": "Invalid host: not a domain name or IP address",
"port_invalid": "Invalid port",
"ip_invalid": "Invalid IP address",
"json_invalid": "Invalid JSON string",
diff --git a/ui/src/i18n/resources/en/nls.provider.json b/ui/src/i18n/resources/en/nls.provider.json
index b371b42e5..d2bbf7063 100644
--- a/ui/src/i18n/resources/en/nls.provider.json
+++ b/ui/src/i18n/resources/en/nls.provider.json
@@ -77,6 +77,7 @@
"aws_lightsail": "AWS - Lightsail",
"aws_nlb": "AWS - NLB (Network Load Balancer)",
"aws_route53": "AWS - Route53",
+ "axisnow": "AxisNow",
"azure": "Azure (Microsoft Azure)",
"azure_dns": "Azure - DNS",
"azure_keyvault": "Azure - KeyVault",
@@ -176,6 +177,7 @@
"huaweicloud_scm_upload": "Huawei Cloud - Upload to SCM (SSL Certificate Manager)",
"huaweicloud_vod": "Huawei Cloud - VOD (Video on Demand)",
"huaweicloud_waf": "Huawei Cloud - WAF (Web Application Firewall)",
+ "huaweiibmc": "Huawei iBMC",
"infomaniak": "Infomaniak",
"ionos": "IONOS",
"jdcloud": "JD Cloud",
@@ -216,7 +218,8 @@
"ovhcloud": "OVHcloud",
"porkbun": "Porkbun",
"powerdns": "PowerDNS",
- "proxmoxve": "Proxmox VE",
+ "proxmoxve": "PVE (Proxmox Virtual Environment)",
+ "proxmoxbs": "PBS (Proxmox Backup Server)",
"qingcloud": "QingCloud",
"qingcloud_dns": "QingCloud - DNS",
"qingcloud_lb": "QingCloud - LBC (Load Balancer Cluster)",
diff --git a/ui/src/i18n/resources/en/nls.settings.json b/ui/src/i18n/resources/en/nls.settings.json
index e584ca784..74259314f 100644
--- a/ui/src/i18n/resources/en/nls.settings.json
+++ b/ui/src/i18n/resources/en/nls.settings.json
@@ -100,6 +100,62 @@
"tab": "Plugins"
},
+ "acmeaccounts": {
+ "tab": "ACME accounts",
+ "title": "ACME account credentials",
+ "tips": "Manage ACME account private keys used for certificate issuance. Export enables interoperability with other ACME clients; rotate replaces the key at the CA (old key becomes invalid immediately).",
+ "empty": "No ACME accounts stored yet. Accounts are created automatically when certificates are issued, or you can import an existing private key.",
+ "filter": {
+ "ca_placeholder": "Filter by CA"
+ },
+ "table": {
+ "ca": "Certificate authority",
+ "email": "Email",
+ "account_uri": "Account URI",
+ "directory": "Directory URL",
+ "created": "Created",
+ "actions": "Actions"
+ },
+ "action": {
+ "import": "Import",
+ "export": "Export",
+ "rotate": "Rotate key"
+ },
+ "import": {
+ "modal": {
+ "title": "Import ACME account"
+ },
+ "form": {
+ "ca": "Certificate authority",
+ "ca_placeholder": "Select CA",
+ "directory": "ACME directory URL",
+ "directory_placeholder": "https://example.com/acme/directory",
+ "private_key": "Account private key (PEM)",
+ "private_key_placeholder": "-----BEGIN ... PRIVATE KEY-----",
+ "private_key_extra": "The Account URI is resolved automatically via the ACME server (existing account only).",
+ "email": "Email",
+ "email_placeholder": "Optional if the CA returns a contact email",
+ "email_extra": "Required when the CA account has no mailto contact."
+ }
+ },
+ "export": {
+ "confirm": {
+ "title": "Export private key?",
+ "content": "The ACME account private key controls certificate issuance and revocation for this account. Only export it to a trusted environment."
+ },
+ "modal": {
+ "title": "Account private key",
+ "tips": "Store this key securely. Anyone with this key can act as this ACME account."
+ }
+ },
+ "rotate": {
+ "confirm": {
+ "title": "Rotate account key?",
+ "content": "The CA will invalidate the current private key immediately. Ensure no other ACME clients still use the old key. The Account URI stays the same."
+ }
+ }
+ },
+
"sslprovider": {
"tab": "Certificate authority",
"ca": {
diff --git a/ui/src/i18n/resources/en/nls.workflow.nodes.json b/ui/src/i18n/resources/en/nls.workflow.nodes.json
index 45e07c123..a2a41ce72 100644
--- a/ui/src/i18n/resources/en/nls.workflow.nodes.json
+++ b/ui/src/i18n/resources/en/nls.workflow.nodes.json
@@ -266,7 +266,7 @@
},
"disable_ari": {
"label": "Disable ARI",
- "tooltip": "It determines whether to disable ARI (ACME Renewal Information). If you don't understand this option, just keep it by default.
Click here to learn more."
+ "tooltip": "ARI (ACME Renewal Information) is a renewal scheduling hint from the CA. When enabled, if the CA suggests early renewal (e.g., pending mass revocation), the system will renew early on the next workflow run, overriding your configured threshold. When disabled, renewal is determined solely by your configured threshold.
Click here to learn more."
},
"skip_before_expiry_days": {
"label": "Repeated application",
@@ -274,7 +274,8 @@
"prefix": "Perform renewal if the last issued certificate expires in ≤",
"suffix": ".",
"unit": "days",
- "help": "Notes: The actual renewal interval also depends on the CRON expression that triggers the workflow."
+ "help": "Notes: The actual renewal timing is also affected by the workflow CRON expression and the CA's ARI suggestion (if supported).",
+ "ari_notice": "Certificate renewal is determined by two conditions: your configured threshold and the CA's ARI suggested window (if supported). Renewal triggers when either condition is met. To rely solely on your threshold, disable ARI in 'Advanced Settings'."
},
"aliyun_esa_region": {
@@ -1724,6 +1725,9 @@
"placeholder": "Please enter Huawei Cloud WAF certificate ID",
"tooltip": "For more information, see https://console-intl.huaweicloud.com/console/#/waf/certificateManagement"
},
+ "huaweiibmc_auto_restart": {
+ "label": "Auto restart iBMC after deployment"
+ },
"jdcloud_alb_region_id": {
"label": "JD Cloud region ID",
"placeholder": "Please enter JD Cloud ALB region ID (e.g. cn-north-1)",
@@ -1973,12 +1977,22 @@
"placeholder": "Please enter OCI compartment OCID",
"tooltip": "For more information, see https://docs.oracle.com/en-us/iaas/Content/Identity/compartments/managingcompartments.htm"
},
+ "proxmoxbs": {
+ "guide": "Requires Proxmox Backup Server v2.1 or higher."
+ },
+ "proxmoxbs_node_name": {
+ "label": "Proxmox BS node name",
+ "placeholder": "Please enter Proxmox BS node name"
+ },
+ "proxmoxbs_auto_restart": {
+ "label": "Auto restart Proxmox BS after deployment"
+ },
"proxmoxve": {
- "guide": "Requires Proxmox VE v5.2 or higher."
+ "guide": "Requires Proxmox Virtual Environment v5.2 or higher."
},
"proxmoxve_node_name": {
- "label": "Proxmox VE cluster node name",
- "placeholder": "Please enter Proxmox VE cluster node name"
+ "label": "Proxmox VE node name",
+ "placeholder": "Please enter Proxmox VE node name"
},
"proxmoxve_auto_restart": {
"label": "Auto restart Proxmox VE after deployment"
diff --git a/ui/src/i18n/resources/en/nls.workflow.runs.json b/ui/src/i18n/resources/en/nls.workflow.runs.json
index d6d0ced09..ff442ffa1 100644
--- a/ui/src/i18n/resources/en/nls.workflow.runs.json
+++ b/ui/src/i18n/resources/en/nls.workflow.runs.json
@@ -64,6 +64,10 @@
"logs": {
"": "Logs",
+ "renewal_trigger": {
+ "ari": "ARI Triggered",
+ "threshold": "Threshold Triggered"
+ },
"menu": {
"show_timestamps": "Show timestamps",
"show_whitespaces": "Show whitespaces",
diff --git a/ui/src/i18n/resources/zh/nls.access.json b/ui/src/i18n/resources/zh/nls.access.json
index b2a7b9d57..dba9735dc 100644
--- a/ui/src/i18n/resources/zh/nls.access.json
+++ b/ui/src/i18n/resources/zh/nls.access.json
@@ -243,6 +243,11 @@
"placeholder": "请输入 AWS SecretAccessKey",
"tooltip": "这是什么?请参阅 https://docs.aws.amazon.com/zh_cn/IAM/latest/UserGuide/id_credentials_access-keys.html"
},
+ "axisnow_api_token": {
+ "label": "AxisNow API 令牌",
+ "placeholder": "请输入 AxisNow API 令牌",
+ "tooltip": "这是什么?请参阅 https://www.axisnow.io/zh/docs/edge/tenant/api-tokens"
+ },
"azure_tenant_id": {
"label": "Azure 租户 ID",
"placeholder": "请输入 Azure 租户 ID",
@@ -791,6 +796,18 @@
"placeholder": "请输入华为云企业项目 ID",
"tooltip": "这是什么?请参阅 https://support.huaweicloud.com/usermanual-em/zh-cn_topic_0126101490.html"
},
+ "huaweiibmc_host": {
+ "label": "iBMC Redfish 服务器地址",
+ "placeholder": "请输入 iBMC Redfish 服务器地址"
+ },
+ "huaweiibmc_username": {
+ "label": "iBMC 用户名",
+ "placeholder": "请输入 iBMC 用户名"
+ },
+ "huaweiibmc_password": {
+ "label": "iBMC 密码",
+ "placeholder": "请输入 iBMC 密码"
+ },
"infomaniak_access_token": {
"label": "Infomaniak AccessToken",
"placeholder": "请输入 Infomaniak AccessToken",
@@ -1117,6 +1134,20 @@
"placeholder": "请输入 PowerDNS API Key",
"tooltip": "这是什么?请参阅 https://doc.powerdns.com/authoritative/http-api/index.html#enabling-the-api"
},
+ "proxmoxbs_server_url": {
+ "label": "Proxmox BS 服务地址",
+ "placeholder": "请输入 Proxmox BS 服务地址"
+ },
+ "proxmoxbs_api_token": {
+ "label": "Proxmox BS API Token",
+ "placeholder": "请输入 Proxmox BS API Token",
+ "tooltip": "这是什么?请参阅 https://pbs.proxmox.com/docs/user-management.html#api-tokens"
+ },
+ "proxmoxbs_api_token_secret": {
+ "label": "Proxmox BS API Token Secret",
+ "placeholder": "请输入 Proxmox BS API Token Secret",
+ "tooltip": "这是什么?请参阅 https://pbs.proxmox.com/docs/user-management.html#api-tokens"
+ },
"proxmoxve_server_url": {
"label": "Proxmox VE 服务地址",
"placeholder": "请输入 Proxmox VE 服务地址"
@@ -1127,7 +1158,7 @@
"tooltip": "这是什么?请参阅 https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens"
},
"proxmoxve_api_token_secret": {
- "label": "Proxmox VE API Token Secret(可选)",
+ "label": "Proxmox VE API Token Secret",
"placeholder": "请输入 Proxmox VE API Token Secret",
"tooltip": "这是什么?请参阅 https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens"
},
diff --git a/ui/src/i18n/resources/zh/nls.certificate.json b/ui/src/i18n/resources/zh/nls.certificate.json
index 8af563a82..674667038 100644
--- a/ui/src/i18n/resources/zh/nls.certificate.json
+++ b/ui/src/i18n/resources/zh/nls.certificate.json
@@ -121,6 +121,17 @@
"issuer_name": "颁发者通用名称",
"issuer_org": "颁发者组织",
"key_algorithm": "私钥算法",
+ "ari_supported": {
+ "": "ARI",
+ "supported": "支持",
+ "not_supported": "不支持"
+ },
+ "ari_window": "ARI 建议续期窗口(CA 建议)",
+ "ari_window_expiry_context": "证书到期时间:{{validityNotAfter}},距离到期 {{daysLeft}} 天",
+ "ari_window_active_tip": "CA 建议在此窗口内续期。如果在下次工作流运行时当前时间处于该窗口内,系统将提前续期证书(无论你设置的续期阈值如何)。",
+ "ari_window_passed_tip": "CA 建议的续期窗口已结束。系统将在下次工作流运行时立即续期。",
+ "ari_next_refresh": "下次 ARI 刷新时间",
+ "ari_not_supported_tip": "当前 CA 不支持 ARI(RFC 9773)。",
"created_at": "创建时间",
"updated_at": "更新时间"
}
diff --git a/ui/src/i18n/resources/zh/nls.common.json b/ui/src/i18n/resources/zh/nls.common.json
index f6124e050..0460cc466 100644
--- a/ui/src/i18n/resources/zh/nls.common.json
+++ b/ui/src/i18n/resources/zh/nls.common.json
@@ -53,7 +53,7 @@
"errmsg": {
"domain_invalid": "无效域名",
- "host_invalid": "无效域名或 IP 地址",
+ "host_invalid": "无效主机:不是一个有效的域名或 IP 地址",
"port_invalid": "无效端口号",
"ip_invalid": "无效 IP 地址",
"json_invalid": "无效 JSON 格式字符串",
diff --git a/ui/src/i18n/resources/zh/nls.provider.json b/ui/src/i18n/resources/zh/nls.provider.json
index 2f22540c9..5ad9c91cd 100644
--- a/ui/src/i18n/resources/zh/nls.provider.json
+++ b/ui/src/i18n/resources/zh/nls.provider.json
@@ -77,6 +77,7 @@
"aws_lightsail": "AWS - Lightsail",
"aws_nlb": "AWS - 网络负载均衡器 NLB",
"aws_route53": "AWS - Route53",
+ "axisnow": "AxisNow",
"azure": "Azure(Microsoft Azure)",
"azure_dns": "Azure - DNS",
"azure_keyvault": "Azure - KeyVault",
@@ -176,6 +177,7 @@
"huaweicloud_scm_upload": "华为云 - 上传到云证书管理服务 SCM",
"huaweicloud_vod": "华为云 - 视频点播 VOD",
"huaweicloud_waf": "华为云 - Web 应用防火墙 WAF",
+ "huaweiibmc": "华为 iBMC",
"infomaniak": "Infomaniak",
"ionos": "IONOS",
"jdcloud": "京东云",
@@ -216,7 +218,8 @@
"ovhcloud": "OVHcloud",
"porkbun": "Porkbun",
"powerdns": "PowerDNS",
- "proxmoxve": "Proxmox VE",
+ "proxmoxve": "PVE(Proxmox Virtual Environment)",
+ "proxmoxbs": "PBS(Proxmox Backup Server)",
"qingcloud": "青云",
"qingcloud_dns": "青云 - 云解析 DNS",
"qingcloud_lb": "青云 - 负载均衡 LB",
diff --git a/ui/src/i18n/resources/zh/nls.settings.json b/ui/src/i18n/resources/zh/nls.settings.json
index 6e5355cb9..eafa2396f 100644
--- a/ui/src/i18n/resources/zh/nls.settings.json
+++ b/ui/src/i18n/resources/zh/nls.settings.json
@@ -100,6 +100,62 @@
"tab": "插件"
},
+ "acmeaccounts": {
+ "tab": "ACME 账户",
+ "title": "ACME 账户凭据",
+ "tips": "管理用于签发证书的 ACME 账户私钥。导出可与其他 ACME 客户端互通;轮转会在 CA 侧更换密钥(旧密钥立即失效)。",
+ "empty": "尚无已存储的 ACME 账户。签发证书时会自动创建账户,也可导入已有私钥。",
+ "filter": {
+ "ca_placeholder": "按 CA 筛选"
+ },
+ "table": {
+ "ca": "证书颁发机构",
+ "email": "邮箱",
+ "account_uri": "Account URI",
+ "directory": "Directory URL",
+ "created": "创建时间",
+ "actions": "操作"
+ },
+ "action": {
+ "import": "导入",
+ "export": "导出",
+ "rotate": "轮转密钥"
+ },
+ "import": {
+ "modal": {
+ "title": "导入 ACME 账户"
+ },
+ "form": {
+ "ca": "证书颁发机构",
+ "ca_placeholder": "请选择 CA",
+ "directory": "ACME Directory URL",
+ "directory_placeholder": "https://example.com/acme/directory",
+ "private_key": "账户私钥(PEM)",
+ "private_key_placeholder": "-----BEGIN ... PRIVATE KEY-----",
+ "private_key_extra": "将通过 ACME 服务器自动探测 Account URI(仅恢复已存在账户,不会新建)。",
+ "email": "邮箱",
+ "email_placeholder": "若 CA 返回联系邮箱可留空",
+ "email_extra": "当 CA 账户没有 mailto 联系方式时必填。"
+ }
+ },
+ "export": {
+ "confirm": {
+ "title": "导出私钥?",
+ "content": "ACME 账户私钥可用于签发与吊销证书。请仅导出到可信环境。"
+ },
+ "modal": {
+ "title": "账户私钥",
+ "tips": "请妥善保管。持有该私钥即可冒充此 ACME 账户。"
+ }
+ },
+ "rotate": {
+ "confirm": {
+ "title": "轮转账户密钥?",
+ "content": "CA 将立即作废当前私钥。请确认没有其他 ACME 客户端仍在使用旧密钥。Account URI 保持不变。"
+ }
+ }
+ },
+
"sslprovider": {
"tab": "证书颁发机构",
"ca": {
diff --git a/ui/src/i18n/resources/zh/nls.workflow.nodes.json b/ui/src/i18n/resources/zh/nls.workflow.nodes.json
index 68df048fc..ed569e283 100644
--- a/ui/src/i18n/resources/zh/nls.workflow.nodes.json
+++ b/ui/src/i18n/resources/zh/nls.workflow.nodes.json
@@ -265,7 +265,7 @@
},
"disable_ari": {
"label": "阻止 ARI 续期",
- "tooltip": "在 ACME 证书续期时是否阻止 ARI(ACME Renewal Information)。如果你不了解该选项的用途,保持默认即可。
点此了解更多。"
+ "tooltip": "ARI(ACME Renewal Information)是 CA 提供的续期时间建议。开启后,如果 CA 建议提前续期(例如证书即将被批量吊销),系统会在下次工作流运行时提前续期,而忽略你设置的续期阈值。关闭后,续期完全由你设置的续期阈值决定。
点此了解更多。"
},
"skip_before_expiry_days": {
"label": "重复申请",
@@ -273,7 +273,8 @@
"prefix": "当上次申请的证书剩余时长大于",
"suffix": ",再次运行工作流时跳过此节点。",
"unit": "天",
- "help": "提示:证书实际续期间隔还取决于触发运行的 CRON 表达式。"
+ "help": "提示:证书实际续期时机同时受工作流 CRON 表达式和 CA 的 ARI 建议(如支持)影响。",
+ "ari_notice": "证书续期由两个条件共同决定:你设置的续期阈值和 CA 的 ARI 建议窗口(如果 CA 支持)。任一条件满足时都会触发续期。如需完全由你控制续期时间,可在「高级设置」中关闭 ARI。"
},
"aliyun_esa_region": {
@@ -1723,6 +1724,9 @@
"placeholder": "请输入华为云 WAF 证书 ID",
"tooltip": "这是什么?请参阅 https://console.huaweicloud.com/console/#/waf/certificateManagement"
},
+ "huaweiibmc_auto_restart": {
+ "label": "部署后自动重启 iBMC 服务"
+ },
"jdcloud_alb_region_id": {
"label": "京东云服务地域 ID",
"placeholder": "请输入京东云 ALB 服务地域 ID(例如:cn-north-1)",
@@ -1972,12 +1976,22 @@
"placeholder": "请输入 OCI 资源区间 OCID",
"tooltip": "这是什么?请参阅 https://docs.oracle.com/en-us/iaas/Content/Identity/compartments/managingcompartments.htm"
},
+ "proxmoxbs": {
+ "guide": "需要 Proxmox Backup Server v2.1 或更高版本。"
+ },
+ "proxmoxbs_node_name": {
+ "label": "Proxmox BS 节点名称",
+ "placeholder": "请输入 Proxmox BS 节点名称"
+ },
+ "proxmoxbs_auto_restart": {
+ "label": "部署后自动重启 Proxmox BS 服务"
+ },
"proxmoxve": {
- "guide": "需要 Proxmox VE v5.2 或更高版本。"
+ "guide": "需要 Proxmox Virtual Environment v5.2 或更高版本。"
},
"proxmoxve_node_name": {
- "label": "Proxmox VE 集群节点名称",
- "placeholder": "请输入 Proxmox VE 集群节点名称"
+ "label": "Proxmox VE 节点名称",
+ "placeholder": "请输入 Proxmox VE 节点名称"
},
"proxmoxve_auto_restart": {
"label": "部署后自动重启 Proxmox VE 服务"
diff --git a/ui/src/i18n/resources/zh/nls.workflow.runs.json b/ui/src/i18n/resources/zh/nls.workflow.runs.json
index 72d9b60c3..1643a88bf 100644
--- a/ui/src/i18n/resources/zh/nls.workflow.runs.json
+++ b/ui/src/i18n/resources/zh/nls.workflow.runs.json
@@ -64,6 +64,10 @@
"logs": {
"": "日志",
+ "renewal_trigger": {
+ "ari": "ARI 触发",
+ "threshold": "阈值触发"
+ },
"menu": {
"show_timestamps": "显示日期时间",
"show_whitespaces": "显示转义换行符",
diff --git a/ui/src/pages/settings/Settings.tsx b/ui/src/pages/settings/Settings.tsx
index b36747c12..d8f9239f2 100644
--- a/ui/src/pages/settings/Settings.tsx
+++ b/ui/src/pages/settings/Settings.tsx
@@ -1,7 +1,7 @@
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { Outlet, useLocation, useNavigate } from "react-router-dom";
-import { IconDatabaseCog, IconHeartRateMonitor, IconInfoCircle, IconPalette, IconPlugConnected, IconPuzzle, IconUserShield } from "@tabler/icons-react";
+import { IconDatabaseCog, IconHeartRateMonitor, IconInfoCircle, IconKey, IconPalette, IconPlugConnected, IconPuzzle, IconUserShield } from "@tabler/icons-react";
import { Menu } from "antd";
const Settings = () => {
@@ -14,6 +14,7 @@ const Settings = () => {
["account", "settings.account.tab", ],
["appearance", "settings.appearance.tab", ],
["ssl-provider", "settings.sslprovider.tab", ],
+ ["acme-accounts", "settings.acmeaccounts.tab", ],
["plugins", "settings.plugins.tab", ],
["persistence", "settings.persistence.tab", ],
["diagnostics", "settings.diagnostics.tab", ],
diff --git a/ui/src/pages/settings/SettingsAcmeAccounts.tsx b/ui/src/pages/settings/SettingsAcmeAccounts.tsx
new file mode 100644
index 000000000..da5114880
--- /dev/null
+++ b/ui/src/pages/settings/SettingsAcmeAccounts.tsx
@@ -0,0 +1,340 @@
+import { useMemo, useState } from "react";
+import { useTranslation } from "react-i18next";
+import { IconDownload, IconPlus, IconRefresh } from "@tabler/icons-react";
+import { useRequest } from "ahooks";
+import { App, Button, Empty, Form, Input, Modal, Select, Space, Table, Typography, type TableProps } from "antd";
+import { createSchemaFieldRule } from "antd-zod";
+import dayjs from "dayjs";
+import { saveAs } from "file-saver";
+import { z } from "zod";
+
+import { exportAccount, importAccount, list as listAcmeAccounts, rotateAccount } from "@/api/acmeAccounts";
+import Show from "@/components/Show";
+import { type ACMEAccountView } from "@/domain/acmeAccount";
+import { CA_PROVIDERS, caProvidersMap } from "@/domain/provider";
+import { useAntdForm, useAppSettings } from "@/hooks";
+import { unwrapErrMsg } from "@/utils/error";
+
+const SettingsAcmeAccounts = () => {
+ const { t } = useTranslation();
+ const { message, modal, notification } = App.useApp();
+ const { appSettings: globalAppSettings } = useAppSettings();
+
+ const [caFilter, setCaFilter] = useState();
+ const [page, setPage] = useState(1);
+ const [pageSize, setPageSize] = useState(() => globalAppSettings.defaultPerPage ?? 15);
+
+ const {
+ data: listData,
+ loading,
+ refresh,
+ } = useRequest(
+ async () => {
+ const res = await listAcmeAccounts({
+ page,
+ perPage: pageSize,
+ ca: caFilter || undefined,
+ });
+ return {
+ items: res.data?.items ?? [],
+ totalItems: res.data?.totalItems ?? 0,
+ };
+ },
+ {
+ refreshDeps: [page, pageSize, caFilter],
+ onError: (err) => {
+ notification.error({ title: t("common.text.request_error"), description: unwrapErrMsg(err) });
+ },
+ }
+ );
+
+ const tableData = listData?.items ?? [];
+ const tableTotal = listData?.totalItems ?? 0;
+
+ const [importOpen, setImportOpen] = useState(false);
+ const [exportPem, setExportPem] = useState<{ id: string; pem: string } | null>(null);
+
+ const caOptions = useMemo(() => {
+ return Array.from(caProvidersMap.values()).map((p) => ({
+ value: p.type,
+ label: t(p.name),
+ }));
+ }, [t]);
+
+ const importSchema = z
+ .object({
+ privateKeyPem: z.string().min(1, t("common.errmsg.form_invalid")),
+ ca: z.string().min(1, t("common.errmsg.form_invalid")),
+ acmeDirUrl: z.string().optional(),
+ email: z.union([z.string().email(), z.literal("")]).optional(),
+ })
+ .superRefine((val, ctx) => {
+ if (val.ca === CA_PROVIDERS.ACMECA && !val.acmeDirUrl?.trim()) {
+ ctx.addIssue({ code: "custom", message: t("common.errmsg.form_invalid"), path: ["acmeDirUrl"] });
+ }
+ });
+ const importRule = createSchemaFieldRule(importSchema);
+ const {
+ form: importForm,
+ formPending: importPending,
+ formProps: importFormProps,
+ } = useAntdForm>({
+ onSubmit: async (values) => {
+ try {
+ await importAccount({
+ privateKeyPem: values.privateKeyPem,
+ ca: values.ca,
+ acmeDirUrl: values.acmeDirUrl || undefined,
+ email: values.email || undefined,
+ });
+ message.success(t("common.text.operation_succeeded"));
+ setImportOpen(false);
+ importForm.resetFields();
+ setPage(1);
+ refresh();
+ } catch (err) {
+ notification.error({ title: t("common.text.request_error"), description: unwrapErrMsg(err) });
+ }
+ },
+ });
+
+ const caWatch = Form.useWatch("ca", importForm);
+
+ const handleExport = (record: ACMEAccountView) => {
+ modal.confirm({
+ title: t("settings.acmeaccounts.export.confirm.title"),
+ content: t("settings.acmeaccounts.export.confirm.content"),
+ okText: t("common.button.confirm"),
+ cancelText: t("common.button.cancel"),
+ okButtonProps: { danger: true },
+ onOk: async () => {
+ try {
+ const res = await exportAccount(record.id);
+ setExportPem({ id: record.id, pem: res.data.privateKeyPem });
+ } catch (err) {
+ notification.error({ title: t("common.text.request_error"), description: unwrapErrMsg(err) });
+ }
+ },
+ });
+ };
+
+ const handleRotate = (record: ACMEAccountView) => {
+ modal.confirm({
+ title: t("settings.acmeaccounts.rotate.confirm.title"),
+ content: t("settings.acmeaccounts.rotate.confirm.content"),
+ okText: t("common.button.confirm"),
+ cancelText: t("common.button.cancel"),
+ okButtonProps: { danger: true },
+ onOk: async () => {
+ try {
+ await rotateAccount(record.id);
+ message.success(t("common.text.operation_succeeded"));
+ refresh();
+ } catch (err) {
+ notification.error({ title: t("common.text.request_error"), description: unwrapErrMsg(err) });
+ }
+ },
+ });
+ };
+
+ const handlePaginationChange = (nextPage: number, nextPageSize: number) => {
+ setPage(nextPage);
+ setPageSize(nextPageSize);
+ };
+
+ const handleCaFilterChange = (value: string | undefined) => {
+ setCaFilter(value);
+ setPage(1);
+ };
+
+ const providerLabel = (ca: string) => {
+ const p = caProvidersMap.get(ca);
+ return p ? t(p.name) : ca;
+ };
+
+ const columns: TableProps["columns"] = [
+ {
+ key: "ca",
+ title: t("settings.acmeaccounts.table.ca"),
+ dataIndex: "ca",
+ width: 180,
+ ellipsis: true,
+ render: (v: string) => providerLabel(v),
+ },
+ {
+ key: "email",
+ title: t("settings.acmeaccounts.table.email"),
+ dataIndex: "email",
+ ellipsis: true,
+ },
+ {
+ key: "acmeAcctUrl",
+ title: t("settings.acmeaccounts.table.account_uri"),
+ dataIndex: "acmeAcctUrl",
+ ellipsis: true,
+ render: (v: string) => (
+
+ {v}
+
+ ),
+ },
+ {
+ key: "acmeDirUrl",
+ title: t("settings.acmeaccounts.table.directory"),
+ dataIndex: "acmeDirUrl",
+ ellipsis: true,
+ responsive: ["lg"],
+ },
+ {
+ key: "created",
+ title: t("settings.acmeaccounts.table.created"),
+ dataIndex: "created",
+ width: 160,
+ responsive: ["xl"],
+ render: (v: string) => (v ? dayjs(v).format("YYYY-MM-DD HH:mm") : "-"),
+ },
+ {
+ key: "$action",
+ title: t("settings.acmeaccounts.table.actions"),
+ width: 200,
+ align: "end",
+ fixed: "right",
+ render: (_, record) => (
+
+ } onClick={() => handleExport(record)}>
+ {t("settings.acmeaccounts.action.export")}
+
+ } onClick={() => handleRotate(record)}>
+ {t("settings.acmeaccounts.action.rotate")}
+
+
+ ),
+ },
+ ];
+
+ return (
+
+
+
+
{t("settings.acmeaccounts.title")}
+
+ {t("settings.acmeaccounts.tips")}
+
+
+
+
+ } onClick={() => refresh()} loading={loading}>
+ {t("common.button.reload")}
+
+ } onClick={() => setImportOpen(true)}>
+ {t("settings.acmeaccounts.action.import")}
+
+
+
+
+
+ ),
+ }}
+ pagination={{
+ current: page,
+ pageSize: pageSize,
+ total: tableTotal,
+ showSizeChanger: true,
+ onChange: handlePaginationChange,
+ onShowSizeChange: handlePaginationChange,
+ }}
+ />
+
+
{
+ setImportOpen(false);
+ importForm.resetFields();
+ }}
+ onOk={() => importForm.submit()}
+ confirmLoading={importPending}
+ destroyOnHidden
+ width={640}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
setExportPem(null)}
+ footer={[
+ ,
+ ,
+ ]}
+ width={640}
+ >
+ {t("settings.acmeaccounts.export.modal.tips")}
+
+
+
+ );
+};
+
+export default SettingsAcmeAccounts;
diff --git a/ui/src/pages/workflows/WorkflowList.tsx b/ui/src/pages/workflows/WorkflowList.tsx
index 696df2688..cd945ec38 100644
--- a/ui/src/pages/workflows/WorkflowList.tsx
+++ b/ui/src/pages/workflows/WorkflowList.tsx
@@ -52,6 +52,8 @@ const WorkflowList = () => {
{
key: "name",
title: t("workflow.props.name"),
+ sorter: true,
+ sortOrder: sorter.columnKey === "name" ? sorter.order : void 0,
render: (_, record) => (
{record.name || "\u00A0"}
@@ -242,7 +244,7 @@ const WorkflowList = () => {
() => {
const { columnKey: sorterKey, order: sorterOrder } = sorter;
let sort: string | undefined;
- sort = sorterKey === "lastRun" ? "lastRunTime" : void 0;
+ sort = sorterKey === "name" ? "name" : sorterKey === "lastRun" ? "lastRunTime" : void 0;
sort = sort && (sorterOrder === "ascend" ? `${sort}` : sorterOrder === "descend" ? `-${sort}` : void 0);
return listWorkflows({
diff --git a/ui/src/routers/index.tsx b/ui/src/routers/index.tsx
index 061132c81..4842ece2b 100644
--- a/ui/src/routers/index.tsx
+++ b/ui/src/routers/index.tsx
@@ -12,6 +12,7 @@ import PresetList from "@/pages/presets/PresetList";
import Settings from "@/pages/settings/Settings";
import SettingsAbout from "@/pages/settings/SettingsAbout";
import SettingsAccount from "@/pages/settings/SettingsAccount";
+import SettingsAcmeAccounts from "@/pages/settings/SettingsAcmeAccounts";
import SettingsAppearance from "@/pages/settings/SettingsAppearance";
import SettingsDiagnostics from "@/pages/settings/SettingsDiagnostics";
import SettingsPlugins from "@/pages/settings/SettingsPlugins";
@@ -86,6 +87,10 @@ export const router = createHashRouter([
path: "/settings/ssl-provider",
element: ,
},
+ {
+ path: "/settings/acme-accounts",
+ element: ,
+ },
{
path: "/settings/persistence",
element: ,