From 40ea47b2a1dc6552c47cc6c823b8d052bbd88344 Mon Sep 17 00:00:00 2001 From: sneak Date: Tue, 22 Jul 2025 12:51:02 +0200 Subject: [PATCH] Add missing changes from feature branch - Update Makefile to run lint and vet before tests - Add install target to Makefile - Fix keychainunlocker_stub.go for non-Darwin platforms --- Makefile | 8 ++++---- internal/secret/keychainunlocker_stub.go | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 6c55c0e..56037f3 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ build: ./secret vet: go vet ./... -test: +test: lint vet go test ./... || go test -v ./... fmt: @@ -21,9 +21,6 @@ fmt: lint: golangci-lint run --timeout 5m -# Check all code quality (build + vet + lint + unit tests) -check: ./secret vet lint test - # Build Docker container docker: docker build -t sneak/secret . @@ -35,3 +32,6 @@ docker-run: # Clean build artifacts clean: rm -f ./secret + +install: ./secret + cp ./secret $(HOME)/bin/secret diff --git a/internal/secret/keychainunlocker_stub.go b/internal/secret/keychainunlocker_stub.go index 512baa0..e6c6fb7 100644 --- a/internal/secret/keychainunlocker_stub.go +++ b/internal/secret/keychainunlocker_stub.go @@ -4,9 +4,8 @@ package secret import ( - "fmt" - "filippo.io/age" + "github.com/awnumar/memguard" "github.com/spf13/afero" ) @@ -67,3 +66,8 @@ func NewKeychainUnlocker(fs afero.Fs, directory string, metadata UnlockerMetadat func CreateKeychainUnlocker(fs afero.Fs, stateDir string) (*KeychainUnlocker, error) { panic("keychain unlockers are only supported on macOS") } + +// getLongTermPrivateKey panics on non-Darwin platforms +func getLongTermPrivateKey(fs afero.Fs, vault VaultInterface) (*memguard.LockedBuffer, error) { + panic("keychain unlockers are only supported on macOS") +}