From 1456db6e3da92e2187334d5d0fd713b6c95ed94e Mon Sep 17 00:00:00 2001 From: sudoforge <9c001b67637a@sudoforge.com> Date: Fri, 12 May 2023 22:51:04 -0700 Subject: [PATCH] feat: add support for gopass as a credential store This change adds support for `gopass` as a credential store, based on the `pass` implementation. Closes: #138 Closes: #166 Signed-off-by: sudoforge <9c001b67637a@sudoforge.com> --- .github/workflows/build.yml | 6 + Dockerfile | 16 ++- Makefile | 5 +- README.md | 25 +++-- gopass/cmd/main.go | 10 ++ gopass/gopass.go | 218 ++++++++++++++++++++++++++++++++++++ gopass/gopass_test.go | 82 ++++++++++++++ 7 files changed, 350 insertions(+), 12 deletions(-) create mode 100644 gopass/cmd/main.go create mode 100644 gopass/gopass.go create mode 100644 gopass/gopass_test.go diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 201281b7..7fda5158 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,6 +63,12 @@ jobs: run: | sudo apt-get update sudo apt-get install -y dbus-x11 gnome-keyring libsecret-1-dev pass + - + name: Install gopass + env: + GOPASS_VERSION: v1.15.5 + run: go install github.com/gopasspw/gopass@${{ env.GOPASS_VERSION }} + - name: GPG conf if: ${{ matrix.os == 'ubuntu-20.04' }} diff --git a/Dockerfile b/Dockerfile index 41432719..9c597a3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ ARG XX_VERSION=1.2.1 ARG OSXCROSS_VERSION=11.3-r7-debian ARG GOLANGCI_LINT_VERSION=v1.51.1 ARG DEBIAN_FRONTEND=noninteractive +ARG GOPASS_VERSION=v1.15.5 ARG PACKAGE=github.com/docker/docker-credential-helpers @@ -68,7 +69,12 @@ RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-10-dev libsecret-1-dev p FROM base AS test ARG DEBIAN_FRONTEND +ARG GOPASS_VERSION RUN xx-apt-get install -y dbus-x11 gnome-keyring gpg-agent gpgconf libsecret-1-dev pass +RUN --mount=type=bind,target=. \ + --mount=type=cache,target=/root/.cache \ + --mount=type=cache,target=/go/pkg/mod \ + go install github.com/gopasspw/gopass@${GOPASS_VERSION} RUN --mount=type=bind,target=. \ --mount=type=cache,target=/root/.cache \ --mount=type=cache,target=/go/pkg/mod <