Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TT-2539] added access/transaction logs #6354

Merged
merged 34 commits into from
Sep 12, 2024
Merged

Conversation

LLe27
Copy link
Contributor

@LLe27 LLe27 commented Jun 18, 2024

FR Jira Ticket

https://tyktech.atlassian.net/browse/TT-2539

Description

  • Added the TYK_GW_ACCESSLOGS_ENABLED Gateway config option
  • The Tyk Gateway will determine to print access logs to STDOUT for both success and error handling situations
    • If the TYK_GW_ACCESSLOGS_ENABLED is set to true then the Gateway will print access logs to STDOUT
    • If the TYK_GW_ACCESSLOGS_ENABLED is set to false then the Gateway will not print access logs to STDOUT

Note that this feature is off by default and that the AccessLog struct only contains the more common elements. Below are some examples of an access log

time="Sep 04 08:04:18" level=info APIID=c062396cb62d4e9a5ee37adaf85b9e4c APIKey=00000000 ClientIP=127.0.0.1 ClientRemoteAddr="127.0.0.1:53506" Host="localhost:8080" Method=GET OrgID=66d07f00247d80811d5199c3 Proto=HTTP/1.1 RequestURI=/httpbin/get StatusCode=200 TotalLatency=381 UpstreamAddress="http://httpbin.org/get" UpstreamLatency=381 UpstreamPath=/get UpstreamURI=/get UserAgent=curl/8.1.2 prefix=access-log
time="Sep 04 08:08:20" level=info APIID=c062396cb62d4e9a5ee37adaf85b9e4c APIKey=00000000 ClientIP=127.0.0.1 ClientRemoteAddr="127.0.0.1:53566" Host="localhost:8080" Method=GET OrgID=66d07f00247d80811d5199c3 Proto=HTTP/1.1 RequestURI=/httpbin/get StatusCode=401 TotalLatency=0 UpstreamAddress=":///httpbin/get" UpstreamLatency=0 UpstreamPath=/httpbin/get UpstreamURI=/httpbin/get UserAgent=curl/8.1.2 prefix=access-log

Related Issue

Motivation and Context

Today the Tyk Gateway does not print access logs for success API calls but instead only for error API calls. Providing access logs for both scenarios within the Tyk Gateway is extremely valuable especially if you are monitoring logs, capturing analytics or even debugging. Providing the option to turn on or off the Tyk Gateway access logs will provide clients more insights in for API calls in regards to success and error situations.

How This Has Been Tested

  • Manual testing
  • Unit testing
  • Performance testing/benchmarks

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring or add test (improvements in base code or adds test coverage to functionality)

Checklist

  • I ensured that the documentation is up to date
  • I explained why this PR updates go.mod in detail with reasoning why it's required
  • I would like a code coverage CI quality gate exception and have explained why

@LLe27 LLe27 requested a review from titpetric June 18, 2024 15:32
Copy link
Contributor

github-actions bot commented Jun 19, 2024

API Changes

--- prev.txt	2024-09-12 08:45:12.627540046 +0000
+++ current.txt	2024-09-12 08:45:09.227540563 +0000
@@ -5188,6 +5188,12 @@
 
 TYPES
 
