mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-24 14:10:49 -04:00
api: move hack/configapi into internal/api
The tool has an e2e test and is part of our production pipeline.
This commit is contained in:
parent
97dc15b1d1
commit
376bc6d39f
7 changed files with 19 additions and 18 deletions
|
@ -33,4 +33,4 @@ runs:
|
||||||
COSIGN_PRIVATE_KEY: ${{ inputs.cosignPrivateKey }}
|
COSIGN_PRIVATE_KEY: ${{ inputs.cosignPrivateKey }}
|
||||||
COSIGN_PASSWORD: ${{ inputs.cosignPassword }}
|
COSIGN_PASSWORD: ${{ inputs.cosignPassword }}
|
||||||
run: |
|
run: |
|
||||||
bazel run //hack/configapi:configapi_e2e_test
|
bazel run //internal/api/attestationconfigapi/cli:cli_e2e_test
|
||||||
|
|
|
@ -2,13 +2,19 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||||
load("//bazel/go:go_test.bzl", "go_test")
|
load("//bazel/go:go_test.bzl", "go_test")
|
||||||
load("//bazel/sh:def.bzl", "sh_template")
|
load("//bazel/sh:def.bzl", "sh_template")
|
||||||
|
|
||||||
|
go_binary(
|
||||||
|
name = "cli",
|
||||||
|
embed = [":cli_lib"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
||||||
|
|
||||||
go_library(
|
go_library(
|
||||||
name = "configapi_lib",
|
name = "cli_lib",
|
||||||
srcs = [
|
srcs = [
|
||||||
"delete.go",
|
"delete.go",
|
||||||
"main.go",
|
"main.go",
|
||||||
],
|
],
|
||||||
importpath = "github.com/edgelesssys/constellation/v2/hack/configapi",
|
importpath = "github.com/edgelesssys/constellation/v2/internal/api/attestationconfigapi/cli",
|
||||||
visibility = ["//visibility:private"],
|
visibility = ["//visibility:private"],
|
||||||
deps = [
|
deps = [
|
||||||
"//internal/api/attestationconfigapi",
|
"//internal/api/attestationconfigapi",
|
||||||
|
@ -20,19 +26,13 @@ go_library(
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
go_binary(
|
|
||||||
name = "configapi",
|
|
||||||
embed = [":configapi_lib"],
|
|
||||||
visibility = ["//visibility:public"],
|
|
||||||
)
|
|
||||||
|
|
||||||
go_test(
|
go_test(
|
||||||
name = "configapi_test",
|
name = "cli_test",
|
||||||
srcs = [
|
srcs = [
|
||||||
"delete_test.go",
|
"delete_test.go",
|
||||||
"main_test.go",
|
"main_test.go",
|
||||||
],
|
],
|
||||||
embed = [":configapi_lib"],
|
embed = [":cli_lib"],
|
||||||
deps = [
|
deps = [
|
||||||
"//internal/api/attestationconfigapi",
|
"//internal/api/attestationconfigapi",
|
||||||
"@com_github_stretchr_testify//assert",
|
"@com_github_stretchr_testify//assert",
|
||||||
|
@ -41,10 +41,10 @@ go_test(
|
||||||
)
|
)
|
||||||
|
|
||||||
sh_template(
|
sh_template(
|
||||||
name = "configapi_e2e_test",
|
name = "cli_e2e_test",
|
||||||
data = [":configapi"],
|
data = [":cli"],
|
||||||
substitutions = {
|
substitutions = {
|
||||||
"@@CONFIGAPI_CLI@@": "$(rootpath :configapi)",
|
"@@CONFIGAPI_CLI@@": "$(rootpath :cli)",
|
||||||
},
|
},
|
||||||
template = "e2e/test.sh.in",
|
template = "e2e/test.sh.in",
|
||||||
)
|
)
|
|
@ -9,7 +9,7 @@
|
||||||
lib=$(realpath @@BASE_LIB@@) || exit 1
|
lib=$(realpath @@BASE_LIB@@) || exit 1
|
||||||
stat "${lib}" >> /dev/null || exit 1
|
stat "${lib}" >> /dev/null || exit 1
|
||||||
|
|
||||||
# shellcheck source=../../../bazel/sh/lib.bash
|
# shellcheck source=../../../../../bazel/sh/lib.bash
|
||||||
if ! source "${lib}"; then
|
if ! source "${lib}"; then
|
||||||
echo "Error: could not find import"
|
echo "Error: could not find import"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -28,7 +28,7 @@ tmpdir=$(mktemp -d)
|
||||||
readonly tmpdir
|
readonly tmpdir
|
||||||
registerExitHandler "rm -rf $tmpdir"
|
registerExitHandler "rm -rf $tmpdir"
|
||||||
|
|
||||||
readonly claim_path="'$tmpdir'/maaClaim.json"
|
readonly claim_path="$tmpdir/maaClaim.json"
|
||||||
cat << EOF > "$claim_path"
|
cat << EOF > "$claim_path"
|
||||||
{
|
{
|
||||||
"x-ms-isolation-tee": {
|
"x-ms-isolation-tee": {
|
|
@ -5,10 +5,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
# configapi CLI
|
This package provides a CLI to interact with the Attestationconfig API, a sub API of the Resource API.
|
||||||
|
|
||||||
A CLI to interact with the Attestationconfig API, a sub API of the Resource API.
|
|
||||||
You can execute an e2e test by running: `bazel run //hack/configapi:configapi_e2e_test`.
|
You can execute an e2e test by running: `bazel run //hack/configapi:configapi_e2e_test`.
|
||||||
|
The CLI is used in the CI pipeline. Actions that change the bucket's data shouldn't be executed manually.
|
||||||
|
Notice that there is no synchronization on API operations.
|
||||||
*/
|
*/
|
||||||
package main
|
package main
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue