Skip to content

Commit

Permalink
refactor: Using bcrypt from httputils
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Mar 12, 2023
1 parent 3189a7d commit 6ba9ace
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 32 deletions.
29 changes: 0 additions & 29 deletions pkg/crud/bcrypt.go

This file was deleted.

5 changes: 2 additions & 3 deletions pkg/crud/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
"github.com/ViBiOh/fibr/pkg/search"
"github.com/ViBiOh/fibr/pkg/thumbnail"
"github.com/ViBiOh/flags"
"github.com/ViBiOh/httputils/v4/pkg/bcrypt"
"github.com/ViBiOh/httputils/v4/pkg/logger"
"github.com/ViBiOh/httputils/v4/pkg/renderer"
"go.opentelemetry.io/otel/trace"
"golang.org/x/crypto/bcrypt"
)

type Items []absto.Item
Expand Down Expand Up @@ -102,10 +102,9 @@ func New(config Config, storageApp absto.Storage, filteredStorage absto.Storage,
return app, fmt.Errorf("parse bcrypt duration: %w", err)
}

bcryptCost, err := findBcryptBestCost(bcryptDuration)
bcryptCost, err := bcrypt.FindBestCost(bcryptDuration)
if err != nil {
logger.Error("find best bcrypt cost: %s", err)
bcryptCost = bcrypt.DefaultCost
}
logger.Info("Best bcrypt cost is %d", bcryptCost)

Expand Down
1 change: 1 addition & 0 deletions pkg/crud/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func (a App) createWebhook(w http.ResponseWriter, r *http.Request, request provi
} else {
a.error(w, r, request, model.WrapInternal(err))
}

return
}

Expand Down

0 comments on commit 6ba9ace

Please sign in to comment.