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

53 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(map[string]string) (logical.Backend, error) {
return Backend(), nil
}
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/*",
},
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),
}),
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.
`