fix: challenge target field was not mapped to db entity

pull/1671/head
beltram 1 year ago committed by Herman Slatman
parent d32a3e23f0
commit 97002040a5
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F

@ -294,7 +294,7 @@ func newAuthorization(ctx context.Context, az *acme.Authorization) error {
return acme.NewError(acme.ErrorMalformedType, "DeviceId is not hexadecimal")
}
_ = decoded
tmpl, err := template.New("DevideId").Parse(targetTemplate)
tmpl, err := template.New("DeviceId").Parse(targetTemplate)
if err != nil {
return acme.NewError(acme.ErrorMalformedType, "Misconfigured target template configuration")
}

@ -19,6 +19,7 @@ type dbChallenge struct {
Status acme.Status `json:"status"`
Token string `json:"token"`
Value string `json:"value"`
Target string `json:"target"`
ValidatedAt string `json:"validatedAt"`
CreatedAt time.Time `json:"createdAt"`
Error *acme.Error `json:"error"` // TODO(hs): a bit dangerous; should become db-specific type
@ -61,6 +62,7 @@ func (db *DB) CreateChallenge(ctx context.Context, ch *acme.Challenge) error {
Token: ch.Token,
CreatedAt: clock.Now(),
Type: ch.Type,
Target: ch.Target,
}
return db.save(ctx, ch.ID, dbch, nil, "challenge", challengeTable)
@ -84,6 +86,7 @@ func (db *DB) GetChallenge(ctx context.Context, id, authzID string) (*acme.Chall
Token: dbch.Token,
Error: dbch.Error,
ValidatedAt: dbch.ValidatedAt,
Target: dbch.Target,
}
return ch, nil
}

Loading…
Cancel
Save