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
This commit is contained in:
parent
7ed3e287ea
commit
40ea47b2a1
8
Makefile
8
Makefile
@ -12,7 +12,7 @@ build: ./secret
|
|||||||
vet:
|
vet:
|
||||||
go vet ./...
|
go vet ./...
|
||||||
|
|
||||||
test:
|
test: lint vet
|
||||||
go test ./... || go test -v ./...
|
go test ./... || go test -v ./...
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
@ -21,9 +21,6 @@ fmt:
|
|||||||
lint:
|
lint:
|
||||||
golangci-lint run --timeout 5m
|
golangci-lint run --timeout 5m
|
||||||
|
|
||||||
# Check all code quality (build + vet + lint + unit tests)
|
|
||||||
check: ./secret vet lint test
|
|
||||||
|
|
||||||
# Build Docker container
|
# Build Docker container
|
||||||
docker:
|
docker:
|
||||||
docker build -t sneak/secret .
|
docker build -t sneak/secret .
|
||||||
@ -35,3 +32,6 @@ docker-run:
|
|||||||
# Clean build artifacts
|
# Clean build artifacts
|
||||||
clean:
|
clean:
|
||||||
rm -f ./secret
|
rm -f ./secret
|
||||||
|
|
||||||
|
install: ./secret
|
||||||
|
cp ./secret $(HOME)/bin/secret
|
||||||
|
@ -4,9 +4,8 @@
|
|||||||
package secret
|
package secret
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"filippo.io/age"
|
"filippo.io/age"
|
||||||
|
"github.com/awnumar/memguard"
|
||||||
"github.com/spf13/afero"
|
"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) {
|
func CreateKeychainUnlocker(fs afero.Fs, stateDir string) (*KeychainUnlocker, error) {
|
||||||
panic("keychain unlockers are only supported on macOS")
|
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")
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user