+type AccessLogsConfig struct {
+	// Enable the transaction logs. Default: false
+	Enabled bool `json:"enabled"`
+}
+    AccessLogsConfig defines the type of transactions logs printed to stdout
+
 type AnalyticsConfigConfig struct {
 	// Set empty for a Self-Managed installation or `rpc` for multi-cloud.
 	Type string `json:"type"`
@@ -5637,6 +5643,10 @@
 	// If not set or left empty, it will default to `standard`.
 	LogFormat string `json:"log_format"`
 
+	// You can configure the transaction logs to be turned on
+	// If not set or left empty, it will default to 'false'
+	AccessLogs AccessLogsConfig `json:"access_logs"`
+
 	// Section for configuring OpenTracing support
 	// Deprecated: use OpenTelemetry instead.
 	Tracer Tracer `json:"tracing"`
@@ -11316,6 +11326,12 @@
 CONSTANTS
 
 const (
+	HashSha256    = crypto.HashSha256
+	HashMurmur32  = crypto.HashMurmur32
+	HashMurmur64  = crypto.HashMurmur64
+	HashMurmur128 = crypto.HashMurmur128
+)
+const (
 	// DefaultConn is the default connection type. Not analytics and Not cache.
 	DefaultConn = "default"
 	// CacheConn is the cache connection type
@@ -11323,26 +11339,26 @@
 	// AnalyticsConn is the analytics connection type
 	AnalyticsConn = "analytics"
 )
-const B64JSONPrefix = "ey"
-    `{"` in base64
-
-const MongoBsonIdLength = 24
 
 VARIABLES
 
 var (
+	HashStr = crypto.HashStr
+	HashKey = crypto.HashKey
+)
+var (
+	GenerateToken = crypto.GenerateToken
+	TokenHashAlgo = crypto.TokenHashAlgo
+	TokenID       = crypto.TokenID
+	TokenOrg      = crypto.TokenOrg
+)
+var (
 	// ErrRedisIsDown is returned when we can't communicate with redis
 	ErrRedisIsDown = errors.New("storage: Redis is either down or was not configured")
 
 	// ErrStorageConn is returned when we can't get a connection from the ConnectionHandler
 	ErrStorageConn = fmt.Errorf("Error trying to get singleton instance: %w", ErrRedisIsDown)
 )
-var (
-	HashSha256    = "sha256"
-	HashMurmur32  = "murmur32"
-	HashMurmur64  = "murmur64"
-	HashMurmur128 = "murmur128"
-)
 var ErrKeyNotFound = errors.New("key not found")
     ErrKeyNotFound is a standard error for when a key is not found in the
     storage engine
@@ -11351,19 +11367,9 @@
 
 FUNCTIONS
 
-func GenerateToken(orgID, keyID, hashAlgorithm string) (string, error)
-    If hashing algorithm is empty, use legacy key generation
-
-func HashKey(in string, hashKey bool) string
-func HashStr(in string, withAlg ...string) string
 func NewConnector(connType string, conf config.Config) (model.Connector, error)
     NewConnector creates a new storage connection.
 
-func TokenHashAlgo(token string) string
-func TokenID(token string) (id string, err error)
-    TODO: add checks
-
-func TokenOrg(token string) string
 
 TYPES
 

Copy link
Contributor

💥 CI tests failed 🙈

git-state

all ok

Please look at the run or in the Checks tab.

@LLe27 LLe27 requested a review from jeffy-mathew July 25, 2024 21:12
gateway/handler_error.go Outdated Show resolved Hide resolved
gateway/handler_error.go Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
gateway/handler_error.go Outdated Show resolved Hide resolved
gateway/middleware.go Fixed Show fixed Hide fixed
hashAlgorithm = DefaultHashAlgorithm
}

jsonToken := fmt.Sprintf(`{"org":"%s","id":"%s","h":"%s"}`, orgID, keyID, hashAlgorithm)

Check failure

Code scanning / CodeQL

Potentially unsafe quoting Critical

If this
JSON value
contains a double quote, it could break out of the enclosing quotes.
If this
JSON value
contains a double quote, it could break out of the enclosing quotes.
If this
JSON value
contains a double quote, it could break out of the enclosing quotes.
@titpetric titpetric changed the title [TT-2539] added transaction logs [TT-2539] added access/transaction logs Sep 10, 2024
config/config.go Outdated
// For example if you want Tyk to use the certificate `ab23ef123` for requests to the `example.com` upstream and `/certs/default.pem` for all other upstreams then:
// In `tyk.conf` you would configure `"security": {"certificates": {"upstream": {"*": "/certs/default.pem", "example.com": "ab23ef123"}}}`
// And if using environment variables you would set this to `*:/certs/default.pem,example.com:ab23ef123`.
// Specify upstream mutual TLS certificates at a global level in the following format: `{ "<host>": "<cert>" }``
Copy link
Contributor

Choose a reason for hiding this comment

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

this change is unrelated, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

looks like it needs a revert, yes

Copy link

