Skip to content

Conversation

@The127
Copy link
Owner

@The127 The127 commented Jan 11, 2026

This pull request removes several utility and helper packages related to duration handling, base64 encoding, and security, as well as refactors some code to improve maintainability and clarity. The most important changes are the removal of custom duration and base64 helpers, the elimination of unused security-related code, and small improvements to job, audit, and password modules.

Utility and helper package removals

  • Deleted the internal/database/postgres/helpers/interval.go file, which contained custom functions for handling PostgreSQL interval types and conversions.
  • Removed the internal/jsonTypes/Duration.go file, which provided a custom JSON marshaler/unmarshaler for durations.
  • Deleted the utils/base64.go file, which implemented invariant base64 comparison and normalization helpers.
  • Removed unused or redundant functions from utils/security.go, including code generation and key import helpers.

Minor refactoring and improvements

  • Updated password rule deserialization to avoid unnecessary conversion to byte slices in internal/password/password.go.
  • Registered a new handler for patching virtual servers in the mediator setup.
  • Added goland inspection comments to suppress IDE warnings for unused exported functions and constants in job runner, audit, and integration test files. [1] [2] [3]

Removed `Duration`, `InvariantBase64Equals`, `NullDuration`, and related helper functions from internal packages as they are no longer used.

Signed-off-by: karo <[email protected]>
Copilot AI review requested due to automatic review settings January 11, 2026 10:36
@The127 The127 enabled auto-merge January 11, 2026 10:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request performs code cleanup by removing unused utility functions and helper packages while making minor improvements to maintainability. The changes reduce code complexity without affecting functionality.

Changes:

  • Removed unused utility functions from utils/security.go and deleted the entire utils/base64.go file
  • Deleted unused custom duration and PostgreSQL interval helper packages
  • Fixed unnecessary type conversion in password rule deserialization
  • Registered missing handler for patching virtual servers in the mediator
  • Added IDE suppression comments for exported functions that are internal

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
utils/security.go Removed unused GenerateCodeFromBytes and ImportPrivateKey functions while preserving the actively used GetSecureRandomBytes
utils/base64.go Deleted entire file containing InvariantBase64Equals function that is no longer used anywhere in the codebase
internal/jsonTypes/Duration.go Deleted custom Duration JSON marshaler/unmarshaler that is no longer used
internal/database/postgres/helpers/interval.go Deleted PostgreSQL interval parsing helpers that are no longer needed
internal/password/password.go Removed unnecessary []byte() conversion since passwordRule.Details() already returns []byte
internal/setup/mediator.go Added missing registration for HandlePatchVirtualServer command handler
internal/services/audit/audit.go Added IDE suppression comment for exported NewConsoleAuditLogger function
internal/jobs/JobRunner.go Added IDE suppression comment for exported WithTimeout function
tests/integration/serviceuser_flow_test.go Added IDE suppression comment for test constants

@The127 The127 merged commit d39da36 into main Jan 11, 2026
15 checks passed
@The127 The127 deleted the kkostial/small-refactorings branch January 11, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants