Skip to content

Commit

Permalink
update sdk usage
Browse files Browse the repository at this point in the history
Signed-off-by: Volkan Özçelik <[email protected]>
  • Loading branch information
v0lkan committed Dec 3, 2024
1 parent 55fbecb commit d9d3dce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 1 addition & 6 deletions app/demo/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ func main() {
defer api.Close() // Close the connection when done

path := "/tenants/demo/db/creds"
version := 0

// Create a Secret
err := api.PutSecret(path, map[string]string{
Expand All @@ -27,12 +26,8 @@ func main() {
return
}

// TODO: maybe GetSecret should not have a `version` parameter
// and an override should be used instead for versioned secret gets.
// as in api.GetSecretVersioned(path, version)

// Read the Secret
secret, err := api.GetSecret(path, version)
secret, err := api.GetSecret(path)
if err != nil {
fmt.Println("Error reading secret:", err.Error())
return
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/mattn/go-sqlite3 v1.14.24
github.com/spf13/cobra v1.8.1
github.com/spiffe/go-spiffe/v2 v2.4.0
github.com/spiffe/spike-sdk-go v0.1.13
github.com/spiffe/spike-sdk-go v0.1.14
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.26.0
)
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ github.com/spiffe/spike-sdk-go v0.1.12 h1:5fS31yLdIMEtaTk0fpy/8msVFeS/vZTkQaPKyG
github.com/spiffe/spike-sdk-go v0.1.12/go.mod h1:WIserWbShAkDVoj+GYdcXKFmKp2IBIsZHKKDcStHrHw=
github.com/spiffe/spike-sdk-go v0.1.13 h1:vQIguhkmztUSM55/xYxXPed5laoF1Q4sazA1GRg66pw=
github.com/spiffe/spike-sdk-go v0.1.13/go.mod h1:WIserWbShAkDVoj+GYdcXKFmKp2IBIsZHKKDcStHrHw=
github.com/spiffe/spike-sdk-go v0.1.14 h1:RUFDlNTuXdDMBWP0g+yDgjM6O45e3qRfWu1PUU96zLg=
github.com/spiffe/spike-sdk-go v0.1.14/go.mod h1:WIserWbShAkDVoj+GYdcXKFmKp2IBIsZHKKDcStHrHw=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/zeebo/errs v1.3.0 h1:hmiaKqgYZzcVgRL1Vkc1Mn2914BbzB0IBxs+ebeutGs=
Expand Down

0 comments on commit d9d3dce

Please sign in to comment.