英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论