mirror of
https://github.com/openbao/openbao.git
synced 2026-07-16 16:57:18 +02:00
Move module to v2, move packages to internal/ (#3210)
* Move. Signed-off-by: Jonas Köhnen <jonas.koehnen@sap.com> * Update protobuf paths Signed-off-by: Jonas Köhnen <jonas.koehnen@sap.com> * Other manual fixups Signed-off-by: Jonas Köhnen <jonas.koehnen@sap.com> --------- Signed-off-by: Jonas Köhnen <jonas.koehnen@sap.com>
This commit is contained in:
@@ -141,7 +141,7 @@ bootstrap:
|
||||
done
|
||||
|
||||
static-assets-dir:
|
||||
@mkdir -p ./http/web_ui
|
||||
@mkdir -p ./internal/http/web_ui
|
||||
|
||||
install-ui-dependencies:
|
||||
@echo "--> Installing JavaScript assets"
|
||||
@@ -170,27 +170,26 @@ static-dist-dev: ember-dist-dev
|
||||
|
||||
proto: bootstrap
|
||||
@sh -c "'$(CURDIR)/scripts/protocversioncheck.sh' '$(PROTOC_VERSION)'"
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative builtin/logical/kv/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative builtin/logical/pki/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative vault/forwarding/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative helper/storagepacker/types.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative helper/forwarding/types.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative sdk/logical/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative physical/raft/types.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative helper/identity/mfa/types.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative helper/identity/types.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative sdk/plugin/pb/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative sdk/helper/pluginutil/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative sdk/database/dbplugin/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative sdk/database/dbplugin/v5/proto/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative sdk/plugin/pb/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative vault/tokens/token.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative sdk/helper/pluginutil/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative builtin/logical/pki/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/vault/tokens/token.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/vault/forwarding/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/physical/raft/types.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/builtin/logical/kv/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/builtin/logical/pki/*.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/helper/identity/mfa/types.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/helper/identity/types.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/helper/forwarding/types.proto
|
||||
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/helper/storagepacker/types.proto
|
||||
|
||||
# No additional sed expressions should be added to this list. Going forward
|
||||
# we should just use the variable names chosen by protobuf. These are left
|
||||
# here for backwards compatibility, namely for SDK compilation.
|
||||
$(SED) -i -e 's/Id/ID/' -e 's/SPDX-License-IDentifier/SPDX-License-Identifier/' vault/forwarding/request_forwarding_service.pb.go
|
||||
$(SED) -i -e 's/Idp/IDP/' -e 's/Url/URL/' -e 's/Id/ID/' -e 's/IDentity/Identity/' -e 's/EntityId/EntityID/' -e 's/Api/API/' -e 's/Qr/QR/' -e 's/Totp/TOTP/' -e 's/Mfa/MFA/' -e 's/Pingid/PingID/' -e 's/namespaceId/namespaceID/' -e 's/Ttl/TTL/' -e 's/BoundCidrs/BoundCIDRs/' -e 's/SPDX-License-IDentifier/SPDX-License-Identifier/' helper/identity/types.pb.go helper/identity/mfa/types.pb.go helper/storagepacker/types.pb.go sdk/plugin/pb/backend.pb.go sdk/logical/identity.pb.go
|
||||
$(SED) -i -e 's/Id/ID/' -e 's/SPDX-License-IDentifier/SPDX-License-Identifier/' internal/vault/forwarding/request_forwarding_service.pb.go
|
||||
$(SED) -i -e 's/Idp/IDP/' -e 's/Url/URL/' -e 's/Id/ID/' -e 's/IDentity/Identity/' -e 's/EntityId/EntityID/' -e 's/Api/API/' -e 's/Qr/QR/' -e 's/Totp/TOTP/' -e 's/Mfa/MFA/' -e 's/Pingid/PingID/' -e 's/namespaceId/namespaceID/' -e 's/Ttl/TTL/' -e 's/BoundCidrs/BoundCIDRs/' -e 's/SPDX-License-IDentifier/SPDX-License-Identifier/' internal/helper/identity/types.pb.go internal/helper/identity/mfa/types.pb.go internal/helper/storagepacker/types.pb.go sdk/plugin/pb/backend.pb.go sdk/logical/identity.pb.go
|
||||
|
||||
.PHONY: fmtcheck
|
||||
fmtcheck:
|
||||
@@ -220,22 +219,7 @@ spellcheck:
|
||||
@echo "==> Spell checking website..."
|
||||
go tool -modfile=tools/go.mod misspell -w -source=text website/content
|
||||
|
||||
mysql-database-plugin:
|
||||
@CGO_ENABLED=0 go build -o bin/mysql-database-plugin ./plugins/database/mysql/mysql-database-plugin
|
||||
|
||||
mysql-legacy-database-plugin:
|
||||
@CGO_ENABLED=0 go build -o bin/mysql-legacy-database-plugin ./plugins/database/mysql/mysql-legacy-database-plugin
|
||||
|
||||
cassandra-database-plugin:
|
||||
@CGO_ENABLED=0 go build -o bin/cassandra-database-plugin ./plugins/database/cassandra/cassandra-database-plugin
|
||||
|
||||
influxdb-database-plugin:
|
||||
@CGO_ENABLED=0 go build -o bin/influxdb-database-plugin ./plugins/database/influxdb/influxdb-database-plugin
|
||||
|
||||
postgresql-database-plugin:
|
||||
@CGO_ENABLED=0 go build -o bin/postgresql-database-plugin ./plugins/database/postgresql/postgresql-database-plugin
|
||||
|
||||
.PHONY: bin default prep test vet bootstrap fmt fmtcheck mysql-database-plugin mysql-legacy-database-plugin cassandra-database-plugin influxdb-database-plugin postgresql-database-plugin ember-dist ember-dist-dev static-dist static-dist-dev assetcheck check-openbao-in-path packages build build-ci semgrep semgrep-ci vet-godoctests ci-vet-godoctests
|
||||
.PHONY: bin default prep test vet bootstrap fmt fmtcheck ember-dist ember-dist-dev static-dist static-dist-dev assetcheck check-openbao-in-path packages build build-ci semgrep semgrep-ci vet-godoctests ci-vet-godoctests
|
||||
|
||||
.NOTPARALLEL: ember-dist ember-dist-dev
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
```release-note:breaking-change
|
||||
packaging: The Go module was moved to github.com/openbao/openbao/v2 and large portions of the codebase were moved behind an `internal/` package. As a result, packagers must update their `-ldflags` to embed version information at `github.com/openbao/openbao/v2/internal/version` instead of `github.com/openbao/openbao/version`.
|
||||
```
|
||||
@@ -1,4 +1,4 @@
|
||||
module github.com/openbao/openbao
|
||||
module github.com/openbao/openbao/v2
|
||||
|
||||
// The go version directive value isn't consulted when building our production binaries,
|
||||
// and the vault module isn't intended to be imported into other projects. As such the
|
||||
@@ -21,7 +21,7 @@ replace github.com/openbao/openbao/api/auth/userpass/v2 => ./api/auth/userpass
|
||||
|
||||
replace github.com/openbao/openbao/sdk/v2 => ./sdk
|
||||
|
||||
replace github.com/boltdb/bolt => ./helper/stubbolt
|
||||
replace github.com/boltdb/bolt => ./internal/helper/stubbolt
|
||||
|
||||
require (
|
||||
cloud.google.com/go/monitoring v1.29.0
|
||||
@@ -344,5 +344,3 @@ require (
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
|
||||
)
|
||||
|
||||
retract [v0.1.0, v1.17.0]
|
||||
|
||||
@@ -8,7 +8,7 @@ builds:
|
||||
tags:
|
||||
- ui
|
||||
ldflags:
|
||||
- -X github.com/openbao/openbao/version.fullVersion={{ .Version }} -X github.com/openbao/openbao/version.GitCommit={{ .Commit }} -X github.com/openbao/openbao/version.CommitDate={{ .Date }}
|
||||
- -X github.com/openbao/openbao/v2/internal/version.fullVersion={{ .Version }} -X github.com/openbao/openbao/v2/internal/version.GitCommit={{ .Commit }} -X github.com/openbao/openbao/v2/internal/version.CommitDate={{ .Date }}
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
mod_timestamp: "{{ .CommitTimestamp }}"
|
||||
|
||||
@@ -8,7 +8,7 @@ builds:
|
||||
tags:
|
||||
- ui
|
||||
ldflags:
|
||||
- -X github.com/openbao/openbao/version.fullVersion={{.Version}} -X github.com/openbao/openbao/version.GitCommit={{.Commit}} -X github.com/openbao/openbao/version.CommitDate={{ .Date }}
|
||||
- -X github.com/openbao/openbao/v2/internal/version.fullVersion={{.Version}} -X github.com/openbao/openbao/v2/internal/version.GitCommit={{.Commit}} -X github.com/openbao/openbao/v2/internal/version.CommitDate={{ .Date }}
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
mod_timestamp: "{{ .CommitTimestamp }}"
|
||||
|
||||
@@ -15,10 +15,10 @@ import (
|
||||
|
||||
"github.com/go-jose/go-jose/v4/jwt"
|
||||
|
||||
"github.com/openbao/openbao/helper/namespace"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/consts"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/salt"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/v2/internal/helper/namespace"
|
||||
)
|
||||
|
||||
type AuditFormatWriter interface {
|
||||
@@ -13,10 +13,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/openbao/openbao/helper/namespace"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/jsonutil"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/salt"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/v2/internal/helper/namespace"
|
||||
)
|
||||
|
||||
func TestFormatJSON_formatRequest(t *testing.T) {
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
"github.com/openbao/openbao/helper/namespace"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/salt"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/v2/internal/helper/namespace"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -16,9 +16,9 @@ import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/openbao/openbao/audit"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/salt"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/v2/internal/audit"
|
||||
)
|
||||
|
||||
func Factory(ctx context.Context, conf *audit.BackendConfig) (audit.Backend, error) {
|
||||
@@ -11,10 +11,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/openbao/openbao/audit"
|
||||
"github.com/openbao/openbao/helper/namespace"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/salt"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/v2/internal/audit"
|
||||
"github.com/openbao/openbao/v2/internal/helper/namespace"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -16,10 +16,10 @@ import (
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/hashicorp/go-secure-stdlib/parseutil"
|
||||
"github.com/openbao/openbao/audit"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/salt"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/version"
|
||||
"github.com/openbao/openbao/v2/internal/audit"
|
||||
"github.com/openbao/openbao/v2/internal/version"
|
||||
)
|
||||
|
||||
// Backend is the audit backend for the http-based audit store.
|
||||
@@ -10,10 +10,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/openbao/openbao/audit"
|
||||
"github.com/openbao/openbao/helper/namespace"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/salt"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/v2/internal/audit"
|
||||
"github.com/openbao/openbao/v2/internal/helper/namespace"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -15,9 +15,9 @@ import (
|
||||
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/hashicorp/go-secure-stdlib/parseutil"
|
||||
"github.com/openbao/openbao/audit"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/salt"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/v2/internal/audit"
|
||||
)
|
||||
|
||||
func Factory(ctx context.Context, conf *audit.BackendConfig) (audit.Backend, error) {
|
||||
@@ -12,9 +12,9 @@ import (
|
||||
"sync"
|
||||
|
||||
gsyslog "github.com/hashicorp/go-syslog"
|
||||
"github.com/openbao/openbao/audit"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/salt"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/v2/internal/audit"
|
||||
)
|
||||
|
||||
func Factory(ctx context.Context, conf *audit.BackendConfig) (audit.Backend, error) {
|
||||
+1
-1
@@ -8,8 +8,8 @@ import (
|
||||
|
||||
hclog "github.com/hashicorp/go-hclog"
|
||||
"github.com/openbao/openbao/api/v2"
|
||||
"github.com/openbao/openbao/builtin/credential/approle"
|
||||
"github.com/openbao/openbao/sdk/v2/plugin"
|
||||
"github.com/openbao/openbao/v2/internal/builtin/credential/approle"
|
||||
)
|
||||
|
||||
func main() {
|
||||
+1
-1
@@ -14,7 +14,6 @@ import (
|
||||
"github.com/hashicorp/go-secure-stdlib/parseutil"
|
||||
"github.com/hashicorp/go-secure-stdlib/strutil"
|
||||
uuid "github.com/hashicorp/go-uuid"
|
||||
"github.com/openbao/openbao/helper/parseip"
|
||||
"github.com/openbao/openbao/sdk/v2/framework"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/cidrutil"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/consts"
|
||||
@@ -22,6 +21,7 @@ import (
|
||||
"github.com/openbao/openbao/sdk/v2/helper/policyutil"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/tokenutil"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/v2/internal/helper/parseip"
|
||||
)
|
||||
|
||||
// roleStorageEntry stores all the options that are set on an role
|
||||
+1
-1
@@ -14,10 +14,10 @@ import (
|
||||
"time"
|
||||
|
||||
uuid "github.com/hashicorp/go-uuid"
|
||||
"github.com/openbao/openbao/helper/parseip"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/cidrutil"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/locksutil"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/v2/internal/helper/parseip"
|
||||
)
|
||||
|
||||
// secretIDStorageEntry represents the information stored in storage
|
||||
+5
-5
@@ -33,17 +33,17 @@ import (
|
||||
cleanhttp "github.com/hashicorp/go-cleanhttp"
|
||||
log "github.com/hashicorp/go-hclog"
|
||||
"github.com/openbao/openbao/api/v2"
|
||||
vaulthttp "github.com/openbao/openbao/http"
|
||||
vaulthttp "github.com/openbao/openbao/v2/internal/http"
|
||||
|
||||
"github.com/go-viper/mapstructure/v2"
|
||||
"github.com/openbao/openbao/builtin/logical/pki"
|
||||
"github.com/openbao/openbao/helper/namespace"
|
||||
logicaltest "github.com/openbao/openbao/helper/testhelpers/logical"
|
||||
"github.com/openbao/openbao/sdk/v2/framework"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/certutil"
|
||||
"github.com/openbao/openbao/sdk/v2/helper/tokenutil"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/vault"
|
||||
"github.com/openbao/openbao/v2/internal/builtin/logical/pki"
|
||||
"github.com/openbao/openbao/v2/internal/helper/namespace"
|
||||
logicaltest "github.com/openbao/openbao/v2/internal/helper/testhelpers/logical"
|
||||
"github.com/openbao/openbao/v2/internal/vault"
|
||||
)
|
||||
|
||||
type testCerts struct {
|
||||
+1
-1
@@ -8,8 +8,8 @@ import (
|
||||
|
||||
hclog "github.com/hashicorp/go-hclog"
|
||||
"github.com/openbao/openbao/api/v2"
|
||||
"github.com/openbao/openbao/builtin/credential/cert"
|
||||
"github.com/openbao/openbao/sdk/v2/plugin"
|
||||
"github.com/openbao/openbao/v2/internal/builtin/credential/cert"
|
||||
)
|
||||
|
||||
func main() {
|
||||
+1
-1
@@ -12,9 +12,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/openbao/openbao/helper/testhelpers/corehelpers"
|
||||
"github.com/openbao/openbao/sdk/v2/framework"
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
"github.com/openbao/openbao/v2/internal/helper/testhelpers/corehelpers"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/tsaarni/certyaml"
|
||||
)
|
||||
+1
-1
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
"golang.org/x/crypto/ocsp"
|
||||
|
||||
logicaltest "github.com/openbao/openbao/helper/testhelpers/logical"
|
||||
logicaltest "github.com/openbao/openbao/v2/internal/helper/testhelpers/logical"
|
||||
|
||||
"github.com/openbao/openbao/sdk/v2/logical"
|
||||
)
|
||||
+1
-1
@@ -8,8 +8,8 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/openbao/openbao/api/v2"
|
||||
jwtauth "github.com/openbao/openbao/builtin/credential/jwt"
|
||||
"github.com/openbao/openbao/sdk/v2/plugin"
|
||||
jwtauth "github.com/openbao/openbao/v2/internal/builtin/credential/jwt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
+1
-1
@@ -8,8 +8,8 @@ import (
|
||||
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/openbao/openbao/api/v2"
|
||||
kerberosauth "github.com/openbao/openbao/builtin/credential/kerberos"
|
||||
"github.com/openbao/openbao/sdk/v2/plugin"
|
||||
kerberosauth "github.com/openbao/openbao/v2/internal/builtin/credential/kerberos"
|
||||
)
|
||||
|
||||
func main() {
|
||||
+1
-1
@@ -9,8 +9,8 @@ import (
|
||||
log "github.com/hashicorp/go-hclog"
|
||||
|
||||
"github.com/openbao/openbao/api/v2"
|
||||
kubeauth "github.com/openbao/openbao/builtin/credential/kubernetes"
|
||||
"github.com/openbao/openbao/sdk/v2/plugin"
|
||||
kubeauth "github.com/openbao/openbao/v2/internal/builtin/credential/kubernetes"
|
||||
)
|
||||
|
||||
func main() {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user