sonarcloud bot commented Sep 12, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@titpetric titpetric merged commit 6f61900 into master Sep 12, 2024
25 of 27 checks passed
@titpetric titpetric deleted the TT-2539/transaction_logs branch September 12, 2024 14:35
jeffy-mathew added a commit that referenced this pull request Sep 17, 2024
jeffy-mathew added a commit that referenced this pull request Sep 17, 2024
### **User description**
Reverts #6354 with QA failure


___

### **PR Type**
enhancement, bug fix


___

### **Description**
- Removed the `AccessLogsConfig` struct and related access log
configurations from the codebase.
- Deleted functions and tests related to access logs, including
transaction log printing in both error and success handlers.
- Moved hashing and token functions from `crypto` to `storage`,
consolidating related functionality.
- Updated the schema and Taskfile to reflect the removal of access logs
and related configurations.


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>8
files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>config.go</strong><dd><code>Remove access logs
configuration from analytics settings</code>&nbsp; </dd></summary>
<hr>

config/config.go

<li>Removed <code>AccessLogsConfig</code> struct and its usage.<br> <li>
Deleted configuration for access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17">+0/-10</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Remove access log
recording function from middleware</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

gateway/middleware.go

- Removed `recordAccessLog` function.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-703054910891a4db633eca0f42ed779d6b4fa75cd9b3aa4c503e681364201c1b">+0/-16</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>hash.go</strong><dd><code>Remove crypto hashing
functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/crypto/hash.go

- Deleted the entire file related to hashing functions.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-fd1c33ede81b9c5740cabc411ea8e4ce122cf642382b699114dfddcc49ea84d6">+0/-53</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>token.go</strong><dd><code>Remove token generation and
parsing functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/crypto/token.go

- Deleted the entire file related to token generation and parsing.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-25b0099bc38076a27697918a7d82178f3f031a5abb58ae30c70c22d7332ee918">+0/-83</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>access_log.go</strong><dd><code>Remove access log
record functionality</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/accesslog/access_log.go

- Deleted the entire file related to access log records.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-39a7ae68c9608f8e05ab9207081cb3be248d00d68a5a2412304b83b2340401b7">+0/-89</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>alias.go</strong><dd><code>Remove storage alias for
crypto functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

storage/alias.go

<li>Deleted the entire file related to storage alias for crypto
functions.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-824743fa5c64b4ca24743cdcb0c3014513632cb0bcad7b225d162510698c9a82">+0/-24</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>storage.go</strong><dd><code>Integrate hashing and
token functions into storage</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

storage/storage.go

- Moved hashing and token functions from `crypto` to `storage`.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-2a93e444b612bd9853c32889fb82c4041760536f84356bb0db04738c19b62dde">+125/-0</a>&nbsp;
</td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>schema.json</strong><dd><code>Remove access logs
configuration from schema</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

cli/linter/schema.json

- Removed `access_logs` configuration from the schema.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-103cec746d3e61d391c5a67c171963f66fea65d651d704d5540e60aa5d574f46">+0/-9</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    
</table></details></td></tr><tr><td><strong>Bug
fix</strong></td><td><details><summary>2 files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>handler_error.go</strong><dd><code>Remove transaction
log printing in error handler</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

gateway/handler_error.go

- Removed transaction log printing for error situations.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-d3b05530ad23401f3b8f33bb1a467cd807a29a6b09c7430d01d069f626b20f77">+0/-7</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>handler_success.go</strong><dd><code>Remove transaction
log printing in success handler</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

gateway/handler_success.go

- Removed transaction log printing for successful requests.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-45135957493eca37f2e3e9a81079577777133c53b27cf95ea2ff0329c05bd006">+2/-8</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

</table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>3
files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>handler_error_test.go</strong><dd><code>Remove access
logs benchmark tests from error handler tests</code></dd></summary>
<hr>

gateway/handler_error_test.go

- Removed benchmark tests related to access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-530de66339b5f5dbe9e19144fe4215f0aa021c8414c8f3b840d3175b2d6675da">+0/-51</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>handler_success_test.go</strong><dd><code>Remove access
logs benchmark tests from success handler tests</code></dd></summary>
<hr>

gateway/handler_success_test.go

