Closed buger closed 2 months ago
โฑ๏ธ Estimated effort to review: 3 ๐ต๐ต๐ตโชโช |
๐งช No relevant tests |
๐ No security concerns identified |
โก Key issues to review Function Complexity The function `hashFunction` in `storage/storage.go` uses a default case that logs an error but returns a valid hash function (`murmur32`). This could lead to silent errors in the system where an unsupported hash algorithm is specified but the system continues to work incorrectly. Consider throwing an error or handling this case more explicitly. Error Handling The function `GenerateToken` in `storage/storage.go` does not handle the error from `hashFunction` properly. It proceeds with encoding the token even if there is an error in determining the hash function, which might lead to generating incorrect tokens. |
No code suggestions found for the PR.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
User description
Revert "TT-2539 added access/transaction logs" (#6524)
User description
Reverts TykTechnologies/tyk#6354 with QA failure
PR Type
enhancement, bug fix
Description
AccessLogsConfig
struct and related access log configurations from the codebase.crypto
tostorage
, consolidating related functionality.Changes walkthrough ๐
8 files
config.go
Remove access logs configuration from analytics settings
config/config.go
AccessLogsConfig
struct and its usage.middleware.go
Remove access log recording function from middleware
gateway/middleware.go - Removed `recordAccessLog` function.
hash.go
Remove crypto hashing functions
internal/crypto/hash.go - Deleted the entire file related to hashing functions.
token.go
Remove token generation and parsing functions
internal/crypto/token.go - Deleted the entire file related to token generation and parsing.
access_log.go
Remove access log record functionality
internal/httputil/accesslog/access_log.go - Deleted the entire file related to access log records.
alias.go
Remove storage alias for crypto functions
storage/alias.go
storage.go
Integrate hashing and token functions into storage
storage/storage.go - Moved hashing and token functions from `crypto` to `storage`.
schema.json
Remove access logs configuration from schema
cli/linter/schema.json - Removed `access_logs` configuration from the schema.
2 files
handler_error.go
Remove transaction log printing in error handler
gateway/handler_error.go - Removed transaction log printing for error situations.
handler_success.go
Remove transaction log printing in success handler
gateway/handler_success.go - Removed transaction log printing for successful requests.
3 files
handler_error_test.go
Remove access logs benchmark tests from error handler tests
gateway/handler_error_test.go - Removed benchmark tests related to access logs.
handler_success_test.go
Remove access logs benchmark tests from success handler tests
gateway/handler_success_test.go - Removed benchmark tests related to access logs.
access_log_test.go
Remove access log tests
internal/httputil/accesslog/access_log_test.go - Deleted the entire file related to access log tests.
1 files
Taskfile.yml
Update test command in Taskfile
internal/httputil/Taskfile.yml - Updated test command to remove specific coverage package.
PR Type
Bug fix, Enhancement
Description
AccessLogsConfig
struct and related configurations from the codebase.crypto
tostorage
, consolidating related functionality.Changes walkthrough ๐
9 files
config.go
Remove access logs configuration from config
config/config.go
AccessLogsConfig
struct and its usage.handler_error.go
Remove transaction log printing in error handler
gateway/handler_error.go - Removed transaction log printing for error situations.
handler_success.go
Remove transaction log printing in success handler
gateway/handler_success.go - Removed transaction log printing for success situations.
middleware.go
Remove access log recording function from middleware
gateway/middleware.go - Removed `recordAccessLog` function.
hash.go
Remove hash utility functions
internal/crypto/hash.go - Deleted hash utility functions.
token.go
Remove token utility functions
internal/crypto/token.go - Deleted token utility functions.
access_log.go
Remove access log record implementation
internal/httputil/accesslog/access_log.go - Deleted access log record implementation.
alias.go
Remove crypto function aliases
storage/alias.go - Removed alias definitions for crypto functions.
storage.go
Consolidate hashing and token functions in storage
storage/storage.go - Moved hashing and token functions from `crypto` to `storage`.
3 files
handler_error_test.go
Remove access log benchmark tests from error handler tests
gateway/handler_error_test.go - Removed benchmark tests related to access logs.
handler_success_test.go
Remove access log benchmark tests from success handler tests
gateway/handler_success_test.go - Removed benchmark tests related to access logs.
access_log_test.go
Remove tests for access log records
internal/httputil/accesslog/access_log_test.go - Deleted tests for access log records.
2 files
schema.json
Remove access logs configuration from schema
cli/linter/schema.json - Removed access logs configuration from schema.
Taskfile.yml
Update test coverage package path in Taskfile
internal/httputil/Taskfile.yml - Updated test coverage package path.