tyk icon indicating copy to clipboard operation
tyk copied to clipboard

[TT-4667] Remove fields that are related to the pump not the gateway

Open letzya opened this issue 3 years ago • 7 comments

Description

  1. fix #3906 -
  2. Fix description in policies new fields.

Related Issue

Motivation and Context

How This Has Been Tested

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

  • [ ] Make sure you are requesting to pull a topic/feature/bugfix branch (right side). If pulling from your own fork, don't request your master!
  • [ ] Make sure you are making a pull request against the master branch (left side). Also, you should start your branch off our latest master.
  • [ ] My change requires a change to the documentation.
    • [ ] If you've changed APIs, describe what needs to be updated in the documentation.
    • [ ] If new config option added, ensure that it can be set via ENV variable
  • [ ] I have updated the documentation accordingly.
  • [ ] Modules and vendor dependencies have been updated; run go mod tidy && go mod vendor
  • [ ] When updating library version must provide reason/explanation for this update.
  • [ ] I have added tests to cover my changes.
  • [ ] All new and existing tests passed.
  • [ ] Check your code additions will not fail linting checks:
    • [ ] go fmt -s
    • [ ] go vet

letzya avatar Feb 25 '22 15:02 letzya

API tests result: skipped :no_entry_sign: Branch used: refs/pull/3907/merge Commit:
Triggered by: pull_request (@letzya) Execution page

Tyk-ITS avatar Feb 25 '22 15:02 Tyk-ITS

:boom: CI tests failed :see_no_evil:

CI test log

go test -race -timeout 15m -v -coverprofile=tyk.cov github.com/TykTechnologies/tyk
?   	github.com/TykTechnologies/tyk	[no test files]
go vet github.com/TykTechnologies/tyk
go test -race -timeout 15m -v -coverprofile=apidef.cov github.com/TykTechnologies/tyk/apidef
=== RUN   TestSchema
--- PASS: TestSchema (0.02s)
=== RUN   TestEncodeForDB
=== RUN   TestEncodeForDB/update_ScopeClaim_when_Scopes.JWT_is_not_empty_and_OIDC_is_not_enabled
=== RUN   TestEncodeForDB/update_ScopeClaim_when_Scopes.OIDC_is_not_empty_and_OpenID_is_enabled
--- PASS: TestEncodeForDB (0.00s)
    --- PASS: TestEncodeForDB/update_ScopeClaim_when_Scopes.JWT_is_not_empty_and_OIDC_is_not_enabled (0.00s)
    --- PASS: TestEncodeForDB/update_ScopeClaim_when_Scopes.OIDC_is_not_empty_and_OpenID_is_enabled (0.00s)
=== RUN   TestDecodeFromDB
=== RUN   TestDecodeFromDB/update_Scopes.JWT_when_JWTScopeClaimName_is_not_empty
time="Feb 25 16:32:22" level=error msg="Couldn't Decode, leaving as it may be legacy..."
=== RUN   TestDecodeFromDB/update_Scopes.OIDC_when_JWTScopeClaimName_is_not_empty_and_OpenID_is_enabled
time="Feb 25 16:32:22" level=error msg="Couldn't Decode, leaving as it may be legacy..."
--- PASS: TestDecodeFromDB (0.00s)
    --- PASS: TestDecodeFromDB/update_Scopes.JWT_when_JWTScopeClaimName_is_not_empty (0.00s)
    --- PASS: TestDecodeFromDB/update_Scopes.OIDC_when_JWTScopeClaimName_is_not_empty_and_OpenID_is_enabled (0.00s)
=== RUN   TestSchemaGraphqlConfig
--- PASS: TestSchemaGraphqlConfig (0.01s)
=== RUN   TestAPIDefinition_DecodeFromDB_AuthDeprecation
time="Feb 25 16:32:22" level=error msg="Couldn't Decode, leaving as it may be legacy..."
time="Feb 25 16:32:22" level=error msg="Couldn't Decode, leaving as it may be legacy..."
--- PASS: TestAPIDefinition_DecodeFromDB_AuthDeprecation (0.00s)
=== RUN   TestAPIDefinition_MigrateVersioning
--- PASS: TestAPIDefinition_MigrateVersioning (0.00s)
=== RUN   TestAPIDefinition_MigrateVersioning_Disabled
=== RUN   TestAPIDefinition_MigrateVersioning_Disabled/multiple_versions
=== RUN   TestAPIDefinition_MigrateVersioning_Disabled/one_version
--- PASS: TestAPIDefinition_MigrateVersioning_Disabled (0.00s)
    --- PASS: TestAPIDefinition_MigrateVersioning_Disabled/multiple_versions (0.00s)
    --- PASS: TestAPIDefinition_MigrateVersioning_Disabled/one_version (0.00s)
