Github backend: enable auth renewals

This commit is contained in:
vishalnayak
2015-10-02 13:33:19 -04:00
parent df90e664ad
commit bf017d28d1
5 changed files with 54 additions and 17 deletions

View File

@@ -132,6 +132,20 @@ func (b *backend) pathLogin(
"org": *org.Login,
},
DisplayName: *user.Login,
LeaseOptions: logical.LeaseOptions{
TTL: config.TTL,
GracePeriod: config.TTL / 10,
Renewable: config.TTL > 0,
},
},
}, nil
}
func (b *backend) pathLoginRenew(
req *logical.Request, d *framework.FieldData) (*logical.Response, error) {
config, err := b.Config(req.Storage)
if err != nil {
return nil, err
}
return framework.LeaseExtend(config.MaxTTL, 0, false)(req, d)
}