[TT-4667] Remove fields that are related to the pump not the gateway
Description
- fix #3906 -
- 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
masterbranch (left side). Also, you should start your branch off our latestmaster. - [ ] 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
- [ ]
API tests result: skipped :no_entry_sign:
Branch used: refs/pull/3907/merge
Commit:
Triggered by: pull_request (@letzya)
Execution page
: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.
API tests result: skipped :no_entry_sign: Branch used: refs/pull/3907/merge Commit: 9c1684a819e226e8de5260d1fd2d2d20188f5782 Triggered by: pull_request (@letzya) Execution page
API tests result: success :white_check_mark: Branch used: refs/pull/3907/merge Commit: 934911a76ebeb10b64fd571b3e8a8da5e8fdc5d6 Triggered by: pull_request (@letzya) Execution page
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
@furkansenharputlu could you approve this quickly? Seems like an easy one.
@letzya I think this is ready to merge, right?
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
API tests result: success :white_check_mark: Branch used: refs/pull/3907/merge Commit: 26c0be4e57ae528f9a5a797795c1f785052b04cf Triggered by: pull_request (@letzya) Execution page
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
API tests result: success :white_check_mark: Branch used: refs/pull/3907/merge Commit: ec4d7373425159e904d0c4ad45a3b6afcf5c1527 Triggered by: pull_request (@letzya) Execution page
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
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
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"`
}
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
API tests result: success :white_check_mark: Branch used: refs/pull/3907/merge Commit: 5f2209287d4bfc3f2787f8c2a8adb6492cc18f65 Triggered by: pull_request (@letzya) Execution page