=== RUN   TestAPIDefinition_MigrateVersioning_DefaultEmpty
=== RUN   TestAPIDefinition_MigrateVersioning_DefaultEmpty/Default
--- PASS: TestAPIDefinition_MigrateVersioning_DefaultEmpty (0.00s)
    --- PASS: TestAPIDefinition_MigrateVersioning_DefaultEmpty/Default (0.00s)
=== RUN   TestAPIDefinition_MigrateVersioning_Expires
=== RUN   TestAPIDefinition_MigrateVersioning_Expires/version_enabled
=== RUN   TestAPIDefinition_MigrateVersioning_Expires/version_disabled
--- PASS: TestAPIDefinition_MigrateVersioning_Expires (0.00s)
    --- PASS: TestAPIDefinition_MigrateVersioning_Expires/version_enabled (0.00s)
    --- PASS: TestAPIDefinition_MigrateVersioning_Expires/version_disabled (0.00s)
=== RUN   TestAPIDefinition_MigrateVersioning_OverrideTarget
=== RUN   TestAPIDefinition_MigrateVersioning_OverrideTarget/base
=== RUN   TestAPIDefinition_MigrateVersioning_OverrideTarget/version
--- PASS: TestAPIDefinition_MigrateVersioning_OverrideTarget (0.00s)
    --- PASS: TestAPIDefinition_MigrateVersioning_OverrideTarget/base (0.00s)
    --- PASS: TestAPIDefinition_MigrateVersioning_OverrideTarget/version (0.00s)
=== RUN   TestAPIDefinition_MigrateVersioning_StripPath
=== RUN   TestAPIDefinition_MigrateVersioning_StripPath/url
=== RUN   TestAPIDefinition_MigrateVersioning_StripPath/param
=== RUN   TestAPIDefinition_MigrateVersioning_StripPath/header
--- PASS: TestAPIDefinition_MigrateVersioning_StripPath (0.00s)
    --- PASS: TestAPIDefinition_MigrateVersioning_StripPath/url (0.00s)
    --- PASS: TestAPIDefinition_MigrateVersioning_StripPath/param (0.00s)
    --- PASS: TestAPIDefinition_MigrateVersioning_StripPath/header (0.00s)
=== RUN   TestAPIDefinition_MigrateEndpointMeta
--- PASS: TestAPIDefinition_MigrateEndpointMeta (0.00s)
=== RUN   TestAPIDefinition_MigrateCachePlugin
--- PASS: TestAPIDefinition_MigrateCachePlugin (0.00s)
=== RUN   TestAPIDefinition_MigrateAuthConfigNames
--- PASS: TestAPIDefinition_MigrateAuthConfigNames (0.00s)
=== RUN   TestValidationResult_HasErrors
--- PASS: TestValidationResult_HasErrors (0.00s)
=== RUN   TestValidationResult_FirstError
--- PASS: TestValidationResult_FirstError (0.00s)
=== RUN   TestValidationResult_ErrorStrings
--- PASS: TestValidationResult_ErrorStrings (0.00s)
=== RUN   TestRuleUniqueDataSourceNames_Validate
=== RUN   TestRuleUniqueDataSourceNames_Validate/should_return_invalid_when_data_source_name_is_duplicated
=== RUN   TestRuleUniqueDataSourceNames_Validate/return_valid_when_data_source_names_are_not_duplicated
=== RUN   TestRuleUniqueDataSourceNames_Validate/return_valid_when_there_are_no_data_sources
--- PASS: TestRuleUniqueDataSourceNames_Validate (0.01s)
    --- PASS: TestRuleUniqueDataSourceNames_Validate/should_return_invalid_when_data_source_name_is_duplicated (0.00s)
    --- PASS: TestRuleUniqueDataSourceNames_Validate/return_valid_when_data_source_names_are_not_duplicated (0.00s)
    --- PASS: TestRuleUniqueDataSourceNames_Validate/return_valid_when_there_are_no_data_sources (0.00s)
=== RUN   TestRuleAtLeastEnableOneAuthConfig_Validate
=== RUN   TestRuleAtLeastEnableOneAuthConfig_Validate/should_return_invalid_when_all_sources_are_disabled_for_enabled_auth_mechanisms
    validator_test.go:46: 
        	Error Trace:	validator_test.go:46
        	Error:      	Not equal: 
        	            	expected: apidef.ValidationResult{IsValid:false, Errors:[]error{(*errors.errorString)(0xc00042e0c0), (*errors.errorString)(0xc00042e0d0)}}
        	            	actual  : apidef.ValidationResult{IsValid:false, Errors:[]error{(*errors.errorString)(0xc00042e120), (*errors.errorString)(0xc00042e150)}}
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -4,6 +4,6 @@
        	            	   (*errors.errorString)({
        	            	-   s: (string) (len=96) "all auth sources are disabled for authToken, at least one of header/cookie/query must be enabled"
        	            	+   s: (string) (len=92) "all auth sources are disabled for oauth, at least one of header/cookie/query must be enabled"
        	            	   }),
        	            	   (*errors.errorString)({
        	            	-   s: (string) (len=92) "all auth sources are disabled for oauth, at least one of header/cookie/query must be enabled"
        	            	+   s: (string) (len=96) "all auth sources are disabled for authToken, at least one of header/cookie/query must be enabled"
        	            	   })
        	Test:       	TestRuleAtLeastEnableOneAuthConfig_Validate/should_return_invalid_when_all_sources_are_disabled_for_enabled_auth_mechanisms
