summaryrefslogtreecommitdiff
path: root/internal/storage
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2024-09-20 11:11:53 +1000
committerGitHub <noreply@github.com>2024-09-20 11:11:53 +1000
commitc0d4dd9c9499b7e9b0f83c47396aa6a7da3424db (patch)
tree2d5ca23021aacac96d656b680eb57cab00b1617e /internal/storage
parent346acdcf43f715473874c7033421df04f7232e63 (diff)
refactor: linting (#7863)
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'internal/storage')
-rw-r--r--internal/storage/sql_provider.go4
-rw-r--r--internal/storage/sql_provider_backend_postgres.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/internal/storage/sql_provider.go b/internal/storage/sql_provider.go
index 7154a404e..21c84cfe2 100644
--- a/internal/storage/sql_provider.go
+++ b/internal/storage/sql_provider.go
@@ -561,7 +561,7 @@ func (p *SQLProvider) LoadTOTPConfiguration(ctx context.Context, username string
// SaveTOTPHistory saves a TOTP history item in the storage provider.
func (p *SQLProvider) SaveTOTPHistory(ctx context.Context, username string, step uint64) (err error) {
- signature := p.otpHMACSignature([]byte(strconv.Itoa(int(step))), []byte(username))
+ signature := p.otpHMACSignature([]byte(strconv.FormatUint(step, 10)), []byte(username))
if _, err = p.db.ExecContext(ctx, p.sqlInsertTOTPHistory, username, signature); err != nil {
return fmt.Errorf("error inserting TOTP history for user '%s': %w", username, err)
@@ -574,7 +574,7 @@ func (p *SQLProvider) SaveTOTPHistory(ctx context.Context, username string, step
func (p *SQLProvider) ExistsTOTPHistory(ctx context.Context, username string, step uint64) (exists bool, err error) {
var count int
- signature := p.otpHMACSignature([]byte(strconv.Itoa(int(step))), []byte(username))
+ signature := p.otpHMACSignature([]byte(strconv.FormatUint(step, 10)), []byte(username))
if err = p.db.GetContext(ctx, &count, p.sqlSelectTOTPHistory, username, signature); err != nil {
return false, fmt.Errorf("error checking if TOTP history exists: %w", err)
diff --git a/internal/storage/sql_provider_backend_postgres.go b/internal/storage/sql_provider_backend_postgres.go
index ee6aa434b..41dd83db0 100644
--- a/internal/storage/sql_provider_backend_postgres.go
+++ b/internal/storage/sql_provider_backend_postgres.go
@@ -154,7 +154,7 @@ func dsnPostgreSQL(config *schema.StoragePostgreSQL, globalCACertPool *x509.Cert
dsnConfig, _ := pgx.ParseConfig("")
dsnConfig.Host = config.Address.SocketHostname()
- dsnConfig.Port = uint16(config.Address.Port())
+ dsnConfig.Port = config.Address.Port()
dsnConfig.Database = config.Database
dsnConfig.User = config.Username
dsnConfig.Password = config.Password