- Removed benchmark tests related to access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-42a565d872ff6c1f380386f4ee2f75bfa87991b52728a1a9a1772452bb0cd1bb">+0/-55</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>access_log_test.go</strong><dd><code>Remove access log
tests</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/accesslog/access_log_test.go

- Deleted the entire file related to access log tests.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-7e171bde9a23d0039c5dd0c1f0718a1da2dcf93211f997ce8798d4a9a14450f0">+0/-99</a>&nbsp;
&nbsp; </td>

</tr>                    
</table></details></td></tr><tr><td><strong>Configuration
changes</strong></td><td><details><summary>1 files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>Taskfile.yml</strong><dd><code>Update test command in
Taskfile</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/Taskfile.yml

- Updated test command to remove specific coverage package.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-31877aaad48d3baf442aa52077c28b873df2f2ac6c70941d409261460d7c3c8e">+1/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    
</table></details></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools
and their descriptions
tykbot bot pushed a commit that referenced this pull request Sep 17, 2024
### **User description**
Reverts #6354 with QA failure


___

### **PR Type**
enhancement, bug fix


___

### **Description**
- Removed the `AccessLogsConfig` struct and related access log
configurations from the codebase.
- Deleted functions and tests related to access logs, including
transaction log printing in both error and success handlers.
- Moved hashing and token functions from `crypto` to `storage`,
consolidating related functionality.
- Updated the schema and Taskfile to reflect the removal of access logs
and related configurations.


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>8
files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>config.go</strong><dd><code>Remove access logs
configuration from analytics settings</code>&nbsp; </dd></summary>
<hr>

config/config.go

<li>Removed <code>AccessLogsConfig</code> struct and its usage.<br> <li>
Deleted configuration for access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17">+0/-10</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Remove access log
recording function from middleware</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

gateway/middleware.go

- Removed `recordAccessLog` function.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-703054910891a4db633eca0f42ed779d6b4fa75cd9b3aa4c503e681364201c1b">+0/-16</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>hash.go</strong><dd><code>Remove crypto hashing
functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/crypto/hash.go

- Deleted the entire file related to hashing functions.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-fd1c33ede81b9c5740cabc411ea8e4ce122cf642382b699114dfddcc49ea84d6">+0/-53</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>token.go</strong><dd><code>Remove token generation and
parsing functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/crypto/token.go

- Deleted the entire file related to token generation and parsing.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-25b0099bc38076a27697918a7d82178f3f031a5abb58ae30c70c22d7332ee918">+0/-83</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>access_log.go</strong><dd><code>Remove access log
record functionality</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/accesslog/access_log.go

- Deleted the entire file related to access log records.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-39a7ae68c9608f8e05ab9207081cb3be248d00d68a5a2412304b83b2340401b7">+0/-89</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>alias.go</strong><dd><code>Remove storage alias for
crypto functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

storage/alias.go

<li>Deleted the entire file related to storage alias for crypto
functions.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-824743fa5c64b4ca24743cdcb0c3014513632cb0bcad7b225d162510698c9a82">+0/-24</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>storage.go</strong><dd><code>Integrate hashing and
token functions into storage</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

storage/storage.go

- Moved hashing and token functions from `crypto` to `storage`.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-2a93e444b612bd9853c32889fb82c4041760536f84356bb0db04738c19b62dde">+125/-0</a>&nbsp;
</td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>schema.json</strong><dd><code>Remove access logs
configuration from schema</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

cli/linter/schema.json

- Removed `access_logs` configuration from the schema.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-103cec746d3e61d391c5a67c171963f66fea65d651d704d5540e60aa5d574f46">+0/-9</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    
</table></details></td></tr><tr><td><strong>Bug
fix</strong></td><td><details><summary>2 files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>handler_error.go</strong><dd><code>Remove transaction
log printing in error handler</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

gateway/handler_error.go

- Removed transaction log printing for error situations.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-d3b05530ad23401f3b8f33bb1a467cd807a29a6b09c7430d01d069f626b20f77">+0/-7</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>handler_success.go</strong><dd><code>Remove transaction
log printing in success handler</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

