forked from TrueCloudLab/certificates
Add templateData to api sign request.
This commit is contained in:
parent
95c3a41bf0
commit
068bafe5a3
1 changed files with 9 additions and 6 deletions
15
api/sign.go
15
api/sign.go
|
@ -2,6 +2,7 @@ package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/smallstep/certificates/authority/provisioner"
|
"github.com/smallstep/certificates/authority/provisioner"
|
||||||
|
@ -11,10 +12,11 @@ import (
|
||||||
|
|
||||||
// SignRequest is the request body for a certificate signature request.
|
// SignRequest is the request body for a certificate signature request.
|
||||||
type SignRequest struct {
|
type SignRequest struct {
|
||||||
CsrPEM CertificateRequest `json:"csr"`
|
CsrPEM CertificateRequest `json:"csr"`
|
||||||
OTT string `json:"ott"`
|
OTT string `json:"ott"`
|
||||||
NotAfter TimeDuration `json:"notAfter"`
|
NotAfter TimeDuration `json:"notAfter"`
|
||||||
NotBefore TimeDuration `json:"notBefore"`
|
NotBefore TimeDuration `json:"notBefore"`
|
||||||
|
TemplateData json.RawMessage `json:"templateData"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate checks the fields of the SignRequest and returns nil if they are ok
|
// Validate checks the fields of the SignRequest and returns nil if they are ok
|
||||||
|
@ -59,8 +61,9 @@ func (h *caHandler) Sign(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
opts := provisioner.Options{
|
opts := provisioner.Options{
|
||||||
NotBefore: body.NotBefore,
|
NotBefore: body.NotBefore,
|
||||||
NotAfter: body.NotAfter,
|
NotAfter: body.NotAfter,
|
||||||
|
TemplateData: body.TemplateData,
|
||||||
}
|
}
|
||||||
|
|
||||||
signOpts, err := h.Authority.AuthorizeSign(body.OTT)
|
signOpts, err := h.Authority.AuthorizeSign(body.OTT)
|
||||||
|
|
Loading…
Reference in a new issue