Skip to content

Commit

Permalink
fix: sync and solve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbrm committed May 29, 2024
2 parents c8f94b9 + d2f01b1 commit d94ac74
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions libs/wallet/provider/uphold/uphold.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ const (

const (
// The Intermediate Certificates
sandboxFingerprint = "h+8wXc+BABb/V9q7PN5I8xVpTJCzmi2RDJR5nmml3Ac="
prodFingerprint = "h+8wXc+BABb/V9q7PN5I8xVpTJCzmi2RDJR5nmml3Ac="
sandboxFingerprint = "tl2IZaqu6xeE6iVuJmPIKsJW5N88W1nysF1WZE1THFs="
prodFingerprint = "tl2IZaqu6xeE6iVuJmPIKsJW5N88W1nysF1WZE1THFs="
)

var (
Expand Down
3 changes: 0 additions & 3 deletions services/skus/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,6 @@ func deleteOrderCreds(service *Service) handlers.AppHandler {
case errors.Is(err, model.ErrInvalidOrderNoItems):
return handlers.WrapError(err, "order has no items", http.StatusBadRequest)

// case errors.Is(err, errExceededMaxTLV2DailyCreds):
// return handlers.WrapError(err, err.Error(), http.StatusUnprocessableEntity)

default:
return handlers.WrapError(model.ErrSomethingWentWrong, "failed to delete credentials", http.StatusBadRequest)
}
Expand Down
11 changes: 4 additions & 7 deletions services/skus/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,10 @@ func (s *Service) CreateOrderItemCredentials(ctx context.Context, orderID, itemI
func (s *Service) doCredentialsExist(ctx context.Context, requestID uuid.UUID, item *model.OrderItem, blindedCreds []string) error {
switch item.CredentialType {
case timeLimitedV2:
// NOTE: This creates a possible race to submit between clients.
// Multiple signing request outboxes can be created since their
// uniqueness constraint is on the request id.
// Despite this, the uniqueness constraint of time_limited_v2_order_creds ensures that
// only one set of credentials is written for each order / item & time interval.
// As a result, one client will successfully unblind the credentials and
// the others will fail.
// NOTE: There was a possible race condition that would allow exceeding limits on the number of cred batches.
// The condition is currently mitigated by:
// - checking the number of active batches before accepting a request to create creds;
// - checking the number of active batches before inserting the signed creds.

return s.doTLV2Exist(ctx, requestID, item, blindedCreds)
default:
Expand Down

0 comments on commit d94ac74

Please sign in to comment.