mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
53 lines
1001 B
Go
53 lines
1001 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",
|
|
"groups/*",
|
|
},
|
|
|
|
Unauthenticated: []string{
|
|
"login",
|
|
},
|
|
},
|
|
|
|
Paths: append([]*framework.Path{
|
|
pathLogin(&b),
|
|
pathConfig(&b),
|
|
pathGroups(&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".
|
|
`
|