mirror of https://github.com/spf13/viper.git
format cleanup
This commit is contained in:
parent
33dd3593c9
commit
5197566d20
|
@ -19,8 +19,8 @@ package vault
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/xordataexchange/crypt/backend"
|
"github.com/xordataexchange/crypt/backend"
|
||||||
|
@ -70,7 +70,7 @@ func (c *Client) acquireToken(role string, secret string) (string, error) {
|
||||||
// this can be called before operations to ensure token is currentfg
|
// this can be called before operations to ensure token is currentfg
|
||||||
func (c *Client) renewToken() (string, error) {
|
func (c *Client) renewToken() (string, error) {
|
||||||
if c.secret_expires {
|
if c.secret_expires {
|
||||||
if ((c.secret_ttl.Seconds() + c.secret_acq_at > float64(time.Now().Unix())) && c.secret_ttl != 0) {
|
if (c.secret_ttl.Seconds()+c.secret_acq_at > float64(time.Now().Unix())) && c.secret_ttl != 0 {
|
||||||
return c.acquireToken(os.Getenv("VAULT_ROLE_ID"), os.Getenv("VAULT_SECRET_ID"))
|
return c.acquireToken(os.Getenv("VAULT_ROLE_ID"), os.Getenv("VAULT_SECRET_ID"))
|
||||||
} else {
|
} else {
|
||||||
return "", nil
|
return "", nil
|
||||||
|
|
Loading…
Reference in New Issue