2018-09-18 03:03:00 +00:00
|
|
|
// +build !enterprise
|
|
|
|
|
|
|
|
package vault
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"path"
|
|
|
|
|
|
|
|
"github.com/hashicorp/vault/helper/namespace"
|
2019-04-12 21:54:35 +00:00
|
|
|
"github.com/hashicorp/vault/sdk/logical"
|
2018-09-18 03:03:00 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func addPathCheckers(*Core, *MountEntry, logical.Backend, string) {}
|
|
|
|
func removePathCheckers(*Core, *MountEntry, string) {}
|
|
|
|
func addAuditPathChecker(*Core, *MountEntry, *BarrierView, string) {}
|
|
|
|
func removeAuditPathChecker(*Core, *MountEntry) {}
|
|
|
|
func addFilterablePath(*Core, string) {}
|
|
|
|
func preprocessMount(*Core, *MountEntry, *BarrierView) (bool, error) { return false, nil }
|
|
|
|
func clearIgnoredPaths(context.Context, *Core, logical.Backend, string) error { return nil }
|
2019-06-17 18:11:35 +00:00
|
|
|
func addLicenseCallback(*Core, logical.Backend) {}
|
2018-09-18 03:03:00 +00:00
|
|
|
|
|
|
|
// ViewPath returns storage prefix for the view
|
|
|
|
func (e *MountEntry) ViewPath() string {
|
|
|
|
switch e.Type {
|
|
|
|
case systemMountType:
|
|
|
|
return systemBarrierPrefix
|
|
|
|
case "token":
|
|
|
|
return path.Join(systemBarrierPrefix, tokenSubPath) + "/"
|
|
|
|
}
|
|
|
|
|
|
|
|
switch e.Table {
|
|
|
|
case mountTableType:
|
|
|
|
return backendBarrierPrefix + e.UUID + "/"
|
|
|
|
case credentialTableType:
|
|
|
|
return credentialBarrierPrefix + e.UUID + "/"
|
|
|
|
case auditTableType:
|
|
|
|
return auditBarrierPrefix + e.UUID + "/"
|
|
|
|
}
|
|
|
|
|
|
|
|
panic("invalid mount entry")
|
|
|
|
}
|
|
|
|
|
|
|
|
func verifyNamespace(*Core, *namespace.Namespace, *MountEntry) error { return nil }
|
2019-10-17 17:33:00 +00:00
|
|
|
|
|
|
|
// mountEntrySysView creates a logical.SystemView from global and
|
|
|
|
// mount-specific entries; because this should be called when setting
|
|
|
|
// up a mountEntry, it doesn't check to ensure that me is not nil
|
|
|
|
func (c *Core) mountEntrySysView(entry *MountEntry) extendedSystemView {
|
|
|
|
return extendedSystemViewImpl{
|
|
|
|
dynamicSystemView{
|
|
|
|
core: c,
|
|
|
|
mountEntry: entry,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|