mirror of
https://github.com/hashicorp/vault.git
synced 2025-09-03 13:01:12 +02:00
Can specify 128 bits (defaults to 256) and control whether or not plaintext is returned (default true). Unit tests for all of the new functionality.
42 lines
712 B
Go
42 lines
712 B
Go
package transit
|
|
|
|
import (
|
|
"github.com/hashicorp/vault/logical"
|
|
"github.com/hashicorp/vault/logical/framework"
|
|
)
|
|
|
|
func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
|
|
return Backend().Setup(conf)
|
|
}
|
|
|
|
func Backend() *framework.Backend {
|
|
var b backend
|
|
b.Backend = &framework.Backend{
|
|
PathsSpecial: &logical.Paths{
|
|
Root: []string{
|
|
"keys/*",
|
|
},
|
|
},
|
|
|
|
Paths: []*framework.Path{
|
|
// Rotate/Config needs to come before Keys
|
|
// as the handler is greedy
|
|
pathConfig(),
|
|
pathRotate(),
|
|
pathRewrap(),
|
|
pathKeys(),
|
|
pathEncrypt(),
|
|
pathDecrypt(),
|
|
pathDatakey(),
|
|
},
|
|
|
|
Secrets: []*framework.Secret{},
|
|
}
|
|
|
|
return b.Backend
|
|
}
|
|
|
|
type backend struct {
|
|
*framework.Backend
|
|
}
|