Skip to content

Commit 88a1afc

Browse files
committed
Revert "docs: add threat model and policy demos"
This reverts commit d9d62c1.
1 parent d9d62c1 commit 88a1afc

File tree

6 files changed

+123
-92
lines changed

6 files changed

+123
-92
lines changed

cmd/migrate/main.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ package main
33
import (
44
"flag"
55
"log"
6-
"os"
76

87
"github.com/golang-migrate/migrate/v4"
98
_ "github.com/golang-migrate/migrate/v4/database/postgres"
109
_ "github.com/golang-migrate/migrate/v4/source/file"
11-
10+
1211
"github.com/EvalOps/keep/pkg/secrets"
1312
)
1413

@@ -24,7 +23,7 @@ func main() {
2423

2524
// Initialize secret management
2625
secretHelper := secrets.NewHelperFromEnv()
27-
26+
2827
// Load database configuration
2928
dbConfig := secretHelper.LoadDatabaseConfig()
3029
databaseURL := secretHelper.BuildDSN(dbConfig)
@@ -40,24 +39,24 @@ func main() {
4039
switch {
4140
case *showVersion:
4241
showCurrentVersion(m)
43-
42+
4443
case *force >= 0:
4544
forceVersion(m, *force)
46-
45+
4746
case *direction == "up":
4847
if *steps > 0 {
4948
migrateSteps(m, *steps)
5049
} else {
5150
migrateUp(m)
5251
}
53-
52+
5453
case *direction == "down":
5554
if *steps > 0 {
5655
migrateSteps(m, -*steps)
5756
} else {
5857
migrateDown(m)
5958
}
60-
59+
6160
default:
6261
log.Fatalf("Invalid direction: %s (use 'up' or 'down')", *direction)
6362
}
@@ -68,7 +67,7 @@ func showCurrentVersion(m *migrate.Migrate) {
6867
if err != nil {
6968
log.Fatalf("Failed to get migration version: %v", err)
7069
}
71-
70+
7271
log.Printf("Current migration version: %d", version)
7372
if dirty {
7473
log.Printf("Migration state is dirty (incomplete migration)")
@@ -117,7 +116,7 @@ func migrateSteps(m *migrate.Migrate, steps int) {
117116
} else {
118117
log.Printf("Rolling back %d migration steps...", -steps)
119118
}
120-
119+
121120
if err := m.Steps(steps); err != nil {
122121
if err == migrate.ErrNoChange {
123122
log.Println("No migration changes to apply")

cmd/secrets/main.go

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ import (
1313

1414
func main() {
1515
var (
16-
action = flag.String("action", "get", "Action to perform: get, set, list, migrate")
17-
secretType = flag.String("type", "", "Secret manager type: env, ssm, vault, azure")
18-
region = flag.String("region", "", "AWS region for SSM")
19-
prefix = flag.String("prefix", "", "Secret prefix/namespace")
20-
key = flag.String("key", "", "Secret key")
21-
value = flag.String("value", "", "Secret value (for set action)")
22-
format = flag.String("format", "text", "Output format: text, json")
23-
vaultAddr = flag.String("vault-addr", "", "Vault server address")
24-
vaultPath = flag.String("vault-path", "", "Vault secret path")
25-
azureURL = flag.String("azure-url", "", "Azure Key Vault URL")
16+
action = flag.String("action", "get", "Action to perform: get, set, list, migrate")
17+
secretType = flag.String("type", "", "Secret manager type: env, ssm, vault, azure")
18+
region = flag.String("region", "", "AWS region for SSM")
19+
prefix = flag.String("prefix", "", "Secret prefix/namespace")
20+
key = flag.String("key", "", "Secret key")
21+
value = flag.String("value", "", "Secret value (for set action)")
22+
format = flag.String("format", "text", "Output format: text, json")
23+
vaultAddr = flag.String("vault-addr", "", "Vault server address")
24+
vaultPath = flag.String("vault-path", "", "Vault secret path")
25+
azureURL = flag.String("azure-url", "", "Azure Key Vault URL")
2626
)
2727
flag.Parse()
2828

@@ -195,8 +195,7 @@ func handleInit(secretType string) {
195195
}
196196

197197
func printSSMSetup() {
198-
fmt.Println(`
199-
AWS Systems Manager Parameter Store Setup:
198+
fmt.Print(`AWS Systems Manager Parameter Store Setup:
200199
201200
1. Install AWS CLI and configure credentials:
202201
aws configure
@@ -219,8 +218,7 @@ AWS Systems Manager Parameter Store Setup:
219218
}
220219

221220
func printVaultSetup() {
222-
fmt.Println(`
223-
HashiCorp Vault Setup:
221+
fmt.Print(`HashiCorp Vault Setup:
224222
225223
1. Start Vault server (development mode):
226224
vault server -dev
@@ -245,8 +243,7 @@ HashiCorp Vault Setup:
245243
}
246244

247245
func printAzureSetup() {
248-
fmt.Println(`
249-
Azure Key Vault Setup:
246+
fmt.Print(`Azure Key Vault Setup:
250247
251248
1. Create Key Vault:
252249
az keyvault create --name keep-secrets --resource-group keep-rg --location eastus

go.mod

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ require (
1111
github.com/aws/aws-sdk-go-v2 v1.39.3
1212
github.com/aws/aws-sdk-go-v2/config v1.31.13
1313
github.com/aws/aws-sdk-go-v2/service/ssm v1.66.0
14+
github.com/cenkalti/backoff/v4 v4.3.0
1415
github.com/go-chi/chi/v5 v5.2.3
15-
github.com/golang-migrate/migrate/v4 v4.19.0
16+
github.com/golang-migrate/migrate/v4 v4.17.1
1617
github.com/hashicorp/vault/api v1.22.0
1718
github.com/jackc/pgx/v5 v5.7.6
1819
github.com/prometheus/client_golang v1.23.2
1920
github.com/rs/zerolog v1.34.0
2021
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0
2122
go.opentelemetry.io/otel v1.38.0
23+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.38.0
24+
go.opentelemetry.io/otel/sdk v1.38.0
25+
go.opentelemetry.io/otel/trace v1.38.0
2226
tailscale.com v1.68.0
2327
)
2428

@@ -42,15 +46,18 @@ require (
4246
github.com/aws/smithy-go v1.23.1 // indirect
4347
github.com/beorn7/perks v1.0.1 // indirect
4448
github.com/bits-and-blooms/bitset v1.13.0 // indirect
45-
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
49+
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
4650
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4751
github.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 // indirect
4852
github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa // indirect
4953
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e // indirect
54+
github.com/felixge/httpsnoop v1.0.4 // indirect
5055
github.com/fxamacker/cbor/v2 v2.5.0 // indirect
5156
github.com/gaissmai/bart v0.4.1 // indirect
5257
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
5358
github.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0 // indirect
59+
github.com/go-logr/logr v1.4.3 // indirect
60+
github.com/go-logr/stdr v1.2.2 // indirect
5461
github.com/go-ole/go-ole v1.3.0 // indirect
5562
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect
5663
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
@@ -61,6 +68,7 @@ require (
6168
github.com/google/uuid v1.6.0 // indirect
6269
github.com/gorilla/csrf v1.7.2 // indirect
6370
github.com/gorilla/securecookie v1.1.2 // indirect
71+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
6472
github.com/hashicorp/errwrap v1.1.0 // indirect
6573
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
6674
github.com/hashicorp/go-multierror v1.1.1 // indirect
@@ -115,6 +123,11 @@ require (
115123
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
116124
github.com/vishvananda/netns v0.0.4 // indirect
117125
github.com/x448/float16 v0.8.4 // indirect
126+
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
127+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 // indirect
128+
go.opentelemetry.io/otel/metric v1.38.0 // indirect
129+
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
130+
go.uber.org/atomic v1.7.0 // indirect
118131
go.yaml.in/yaml/v2 v2.4.2 // indirect
119132
go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect
120133
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
@@ -130,6 +143,9 @@ require (
130143
golang.org/x/tools v0.35.0 // indirect
131144
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
132145
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
146+
google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 // indirect
147+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect
148+
google.golang.org/grpc v1.75.0 // indirect
133149
google.golang.org/protobuf v1.36.8 // indirect
134150
gvisor.dev/gvisor v0.0.0-20240306221502-ee1e1f6070e3 // indirect
135151
nhooyr.io/websocket v1.8.10 // indirect

0 commit comments

Comments
 (0)