gateway/handler_success.go

- Removed transaction log printing for successful requests.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-45135957493eca37f2e3e9a81079577777133c53b27cf95ea2ff0329c05bd006">+2/-8</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

</table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>3
files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>handler_error_test.go</strong><dd><code>Remove access
logs benchmark tests from error handler tests</code></dd></summary>
<hr>

gateway/handler_error_test.go

- Removed benchmark tests related to access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-530de66339b5f5dbe9e19144fe4215f0aa021c8414c8f3b840d3175b2d6675da">+0/-51</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>handler_success_test.go</strong><dd><code>Remove access
logs benchmark tests from success handler tests</code></dd></summary>
<hr>

gateway/handler_success_test.go

- Removed benchmark tests related to access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-42a565d872ff6c1f380386f4ee2f75bfa87991b52728a1a9a1772452bb0cd1bb">+0/-55</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>access_log_test.go</strong><dd><code>Remove access log
tests</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/accesslog/access_log_test.go

- Deleted the entire file related to access log tests.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-7e171bde9a23d0039c5dd0c1f0718a1da2dcf93211f997ce8798d4a9a14450f0">+0/-99</a>&nbsp;
&nbsp; </td>

</tr>                    
</table></details></td></tr><tr><td><strong>Configuration
changes</strong></td><td><details><summary>1 files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>Taskfile.yml</strong><dd><code>Update test command in
Taskfile</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/Taskfile.yml

- Updated test command to remove specific coverage package.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-31877aaad48d3baf442aa52077c28b873df2f2ac6c70941d409261460d7c3c8e">+1/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    
</table></details></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools
and their descriptions

(cherry picked from commit 3e435cc)
buger added a commit that referenced this pull request Sep 17, 2024
…gs" (#6524)

Revert "[TT-2539] added access/transaction logs" (#6524)

### **User description**
Reverts #6354 with QA failure


___

### **PR Type**
enhancement, bug fix


___

### **Description**
- Removed the `AccessLogsConfig` struct and related access log
configurations from the codebase.
- Deleted functions and tests related to access logs, including
transaction log printing in both error and success handlers.
- Moved hashing and token functions from `crypto` to `storage`,
consolidating related functionality.
- Updated the schema and Taskfile to reflect the removal of access logs
and related configurations.


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>8
files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>config.go</strong><dd><code>Remove access logs
configuration from analytics settings</code>&nbsp; </dd></summary>
<hr>

config/config.go

<li>Removed <code>AccessLogsConfig</code> struct and its usage.<br> <li>
Deleted configuration for access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17">+0/-10</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Remove access log
recording function from middleware</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

gateway/middleware.go

- Removed `recordAccessLog` function.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-703054910891a4db633eca0f42ed779d6b4fa75cd9b3aa4c503e681364201c1b">+0/-16</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>hash.go</strong><dd><code>Remove crypto hashing
functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/crypto/hash.go

- Deleted the entire file related to hashing functions.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-fd1c33ede81b9c5740cabc411ea8e4ce122cf642382b699114dfddcc49ea84d6">+0/-53</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>token.go</strong><dd><code>Remove token generation and
parsing functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/crypto/token.go

- Deleted the entire file related to token generation and parsing.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-25b0099bc38076a27697918a7d82178f3f031a5abb58ae30c70c22d7332ee918">+0/-83</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>access_log.go</strong><dd><code>Remove access log
record functionality</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/accesslog/access_log.go

- Deleted the entire file related to access log records.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-39a7ae68c9608f8e05ab9207081cb3be248d00d68a5a2412304b83b2340401b7">+0/-89</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>alias.go</strong><dd><code>Remove storage alias for
crypto functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

storage/alias.go

<li>Deleted the entire file related to storage alias for crypto
functions.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-824743fa5c64b4ca24743cdcb0c3014513632cb0bcad7b225d162510698c9a82">+0/-24</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>storage.go</strong><dd><code>Integrate hashing and
token functions into storage</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

storage/storage.go

- Moved hashing and token functions from `crypto` to `storage`.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-2a93e444b612bd9853c32889fb82c4041760536f84356bb0db04738c19b62dde">+125/-0</a>&nbsp;
</td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>schema.json</strong><dd><code>Remove access logs
configuration from schema</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

cli/linter/schema.json

- Removed `access_logs` configuration from the schema.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-103cec746d3e61d391c5a67c171963f66fea65d651d704d5540e60aa5d574f46">+0/-9</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    
</table></details></td></tr><tr><td><strong>Bug
fix</strong></td><td><details><summary>2 files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>handler_error.go</strong><dd><code>Remove transaction
log printing in error handler</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

gateway/handler_error.go

- Removed transaction log printing for error situations.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-d3b05530ad23401f3b8f33bb1a467cd807a29a6b09c7430d01d069f626b20f77">+0/-7</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>handler_success.go</strong><dd><code>Remove transaction
log printing in success handler</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

gateway/handler_success.go

- Removed transaction log printing for successful requests.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-45135957493eca37f2e3e9a81079577777133c53b27cf95ea2ff0329c05bd006">+2/-8</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

</table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>3
files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>handler_error_test.go</strong><dd><code>Remove access
logs benchmark tests from error handler tests</code></dd></summary>
<hr>

gateway/handler_error_test.go

- Removed benchmark tests related to access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-530de66339b5f5dbe9e19144fe4215f0aa021c8414c8f3b840d3175b2d6675da">+0/-51</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>handler_success_test.go</strong><dd><code>Remove access
logs benchmark tests from success handler tests</code></dd></summary>
<hr>

gateway/handler_success_test.go

- Removed benchmark tests related to access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-42a565d872ff6c1f380386f4ee2f75bfa87991b52728a1a9a1772452bb0cd1bb">+0/-55</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>access_log_test.go</strong><dd><code>Remove access log
tests</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/accesslog/access_log_test.go

- Deleted the entire file related to access log tests.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-7e171bde9a23d0039c5dd0c1f0718a1da2dcf93211f997ce8798d4a9a14450f0">+0/-99</a>&nbsp;
&nbsp; </td>

</tr>                    
</table></details></td></tr><tr><td><strong>Configuration
changes</strong></td><td><details><summary>1 files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>Taskfile.yml</strong><dd><code>Update test command in
Taskfile</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/Taskfile.yml

- Updated test command to remove specific coverage package.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-31877aaad48d3baf442aa52077c28b873df2f2ac6c70941d409261460d7c3c8e">+1/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    
</table></details></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools
and their descriptions
tykbot bot pushed a commit that referenced this pull request Sep 17, 2024
### **User description**
Reverts #6354 with QA failure


___

### **PR Type**
enhancement, bug fix


___

### **Description**
- Removed the `AccessLogsConfig` struct and related access log
configurations from the codebase.
- Deleted functions and tests related to access logs, including
transaction log printing in both error and success handlers.
- Moved hashing and token functions from `crypto` to `storage`,
consolidating related functionality.
- Updated the schema and Taskfile to reflect the removal of access logs
and related configurations.


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>8
files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>config.go</strong><dd><code>Remove access logs
configuration from analytics settings</code>&nbsp; </dd></summary>
<hr>

config/config.go

<li>Removed <code>AccessLogsConfig</code> struct and its usage.<br> <li>
Deleted configuration for access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17">+0/-10</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Remove access log
recording function from middleware</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

gateway/middleware.go

- Removed `recordAccessLog` function.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-703054910891a4db633eca0f42ed779d6b4fa75cd9b3aa4c503e681364201c1b">+0/-16</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>hash.go</strong><dd><code>Remove crypto hashing
functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/crypto/hash.go

- Deleted the entire file related to hashing functions.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-fd1c33ede81b9c5740cabc411ea8e4ce122cf642382b699114dfddcc49ea84d6">+0/-53</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>token.go</strong><dd><code>Remove token generation and
parsing functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/crypto/token.go

- Deleted the entire file related to token generation and parsing.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-25b0099bc38076a27697918a7d82178f3f031a5abb58ae30c70c22d7332ee918">+0/-83</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>access_log.go</strong><dd><code>Remove access log
record functionality</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/accesslog/access_log.go

- Deleted the entire file related to access log records.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-39a7ae68c9608f8e05ab9207081cb3be248d00d68a5a2412304b83b2340401b7">+0/-89</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>alias.go</strong><dd><code>Remove storage alias for
crypto functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

storage/alias.go

<li>Deleted the entire file related to storage alias for crypto
functions.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-824743fa5c64b4ca24743cdcb0c3014513632cb0bcad7b225d162510698c9a82">+0/-24</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>storage.go</strong><dd><code>Integrate hashing and
token functions into storage</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

storage/storage.go

- Moved hashing and token functions from `crypto` to `storage`.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-2a93e444b612bd9853c32889fb82c4041760536f84356bb0db04738c19b62dde">+125/-0</a>&nbsp;
</td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>schema.json</strong><dd><code>Remove access logs
configuration from schema</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

cli/linter/schema.json

- Removed `access_logs` configuration from the schema.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-103cec746d3e61d391c5a67c171963f66fea65d651d704d5540e60aa5d574f46">+0/-9</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    
</table></details></td></tr><tr><td><strong>Bug
fix</strong></td><td><details><summary>2 files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>handler_error.go</strong><dd><code>Remove transaction
log printing in error handler</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

gateway/handler_error.go

- Removed transaction log printing for error situations.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-d3b05530ad23401f3b8f33bb1a467cd807a29a6b09c7430d01d069f626b20f77">+0/-7</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>handler_success.go</strong><dd><code>Remove transaction
log printing in success handler</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

gateway/handler_success.go

- Removed transaction log printing for successful requests.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-45135957493eca37f2e3e9a81079577777133c53b27cf95ea2ff0329c05bd006">+2/-8</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

</table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>3
files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>handler_error_test.go</strong><dd><code>Remove access
logs benchmark tests from error handler tests</code></dd></summary>
<hr>

gateway/handler_error_test.go

- Removed benchmark tests related to access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-530de66339b5f5dbe9e19144fe4215f0aa021c8414c8f3b840d3175b2d6675da">+0/-51</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>handler_success_test.go</strong><dd><code>Remove access
logs benchmark tests from success handler tests</code></dd></summary>
<hr>

gateway/handler_success_test.go

- Removed benchmark tests related to access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-42a565d872ff6c1f380386f4ee2f75bfa87991b52728a1a9a1772452bb0cd1bb">+0/-55</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>access_log_test.go</strong><dd><code>Remove access log
tests</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/accesslog/access_log_test.go

- Deleted the entire file related to access log tests.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-7e171bde9a23d0039c5dd0c1f0718a1da2dcf93211f997ce8798d4a9a14450f0">+0/-99</a>&nbsp;
&nbsp; </td>

</tr>                    
</table></details></td></tr><tr><td><strong>Configuration
changes</strong></td><td><details><summary>1 files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>Taskfile.yml</strong><dd><code>Update test command in
Taskfile</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/Taskfile.yml

- Updated test command to remove specific coverage package.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-31877aaad48d3baf442aa52077c28b873df2f2ac6c70941d409261460d7c3c8e">+1/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    
</table></details></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools
and their descriptions

(cherry picked from commit 3e435cc)
buger added a commit that referenced this pull request Sep 17, 2024
…logs" (#6524)

Revert "[TT-2539] added access/transaction logs" (#6524)

### **User description**
Reverts #6354 with QA failure


___

### **PR Type**
enhancement, bug fix


___

### **Description**
- Removed the `AccessLogsConfig` struct and related access log
configurations from the codebase.
- Deleted functions and tests related to access logs, including
transaction log printing in both error and success handlers.
- Moved hashing and token functions from `crypto` to `storage`,
consolidating related functionality.
- Updated the schema and Taskfile to reflect the removal of access logs
and related configurations.


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>8
files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>config.go</strong><dd><code>Remove access logs
configuration from analytics settings</code>&nbsp; </dd></summary>
<hr>

config/config.go

<li>Removed <code>AccessLogsConfig</code> struct and its usage.<br> <li>
Deleted configuration for access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17">+0/-10</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Remove access log
recording function from middleware</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

gateway/middleware.go

- Removed `recordAccessLog` function.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-703054910891a4db633eca0f42ed779d6b4fa75cd9b3aa4c503e681364201c1b">+0/-16</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>hash.go</strong><dd><code>Remove crypto hashing
functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/crypto/hash.go

- Deleted the entire file related to hashing functions.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-fd1c33ede81b9c5740cabc411ea8e4ce122cf642382b699114dfddcc49ea84d6">+0/-53</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>token.go</strong><dd><code>Remove token generation and
parsing functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/crypto/token.go

- Deleted the entire file related to token generation and parsing.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-25b0099bc38076a27697918a7d82178f3f031a5abb58ae30c70c22d7332ee918">+0/-83</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>access_log.go</strong><dd><code>Remove access log
record functionality</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/accesslog/access_log.go

- Deleted the entire file related to access log records.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-39a7ae68c9608f8e05ab9207081cb3be248d00d68a5a2412304b83b2340401b7">+0/-89</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>alias.go</strong><dd><code>Remove storage alias for
crypto functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

storage/alias.go

<li>Deleted the entire file related to storage alias for crypto
functions.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-824743fa5c64b4ca24743cdcb0c3014513632cb0bcad7b225d162510698c9a82">+0/-24</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>storage.go</strong><dd><code>Integrate hashing and
token functions into storage</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

storage/storage.go

- Moved hashing and token functions from `crypto` to `storage`.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-2a93e444b612bd9853c32889fb82c4041760536f84356bb0db04738c19b62dde">+125/-0</a>&nbsp;
</td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>schema.json</strong><dd><code>Remove access logs
configuration from schema</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

cli/linter/schema.json

- Removed `access_logs` configuration from the schema.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-103cec746d3e61d391c5a67c171963f66fea65d651d704d5540e60aa5d574f46">+0/-9</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    
</table></details></td></tr><tr><td><strong>Bug
fix</strong></td><td><details><summary>2 files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>handler_error.go</strong><dd><code>Remove transaction
log printing in error handler</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

gateway/handler_error.go

- Removed transaction log printing for error situations.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-d3b05530ad23401f3b8f33bb1a467cd807a29a6b09c7430d01d069f626b20f77">+0/-7</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>handler_success.go</strong><dd><code>Remove transaction
log printing in success handler</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

gateway/handler_success.go

- Removed transaction log printing for successful requests.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-45135957493eca37f2e3e9a81079577777133c53b27cf95ea2ff0329c05bd006">+2/-8</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    

</table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>3
files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>handler_error_test.go</strong><dd><code>Remove access
logs benchmark tests from error handler tests</code></dd></summary>
<hr>

gateway/handler_error_test.go

- Removed benchmark tests related to access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-530de66339b5f5dbe9e19144fe4215f0aa021c8414c8f3b840d3175b2d6675da">+0/-51</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>handler_success_test.go</strong><dd><code>Remove access
logs benchmark tests from success handler tests</code></dd></summary>
<hr>

gateway/handler_success_test.go

- Removed benchmark tests related to access logs.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-42a565d872ff6c1f380386f4ee2f75bfa87991b52728a1a9a1772452bb0cd1bb">+0/-55</a>&nbsp;
&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
<summary><strong>access_log_test.go</strong><dd><code>Remove access log
tests</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/accesslog/access_log_test.go

- Deleted the entire file related to access log tests.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-7e171bde9a23d0039c5dd0c1f0718a1da2dcf93211f997ce8798d4a9a14450f0">+0/-99</a>&nbsp;
&nbsp; </td>

</tr>                    
</table></details></td></tr><tr><td><strong>Configuration
changes</strong></td><td><details><summary>1 files</summary><table>
<tr>
  <td>
    <details>
<summary><strong>Taskfile.yml</strong><dd><code>Update test command in
Taskfile</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

internal/httputil/Taskfile.yml

- Updated test command to remove specific coverage package.


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/6524/files#diff-31877aaad48d3baf442aa52077c28b873df2f2ac6c70941d409261460d7c3c8e">+1/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>                    
</table></details></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools
and their descriptions
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.

5 participants