Просмотр исходного кода

Make template use `DeviceId` for now

Herman Slatman 2 лет назад
Родитель
Сommit
e2a2e00526
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      authority/provisioner/dpop_options.go
  2. 2 2
      authority/provisioner/oidc_options.go

+ 2 - 2
authority/provisioner/dpop_options.go

@@ -43,12 +43,12 @@ func (o *DPOPOptions) GetTarget(deviceID string) (string, error) {
 		return "", errors.New("misconfigured target template configuration")
 	}
 	targetTemplate := o.GetDPOPTarget()
-	tmpl, err := template.New("DeviceID").Parse(targetTemplate)
+	tmpl, err := template.New("DeviceId").Parse(targetTemplate)
 	if err != nil {
 		return "", fmt.Errorf("failed parsing dpop template: %w", err)
 	}
 	buf := new(bytes.Buffer)
-	if err = tmpl.Execute(buf, struct{ DeviceID string }{DeviceID: deviceID}); err != nil {
+	if err = tmpl.Execute(buf, struct{ DeviceId string }{DeviceId: deviceID}); err != nil {
 		return "", fmt.Errorf("failed executing dpop template: %w", err)
 	}
 	return buf.String(), nil

+ 2 - 2
authority/provisioner/oidc_options.go

@@ -56,12 +56,12 @@ func (o *OIDCOptions) GetTarget(deviceID string) (string, error) {
 		return "", errors.New("misconfigured target template configuration")
 	}
 	targetTemplate := o.Provider.IssuerURL
-	tmpl, err := template.New("DeviceID").Parse(targetTemplate)
+	tmpl, err := template.New("DeviceId").Parse(targetTemplate)
 	if err != nil {
 		return "", fmt.Errorf("failed parsing oidc template: %w", err)
 	}
 	buf := new(bytes.Buffer)
-	if err = tmpl.Execute(buf, struct{ DeviceID string }{DeviceID: deviceID}); err != nil {
+	if err = tmpl.Execute(buf, struct{ DeviceId string }{DeviceId: deviceID}); err != nil {
 		return "", fmt.Errorf("failed executing oidc template: %w", err)
 	}
 	return buf.String(), nil