=== RUN   TestRuleAtLeastEnableOneAuthConfig_Validate/should_return_valid_when_at_least_one_source_is_enabled_for_enabled_auth_mechanisms
--- FAIL: TestRuleAtLeastEnableOneAuthConfig_Validate (0.00s)
    --- FAIL: TestRuleAtLeastEnableOneAuthConfig_Validate/should_return_invalid_when_all_sources_are_disabled_for_enabled_auth_mechanisms (0.00s)
    --- PASS: TestRuleAtLeastEnableOneAuthConfig_Validate/should_return_valid_when_at_least_one_source_is_enabled_for_enabled_auth_mechanisms (0.00s)
FAIL
coverage: 61.5% of statements
FAIL	github.com/TykTechnologies/tyk/apidef	0.099s
FAIL
Test Failed

gofmt

ctx/ctx.go dlpython/helpers.go

goimports

ctx/ctx.go dlpython/helpers.go

If the above are ok, please look at the run or in the Checks tab.

github-actions[bot] avatar Feb 25 '22 16:02 github-actions[bot]

API tests result: skipped :no_entry_sign: Branch used: refs/pull/3907/merge Commit: 9c1684a819e226e8de5260d1fd2d2d20188f5782 Triggered by: pull_request (@letzya) Execution page

Tyk-ITS avatar Feb 25 '22 16:02 Tyk-ITS

API tests result: success :white_check_mark: Branch used: refs/pull/3907/merge Commit: 934911a76ebeb10b64fd571b3e8a8da5e8fdc5d6 Triggered by: pull_request (@letzya) Execution page

Tyk-ITS avatar Mar 07 '22 12:03 Tyk-ITS

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Mar 07 '22 12:03 sonarqubecloud[bot]

@furkansenharputlu could you approve this quickly? Seems like an easy one.

agata-wit avatar Mar 07 '22 21:03 agata-wit

@letzya I think this is ready to merge, right?

agata-wit avatar Mar 30 '22 08:03 agata-wit

Another instance of incorrect analytics_config.tyk value is https://github.com/TykTechnologies/tyk/blob/master/ci/tests/python-plugins/src/tyk.conf#L42 (it should either be empty string or rpc).

Other that that I think this is ready to merge.

Reference: AnalyticsConfigConfig https://github.com/TykTechnologies/tyk/blob/master/config/config.go#L166

armujahid avatar Nov 29 '22 12:11 armujahid

API tests result: success :white_check_mark: Branch used: refs/pull/3907/merge Commit: 26c0be4e57ae528f9a5a797795c1f785052b04cf Triggered by: pull_request (@letzya) Execution page

Tyk-ITS avatar Nov 29 '22 13:11 Tyk-ITS

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Dec 03 '22 13:12 sonarqubecloud[bot]

API tests result: success :white_check_mark: Branch used: refs/pull/3907/merge Commit: ec4d7373425159e904d0c4ad45a3b6afcf5c1527 Triggered by: pull_request (@letzya) Execution page

Tyk-ITS avatar Dec 03 '22 13:12 Tyk-ITS

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Mar 31 '23 16:03 sonarqubecloud[bot]

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

API tests result: success :white_check_mark: Branch used: refs/pull/3907/merge Commit: 472f1c2511bfc770d8861a59f1f150f28d3a5d09 Triggered by: pull_request (@letzya) Execution page

Tyk-ITS avatar Mar 31 '23 16:03 Tyk-ITS

API Changes

--- prev.txt	2023-09-04 18:34:29.143981843 +0000
+++ current.txt	2023-09-04 18:34:24.419749829 +0000
@@ -5095,7 +5095,7 @@
 	// This option should only be used when moving an installation to a new database.
 	AllowExplicitPolicyID bool `json:"allow_explicit_policy_id"`
 	// This option is used for storing a policies  if `policies.policy_source` is set to `file`.
-	// it should be some existing file path on hard drive
+	// it should be some existing directory path on hard drive
 	PolicyPath string `json:"policy_path"`
 }
 

github-actions[bot] avatar Sep 04 '23 18:09 github-actions[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Sep 04 '23 18:09 sonarqubecloud[bot]

API tests result: success :white_check_mark: Branch used: refs/pull/3907/merge Commit: 5f2209287d4bfc3f2787f8c2a8adb6492cc18f65 Triggered by: pull_request (@letzya) Execution page

Tyk-ITS avatar Sep 04 '23 18:09 Tyk-ITS