2022-09-06 18:11:04 +00:00
|
|
|
package internal
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/hashicorp/vault/helper/namespace"
|
2023-01-06 22:06:54 +00:00
|
|
|
"github.com/hashicorp/vault/physical/raft"
|
2022-09-06 18:11:04 +00:00
|
|
|
"github.com/hashicorp/vault/sdk/helper/consts"
|
|
|
|
"github.com/hashicorp/vault/sdk/logical"
|
|
|
|
"github.com/hashicorp/vault/vault"
|
|
|
|
)
|
|
|
|
|
|
|
|
type WrappedCoreNodeStatus interface {
|
|
|
|
GetSealStatus(ctx context.Context) (*vault.SealStatusResponse, error)
|
|
|
|
ReplicationState() consts.ReplicationState
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ WrappedCoreNodeStatus = &vault.Core{}
|
|
|
|
|
|
|
|
type WrappedCoreStandbyStates interface {
|
|
|
|
StandbyStates() (bool, bool)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ WrappedCoreStandbyStates = &vault.Core{}
|
|
|
|
|
|
|
|
type WrappedCoreHCPToken interface {
|
|
|
|
Sealed() bool
|
|
|
|
CreateToken(context.Context, *logical.TokenEntry) error
|
|
|
|
WrappedCoreStandbyStates
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ WrappedCoreHCPToken = &vault.Core{}
|
|
|
|
|
2023-01-06 22:06:54 +00:00
|
|
|
type WrappedCoreMeta interface {
|
2022-09-06 18:11:04 +00:00
|
|
|
NamespaceByID(ctx context.Context, nsID string) (*namespace.Namespace, error)
|
|
|
|
ListNamespaces(includePath bool) []*namespace.Namespace
|
|
|
|
ListMounts() ([]*vault.MountEntry, error)
|
|
|
|
ListAuths() ([]*vault.MountEntry, error)
|
2023-01-06 22:06:54 +00:00
|
|
|
HAEnabled() bool
|
|
|
|
HAStateWithLock() consts.HAState
|
|
|
|
GetHAPeerNodesCached() []vault.PeerNode
|
|
|
|
GetRaftConfiguration(ctx context.Context) (*raft.RaftConfigurationResponse, error)
|
|
|
|
GetRaftAutopilotState(ctx context.Context) (*raft.AutopilotState, error)
|
|
|
|
StorageType() string
|
|
|
|
ClusterID() string
|
2022-09-06 18:11:04 +00:00
|
|
|
}
|
|
|
|
|
2023-01-06 22:06:54 +00:00
|
|
|
var _ WrappedCoreMeta = &vault.Core{}
|
2022-09-06 18:11:04 +00:00
|
|
|
|
|
|
|
type WrappedCoreHCPLinkStatus interface {
|
|
|
|
WrappedCoreStandbyStates
|
|
|
|
SetHCPLinkStatus(status, name string)
|
|
|
|
GetHCPLinkStatus() (string, string)
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ WrappedCoreHCPLinkStatus = &vault.Core{}
|