TykTechnologies / tyk

Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
Other
9.7k stars 1.09k forks source link

Merging to release-5.6: Revert "[TT-2539] added access/transaction logs" (#6524) #6526

Closed buger closed 1 month ago

buger commented 1 month ago

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


Changes walkthrough ๐Ÿ“

Relevant files
Enhancement
8 files
config.go
Remove access logs configuration from analytics settings 

config/config.go
  • Removed AccessLogsConfig struct and its usage.
  • Deleted configuration for access logs.
  • +0/-10   
    middleware.go
    Remove access log recording function from middleware         

    gateway/middleware.go - Removed `recordAccessLog` function.
    +0/-16   
    hash.go
    Remove crypto hashing functions                                                   

    internal/crypto/hash.go - Deleted the entire file related to hashing functions.
    +0/-53   
    token.go
    Remove token generation and parsing functions                       

    internal/crypto/token.go - Deleted the entire file related to token generation and parsing.
    +0/-83   
    access_log.go
    Remove access log record functionality                                     

    internal/httputil/accesslog/access_log.go - Deleted the entire file related to access log records.
    +0/-89   
    alias.go
    Remove storage alias for crypto functions                               

    storage/alias.go
  • Deleted the entire file related to storage alias for crypto functions.
  • +0/-24   
    storage.go
    Integrate hashing and token functions into storage             

    storage/storage.go - Moved hashing and token functions from `crypto` to `storage`.
    +125/-0 
    schema.json
    Remove access logs configuration from schema                         

    cli/linter/schema.json - Removed `access_logs` configuration from the schema.
    +0/-9     
    Bug fix
    2 files
    handler_error.go
    Remove transaction log printing in error handler                 

    gateway/handler_error.go - Removed transaction log printing for error situations.
    +0/-7     
    handler_success.go
    Remove transaction log printing in success handler             

    gateway/handler_success.go - Removed transaction log printing for successful requests.
    +2/-8     
    Tests
    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.
    +0/-51   
    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.
    +0/-55   
    access_log_test.go
    Remove access log tests                                                                   

    internal/httputil/accesslog/access_log_test.go - Deleted the entire file related to access log tests.
    +0/-99   
    Configuration changes
    1 files
    Taskfile.yml
    Update test command in Taskfile                                                   

    internal/httputil/Taskfile.yml - Updated test command to remove specific coverage package.
    +1/-2     

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions


    PR Type

    Bug fix, Enhancement


    Description


    Changes walkthrough ๐Ÿ“

    Relevant files
    Enhancement
    9 files
    config.go
    Remove access logs configuration from analytics settings 

    config/config.go
  • Removed AccessLogsConfig struct and its usage.
  • Deleted configuration for access logs.
  • +0/-10   
    handler_error.go
    Remove transaction log printing in error handler                 

    gateway/handler_error.go - Removed transaction log printing for error situations.
    +0/-7     
    handler_success.go
    Remove transaction log printing in success handler             

    gateway/handler_success.go - Removed transaction log printing for success situations.
    +2/-8     
    middleware.go
    Remove access log recording function                                         

    gateway/middleware.go - Removed `recordAccessLog` function.
    +0/-16   
    hash.go
    Remove hash functions from crypto package                               

    internal/crypto/hash.go - Removed hash-related functions.
    +0/-53   
    token.go
    Remove token functions from crypto package                             

    internal/crypto/token.go - Removed token-related functions.
    +0/-83   
    access_log.go
    Remove access log record struct and methods                           

    internal/httputil/accesslog/access_log.go - Removed access log record struct and related methods.
    +0/-89   
    alias.go
    Remove crypto alias references in storage                               

    storage/alias.go - Removed alias references to crypto package.
    +0/-24   
    storage.go
    Move hashing and token functions to storage package           

    storage/storage.go - Moved hashing and token functions from `crypto` to `storage`.
    +125/-0 
    Tests
    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.
    +0/-51   
    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.
    +0/-55   
    access_log_test.go
    Remove tests for access log record struct                               

    internal/httputil/accesslog/access_log_test.go - Removed tests for access log record struct.
    +0/-99   
    Configuration changes
    2 files
    schema.json
    Remove access logs configuration from schema                         

    cli/linter/schema.json - Removed access logs configuration from schema.
    +0/-9     
    Taskfile.yml
    Update test coverage configuration in Taskfile                     

    internal/httputil/Taskfile.yml - Updated test coverage configuration.
    +1/-2     

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    github-actions[bot] commented 1 month ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review: 3 ๐Ÿ”ต๐Ÿ”ต๐Ÿ”ตโšชโšช
    ๐Ÿงช No relevant tests
    ๐Ÿ”’ No security concerns identified
    โšก Key issues to review

    Code Quality
    The new hashing and token functions added to `storage.go` introduce significant complexity and potential for errors. It's recommended to add unit tests to ensure the correctness of these functions, especially since they handle sensitive operations like token generation and hashing.
    github-actions[bot] commented 1 month ago

    PR Code Suggestions โœจ

    No code suggestions found for the PR.

    sonarcloud[bot] commented 1 month ago

    Quality Gate Passed Quality Gate passed

    Issues
    0 New issues
    0 Accepted issues

    Measures
    0 Security Hotspots
    0.0% Coverage on New Code
    0.0% Duplication on New Code

    See analysis details on SonarCloud