2021-02-05 17:12:51 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
let
|
|
|
|
skipTests = {
|
|
|
|
access = "Access";
|
|
|
|
create = "Create";
|
|
|
|
delete = "Delete";
|
|
|
|
list = "List";
|
|
|
|
read = "Read";
|
|
|
|
replace = "Replace";
|
|
|
|
resolver = "Resolve";
|
|
|
|
revoke = "Revoke";
|
|
|
|
update = "Update";
|
|
|
|
};
|
|
|
|
|
|
|
|
skipTestsCommand =
|
|
|
|
builtins.foldl' (acc: goFileName:
|
|
|
|
let testName = builtins.getAttr goFileName skipTests; in
|
|
|
|
''
|
|
|
|
${acc}
|
|
|
|
substituteInPlace pkg/berglas/${goFileName}_test.go \
|
|
|
|
--replace "TestClient_${testName}_storage" "SkipClient_${testName}_storage" \
|
|
|
|
--replace "TestClient_${testName}_secretManager" "SkipClient_${testName}_secretManager"
|
|
|
|
''
|
|
|
|
) "" (builtins.attrNames skipTests);
|
|
|
|
in
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "berglas";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "1.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "GoogleCloudPlatform";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
sha256 = "sha256-OMmvoUzdi5rie/YCkylSKjNm2ty2HnnAuFZrLAgJHZk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
vendorHash = "sha256-WIbT1N7tRAt5vJO6j06fwUAaFxfAevRo0+r2wyy+feE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
postPatch = skipTestsCommand;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A tool for managing secrets on Google Cloud";
|
|
|
|
homepage = "https://github.com/GoogleCloudPlatform/berglas";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|