Made default_lease_ttl and max_lease_ttl as int64 and fixed tests
This commit is contained in:
parent
0bdeea3a33
commit
2933c5ce08
|
@ -661,8 +661,8 @@ func (b *SystemBackend) handleMountTable(
|
|||
"type": entry.Type,
|
||||
"description": entry.Description,
|
||||
"config": map[string]interface{}{
|
||||
"default_lease_ttl": int(entry.Config.DefaultLeaseTTL.Seconds()),
|
||||
"max_lease_ttl": int(entry.Config.MaxLeaseTTL.Seconds()),
|
||||
"default_lease_ttl": int64(entry.Config.DefaultLeaseTTL.Seconds()),
|
||||
"max_lease_ttl": int64(entry.Config.MaxLeaseTTL.Seconds()),
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -1041,8 +1041,8 @@ func (b *SystemBackend) handleAuthTable(
|
|||
"type": entry.Type,
|
||||
"description": entry.Description,
|
||||
"config": map[string]interface{}{
|
||||
"default_lease_ttl": int(entry.Config.DefaultLeaseTTL.Seconds()),
|
||||
"max_lease_ttl": int(entry.Config.MaxLeaseTTL.Seconds()),
|
||||
"default_lease_ttl": int64(entry.Config.DefaultLeaseTTL.Seconds()),
|
||||
"max_lease_ttl": int64(entry.Config.MaxLeaseTTL.Seconds()),
|
||||
},
|
||||
}
|
||||
resp.Data[entry.Path] = info
|
||||
|
|
|
@ -46,24 +46,24 @@ func TestSystemBackend_mounts(t *testing.T) {
|
|||
"type": "generic",
|
||||
"description": "generic secret storage",
|
||||
"config": map[string]interface{}{
|
||||
"default_lease_ttl": resp.Data["secret/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int),
|
||||
"max_lease_ttl": resp.Data["secret/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int),
|
||||
"default_lease_ttl": resp.Data["secret/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64),
|
||||
"max_lease_ttl": resp.Data["secret/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64),
|
||||
},
|
||||
},
|
||||
"sys/": map[string]interface{}{
|
||||
"type": "system",
|
||||
"description": "system endpoints used for control, policy and debugging",
|
||||
"config": map[string]interface{}{
|
||||
"default_lease_ttl": resp.Data["sys/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int),
|
||||
"max_lease_ttl": resp.Data["sys/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int),
|
||||
"default_lease_ttl": resp.Data["sys/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64),
|
||||
"max_lease_ttl": resp.Data["sys/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64),
|
||||
},
|
||||
},
|
||||
"cubbyhole/": map[string]interface{}{
|
||||
"description": "per-token private secret storage",
|
||||
"type": "cubbyhole",
|
||||
"config": map[string]interface{}{
|
||||
"default_lease_ttl": resp.Data["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int),
|
||||
"max_lease_ttl": resp.Data["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int),
|
||||
"default_lease_ttl": resp.Data["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64),
|
||||
"max_lease_ttl": resp.Data["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -529,8 +529,8 @@ func TestSystemBackend_authTable(t *testing.T) {
|
|||
"type": "token",
|
||||
"description": "token based credentials",
|
||||
"config": map[string]interface{}{
|
||||
"default_lease_ttl": int(0),
|
||||
"max_lease_ttl": int(0),
|
||||
"default_lease_ttl": int64(0),
|
||||
"max_lease_ttl": int64(0),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue