@@ -393,6 +393,10 @@ type wireOidcPayload struct {
393393}
394394
395395func wireOIDC01Validate (ctx context.Context , ch * Challenge , db DB , jwk * jose.JSONWebKey , payload []byte ) error {
396+ wireDB , ok := db .(WireDB )
397+ if ! ok {
398+ return NewErrorISE ("db %T is not a WireDB" , db )
399+ }
396400 prov , ok := ProvisionerFromContext (ctx )
397401 if ! ok {
398402 return NewErrorISE ("missing provisioner" )
@@ -472,7 +476,7 @@ func wireOIDC01Validate(ctx context.Context, ch *Challenge, db DB, jwk *jose.JSO
472476 return WrapErrorISE (err , "error updating challenge" )
473477 }
474478
475- orders , err := db .GetAllOrdersByAccountID (ctx , ch .AccountID )
479+ orders , err := wireDB .GetAllOrdersByAccountID (ctx , ch .AccountID )
476480 if err != nil {
477481 return WrapErrorISE (err , "could not retrieve current order by account id" )
478482 }
@@ -481,7 +485,7 @@ func wireOIDC01Validate(ctx context.Context, ch *Challenge, db DB, jwk *jose.JSO
481485 }
482486
483487 order := orders [len (orders )- 1 ]
484- if err := db .CreateOidcToken (ctx , order , transformedIDToken ); err != nil {
488+ if err := wireDB .CreateOidcToken (ctx , order , transformedIDToken ); err != nil {
485489 return WrapErrorISE (err , "failed storing OIDC id token" )
486490 }
487491
@@ -523,6 +527,10 @@ type wireDpopPayload struct {
523527}
524528
525529func wireDPOP01Validate (ctx context.Context , ch * Challenge , db DB , accountJWK * jose.JSONWebKey , payload []byte ) error {
530+ wireDB , ok := db .(WireDB )
531+ if ! ok {
532+ return NewErrorISE ("db %T is not a WireDB" , db )
533+ }
526534 prov , ok := ProvisionerFromContext (ctx )
527535 if ! ok {
528536 return NewErrorISE ("missing provisioner" )
@@ -586,7 +594,7 @@ func wireDPOP01Validate(ctx context.Context, ch *Challenge, db DB, accountJWK *j
586594 return WrapErrorISE (err , "error updating challenge" )
587595 }
588596
589- orders , err := db .GetAllOrdersByAccountID (ctx , ch .AccountID )
597+ orders , err := wireDB .GetAllOrdersByAccountID (ctx , ch .AccountID )
590598 if err != nil {
591599 return WrapErrorISE (err , "could not find current order by account id" )
592600 }
@@ -595,7 +603,7 @@ func wireDPOP01Validate(ctx context.Context, ch *Challenge, db DB, accountJWK *j
595603 }
596604
597605 order := orders [len (orders )- 1 ]
598- if err := db .CreateDpopToken (ctx , order , map [string ]any (* dpop )); err != nil {
606+ if err := wireDB .CreateDpopToken (ctx , order , map [string ]any (* dpop )); err != nil {
599607 return WrapErrorISE (err , "failed storing DPoP token" )
600608 }
601609
0 commit comments