From 2b95bf15363c76cc6824365f75784c14cbac4235 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Wed, 22 Dec 2021 15:29:22 -0700 Subject: [PATCH] renamed files to avoid camelCase; moved token to common secrets file Signed-off-by: Richard Jones --- plan/task/{gitPull.go => gitpull.go} | 0 tests/secrets_sops.yaml | 21 +++++++++++++++++++ tests/tasks.bats | 14 ++++++------- .../tasks/gitPull/{badref.cue => bad_ref.cue} | 0 .../gitPull/{badremote.cue => bad_remote.cue} | 0 .../tasks/gitPull/{gitdir.cue => git_dir.cue} | 0 tests/tasks/gitPull/privateRepo.enc.yaml | 20 ------------------ .../{privateRepo.cue => private_repo.cue} | 2 +- 8 files changed, 29 insertions(+), 28 deletions(-) rename plan/task/{gitPull.go => gitpull.go} (100%) create mode 100644 tests/secrets_sops.yaml rename tests/tasks/gitPull/{badref.cue => bad_ref.cue} (100%) rename tests/tasks/gitPull/{badremote.cue => bad_remote.cue} (100%) rename tests/tasks/gitPull/{gitdir.cue => git_dir.cue} (100%) delete mode 100644 tests/tasks/gitPull/privateRepo.enc.yaml rename tests/tasks/gitPull/{privateRepo.cue => private_repo.cue} (90%) diff --git a/plan/task/gitPull.go b/plan/task/gitpull.go similarity index 100% rename from plan/task/gitPull.go rename to plan/task/gitpull.go diff --git a/tests/secrets_sops.yaml b/tests/secrets_sops.yaml new file mode 100644 index 00000000..63bdf7e1 --- /dev/null +++ b/tests/secrets_sops.yaml @@ -0,0 +1,21 @@ +TestPAT: ENC[AES256_GCM,data:KYPnJTTCaEbEiBwODMDmOmZGx/Vu/4mOZPfRSjhBc239fPfHzDH75w==,iv:j9UFKfdRMfYg/3xw4dCoWbs0Zoy3czqRznlQrRvf4Sc=,tag:Pvd4UMFDOj8rLOwZJjsYpA==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBnUEhWbjV3M29oUUJyWk81 + Wk1WQ1E0cmtuVlhNSGxkWUM3WmJXdUYvbzAwCjlFWW9IVmtmTjY1aU1LR2lxWFlT + am9RemNqSDRWK2FDYk1xeGNiTFlWMFUKLS0tIFVrSzBCMERQbnhYb09ReVpFK00v + TG5YUDlFVzlRRFBCdEhsNVlVK1dMRTgKx1TPZWWQiaU8iMni03/ekG+m4rFCcaa4 + JI+ED2d+8411BgZtlss/ukQtwskidvYTvetyWw2jes6o1lhfDv5q2A== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2021-12-22T22:23:53Z" + mac: ENC[AES256_GCM,data:twjo6LyD0QFJoD1h5qh8SFy4XC5+2JHl6mUiUxOjLnSBwft1Ntnto3+2tzZBU6+o+v/Uo++vRoSrIkLARFt74x2xA7jZjc81e5yCkcS79bWSpZ8bA7e8/5hgkyYP5SlMAYsWKXPodmhgN7bwCa6vjZb4ZlFkJuBZrHtLeziVY1E=,iv:kgDj5lnLTgLPK38CcUVYdtE11d/gpFdHPP9hgoZQO9U=,tag:tP2E3t/jKoh2Fx6Z2X/+Tw==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.7.1 diff --git a/tests/tasks.bats b/tests/tasks.bats index ae66f6a3..d17593fb 100644 --- a/tests/tasks.bats +++ b/tests/tasks.bats @@ -94,16 +94,16 @@ setup() { } @test "task: #GitPull" { - cd "$TESTDIR"/tasks/gitPull/ - "$DAGGER" --europa up ./exists.cue - "$DAGGER" --europa up ./gitdir.cue - "$DAGGER" --europa up ./privateRepo.cue + cd "$TESTDIR" + "$DAGGER" --europa up ./tasks/gitPull/exists.cue + "$DAGGER" --europa up ./tasks/gitPull/git_dir.cue + "$DAGGER" --europa up ./tasks/gitPull/private_repo.cue - run "$DAGGER" --europa up ./invalid.cue + run "$DAGGER" --europa up ./tasks/gitPull/invalid.cue assert_failure - run "$DAGGER" --europa up ./badremote.cue + run "$DAGGER" --europa up ./tasks/gitPull/bad_remote.cue assert_failure - run "$DAGGER" --europa up ./badref.cue + run "$DAGGER" --europa up ./tasks/gitPull/bad_ref.cue assert_failure diff --git a/tests/tasks/gitPull/badref.cue b/tests/tasks/gitPull/bad_ref.cue similarity index 100% rename from tests/tasks/gitPull/badref.cue rename to tests/tasks/gitPull/bad_ref.cue diff --git a/tests/tasks/gitPull/badremote.cue b/tests/tasks/gitPull/bad_remote.cue similarity index 100% rename from tests/tasks/gitPull/badremote.cue rename to tests/tasks/gitPull/bad_remote.cue diff --git a/tests/tasks/gitPull/gitdir.cue b/tests/tasks/gitPull/git_dir.cue similarity index 100% rename from tests/tasks/gitPull/gitdir.cue rename to tests/tasks/gitPull/git_dir.cue diff --git a/tests/tasks/gitPull/privateRepo.enc.yaml b/tests/tasks/gitPull/privateRepo.enc.yaml deleted file mode 100644 index d3a8e516..00000000 --- a/tests/tasks/gitPull/privateRepo.enc.yaml +++ /dev/null @@ -1,20 +0,0 @@ -{ - "data": "ENC[AES256_GCM,data:bdiZfZl5DUcmEeQz5FYmY7LKMaFqu8tRuImNtM2kofw1JVeFeoyDRA==,iv:ovbCLds/NAzl9dfkLSrkV5qWsQG9uJJjlw8psXLgJ+w=,tag:QvmQeMmPv6+JtOC5/wSr0Q==,type:str]", - "sops": { - "kms": null, - "gcp_kms": null, - "azure_kv": null, - "hc_vault": null, - "age": [ - { - "recipient": "age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk", - "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBRc1VaM281bjRUand4V2hz\nMnNIbW8rbUt5Q05LS0RuYVJ2Q09JZU9lZWcwCk8yTVRWYlQvR1Rvb3d4Skx0K2I5\nRXB6MmxnTEtFaThRWU13L05hQWdGblUKLS0tIHpUTll5aFgwSXdzVnMvWG11MDZ4\nbXBNWVVraDI5TmZHMlFSc2VSWSsrTkEKT6gyiklm5eQ04Q2p81+FACg+aRlfgaK6\nqT3aI/pLBrQXIKp5oYpyvY+5WPvM5uQHm5wH7FKXxoxxiZOaIOwgIQ==\n-----END AGE ENCRYPTED FILE-----\n" - } - ], - "lastmodified": "2021-12-20T21:36:38Z", - "mac": "ENC[AES256_GCM,data:dxvXu9DDdWOG8pMJlh85OBSe5LePSFy8E1PYw8fQMGQFBVl9dHifTQuZ6eQeGluXtbqetgwa1ZHek1E7UO/WjtWYBtU1tBmlVqmcJ0MIJ67ULFwMHUb5yQqCh7JgymmsHRynqOQ4S2azIbqjmwz6eOyxxqNyJDA6l1NHsrVSeEU=,iv:UC02CgdM30+KOO0KDPkSFKM1HR+t2tenu0j5gYqx1FY=,tag:QB89K6zbWHjk6DCgMz8Lwg==,type:str]", - "pgp": null, - "unencrypted_suffix": "_unencrypted", - "version": "3.7.1" - } -} \ No newline at end of file diff --git a/tests/tasks/gitPull/privateRepo.cue b/tests/tasks/gitPull/private_repo.cue similarity index 90% rename from tests/tasks/gitPull/privateRepo.cue rename to tests/tasks/gitPull/private_repo.cue index 84c5ee4b..3d93d486 100644 --- a/tests/tasks/gitPull/privateRepo.cue +++ b/tests/tasks/gitPull/private_repo.cue @@ -5,7 +5,7 @@ import "alpha.dagger.io/europa/dagger/engine" engine.#Plan & { inputs: secrets: token: command: { name: "sops" - args: ["exec-env", "./privateRepo.enc.yaml", "echo $data"] + args: ["exec-env", "./secrets_sops.yaml", "echo $TestPAT"] } actions: {