open-vault/vendor/github.com/hashicorp/vault-plugin-auth-centrify/backend.go
2019-04-15 14:59:52 -04:00

53 lines
898 B
Go

package centrify
import (
"context"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/logical"
)
func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, error) {
b := Backend()
if err := b.Setup(ctx, conf); err != nil {
return nil, err
}
return b, nil
}
func Backend() *backend {
var b backend
b.Backend = &framework.Backend{
Help: backendHelp,
PathsSpecial: &logical.Paths{
Unauthenticated: []string{
"login",
},
SealWrapStorage: []string{
"config",
},
},
Paths: []*framework.Path{
pathConfig(&b),
pathLogin(&b),
},
BackendType: logical.TypeCredential,
}
return &b
}
type backend struct {
*framework.Backend
}
const backendHelp = `
The "centrify" credential provider allows authentication using
a combination of a username and password via the Centrify Identity
Services Platform.
`