HashiCorp Vault: 生成证书和密钥:时间到期(ttl)的格式是什么?

huangapple go评论43阅读模式
英文:

HashiCorp Vault: Generate Certificate and Key: What is the format for time-to-live (ttl)?

问题

HashiCorp Vault REST API具有生成(签名的)证书和密钥的端点:/pki/issue/:name

官方文档:https://developer.hashicorp.com/vault/api-docs/secret/pki#generate-certificate-and-key

在请求的主体中,有一个JSON对象键"ttl"用于定义生存周期时间。支持此键的值格式有哪些?

我在官方文档中找不到支持的格式。幸运的是,我找到了其他示例,允许后缀"h"表示小时,例如"360h",以及"d"表示天,例如"7d"

英文:

HashiCorp Vault REST API has an endpoint to generate (signed) cert and key: /pki/issue/:name

Official docs: https://developer.hashicorp.com/vault/api-docs/secret/pki#generate-certificate-and-key

In the body of the request, there is a JSON object key "ttl" for time-to-live. What are the supported value formats for this key?

I cannot find supported formats in official docs. By luck, I found other examples that allow suffices "h" for hours, e.g., "360h", and "d" for days, e.g., "7d".

答案1

得分: 1

It expects a time duration string parsable by Go time.ParseDuration.

https://github.com/hashicorp/vault/issues/1195

https://pkg.go.dev/time#ParseDuration

英文:

It expects a time duration string parsable by Go time.ParseDuration.

https://github.com/hashicorp/vault/issues/1195

https://pkg.go.dev/time#ParseDuration

huangapple
  • 本文由 发表于 2023年5月30日 10:09:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76361210.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定