More porting from rep (#2388)

* More porting from rep

* Address review feedback
This commit is contained in:
Jeff Mitchell
2017-02-16 16:29:30 -05:00
committed by GitHub
parent 98c7bd6c03
commit 8acbdefdf2
29 changed files with 405 additions and 67 deletions

View File

@@ -33,6 +33,8 @@ func Backend() *framework.Backend {
},
Clean: b.ResetSession,
Invalidate: b.invalidate,
}
return b.Backend
@@ -97,6 +99,13 @@ func (b *backend) ResetSession() {
b.session = nil
}
func (b *backend) invalidate(key string) {
switch key {
case "config/connection":
b.ResetSession()
}
}
// LeaseConfig returns the lease configuration
func (b *backend) LeaseConfig(s logical.Storage) (*configLease, error) {
entry, err := s.Get("config/lease")