open-vault/builtin/credential/cert/backend.go

55 lines
1.1 KiB
Go
Raw Normal View History

package cert
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{
Help: backendHelp,
PathsSpecial: &logical.Paths{
2015-04-24 17:31:57 +00:00
Root: []string{
"certs/*",
"crlsets/*",
2015-04-24 17:31:57 +00:00
},
Unauthenticated: []string{
"login",
},
},
2015-04-24 17:31:57 +00:00
Paths: append([]*framework.Path{
pathLogin(&b),
2015-04-24 17:31:57 +00:00
pathCerts(&b),
pathCRLs(&b),
2015-04-24 17:31:57 +00:00
}),
AuthRenew: b.pathLoginRenew,
}
return b.Backend
}
type backend struct {
*framework.Backend
2015-04-24 17:31:57 +00:00
MapCertId *framework.PathMap
}
const backendHelp = `
2015-04-24 17:31:57 +00:00
The "cert" credential provider allows authentication using
TLS client certificates. A client connects to Vault and uses
the "login" endpoint to generate a client token.
Trusted certificates are configured using the "certs/" endpoint
by a user with root access. A certificate authority can be trusted,
which permits all keys signed by it. Alternatively, self-signed
certificates can be trusted avoiding the need for a CA.
`