51 lines
966 B
Go
51 lines
966 B
Go
|
package ldap
|
||
|
|
||
|
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{
|
||
|
Root: []string{
|
||
|
"config",
|
||
|
},
|
||
|
|
||
|
Unauthenticated: []string{
|
||
|
"login",
|
||
|
},
|
||
|
},
|
||
|
|
||
|
Paths: append([]*framework.Path{
|
||
|
pathLogin(&b),
|
||
|
pathConfig(&b),
|
||
|
}),
|
||
|
|
||
|
// AuthRenew: b.pathLoginRenew,
|
||
|
}
|
||
|
|
||
|
return b.Backend
|
||
|
}
|
||
|
|
||
|
type backend struct {
|
||
|
*framework.Backend
|
||
|
}
|
||
|
|
||
|
const backendHelp = `
|
||
|
The "ldap" credential provider allows authentication querying
|
||
|
a LDAP server, checking username and password, and associating groups
|
||
|
to set of policies.
|
||
|
|
||
|
Configuration of the server is done through the "config" and "groups"
|
||
|
endpoints by a user with root access. Authentication is then done
|
||
|
by suppying the two fields for "login".
|
||
|
`
|