From 01e21711fd2ab8b22c7809d9d3d3f599bb5375c0 Mon Sep 17 00:00:00 2001 From: Alexander Scheel Date: Tue, 5 Mar 2024 12:06:44 -0500 Subject: [PATCH] Move shamir's into public sdk/ space, fix titles This moves shamir's code into the public sdk/ space, encouraging the reuse of this component by other external libraries. Also fixes the titles of API and SDK READMEs. Signed-off-by: Alexander Scheel --- api/README.md | 11 ++++++----- changelog/181.txt | 3 +++ sdk/README.md | 6 +++--- {shamir => sdk/helper/shamir}/shamir.go | 0 {shamir => sdk/helper/shamir}/shamir_test.go | 0 vault/core.go | 2 +- vault/generate_root.go | 2 +- vault/init.go | 2 +- vault/rekey.go | 2 +- 9 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 changelog/181.txt rename {shamir => sdk/helper/shamir}/shamir.go (100%) rename {shamir => sdk/helper/shamir}/shamir_test.go (100%) diff --git a/api/README.md b/api/README.md index 5f2eeca1c1..069960df2e 100644 --- a/api/README.md +++ b/api/README.md @@ -1,9 +1,10 @@ -Vault API +OpenBao API ================= -This provides the `github.com/openbao/openbao/api` package which contains code useful for interacting with a Vault server. +This provides the `github.com/openbao/openbao/api` package which contains code useful for interacting with an OpenBao or Vault server. -For examples of how to use this module, see the [vault-examples](https://github.com/hashicorp/vault-examples) repo. -For a step-by-step walkthrough on using these client libraries, see the [developer quickstart](https://www.vaultproject.io/docs/get-started/developer-qs). +For examples of how to use this module, see the test suite contained +within OpenBao or [vault-examples](https://github.com/hashicorp/vault-examples) +repo from HashiCorp. -[![GoDoc](https://godoc.org/github.com/openbao/openbao/api?status.png)](https://godoc.org/github.com/openbao/openbao/api) \ No newline at end of file +[![GoDoc](https://godoc.org/github.com/openbao/openbao/api?status.png)](https://godoc.org/github.com/openbao/openbao/api) diff --git a/changelog/181.txt b/changelog/181.txt new file mode 100644 index 0000000000..ad52ddd7dd --- /dev/null +++ b/changelog/181.txt @@ -0,0 +1,3 @@ +```release-note:improvement +sdk/helper/shamir: move Shamir's code into public SDK namespace to encourage external reuse +``` diff --git a/sdk/README.md b/sdk/README.md index d106210535..0595ff6989 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -1,12 +1,12 @@ -Vault SDK libs +OpenBao SDK libs ================= This package provides the `sdk` package which contains code useful for -developing Vault plugins. +developing OpenBao plugins. Although we try not to break functionality, we reserve the right to reorganize the code at will and may occasionally cause breaks if they are warranted. As such we expect the tag of this module will stay less than `v1.0.0`. For any major changes we will try to give advance notice in the CHANGES section -of Vault's CHANGELOG.md. +of OpenBao's CHANGELOG.md. diff --git a/shamir/shamir.go b/sdk/helper/shamir/shamir.go similarity index 100% rename from shamir/shamir.go rename to sdk/helper/shamir/shamir.go diff --git a/shamir/shamir_test.go b/sdk/helper/shamir/shamir_test.go similarity index 100% rename from shamir/shamir_test.go rename to sdk/helper/shamir/shamir_test.go diff --git a/vault/core.go b/vault/core.go index 9203e773df..52daae3f5f 100644 --- a/vault/core.go +++ b/vault/core.go @@ -53,10 +53,10 @@ import ( "github.com/openbao/openbao/sdk/helper/jsonutil" "github.com/openbao/openbao/sdk/helper/logging" "github.com/openbao/openbao/sdk/helper/pathmanager" + "github.com/openbao/openbao/sdk/helper/shamir" "github.com/openbao/openbao/sdk/logical" "github.com/openbao/openbao/sdk/physical" sr "github.com/openbao/openbao/serviceregistration" - "github.com/openbao/openbao/shamir" "github.com/openbao/openbao/vault/cluster" "github.com/openbao/openbao/vault/eventbus" "github.com/openbao/openbao/vault/quotas" diff --git a/vault/generate_root.go b/vault/generate_root.go index a72804b477..8785361ed6 100644 --- a/vault/generate_root.go +++ b/vault/generate_root.go @@ -14,7 +14,7 @@ import ( "github.com/openbao/openbao/helper/pgpkeys" "github.com/openbao/openbao/sdk/helper/consts" "github.com/openbao/openbao/sdk/helper/roottoken" - "github.com/openbao/openbao/shamir" + "github.com/openbao/openbao/sdk/helper/shamir" ) const coreDROperationTokenPath = "core/dr-operation-token" diff --git a/vault/init.go b/vault/init.go index 088ab5a787..58ab4e6507 100644 --- a/vault/init.go +++ b/vault/init.go @@ -18,7 +18,7 @@ import ( "github.com/openbao/openbao/helper/namespace" "github.com/openbao/openbao/helper/pgpkeys" - "github.com/openbao/openbao/shamir" + "github.com/openbao/openbao/sdk/helper/shamir" ) // InitParams keeps the init function from being littered with too many diff --git a/vault/rekey.go b/vault/rekey.go index 1fbd074e9f..d9058e7506 100644 --- a/vault/rekey.go +++ b/vault/rekey.go @@ -18,9 +18,9 @@ import ( "github.com/openbao/openbao/helper/pgpkeys" "github.com/openbao/openbao/sdk/helper/consts" "github.com/openbao/openbao/sdk/helper/jsonutil" + "github.com/openbao/openbao/sdk/helper/shamir" "github.com/openbao/openbao/sdk/logical" "github.com/openbao/openbao/sdk/physical" - "github.com/openbao/openbao/shamir" "github.com/openbao/openbao/vault/seal" )