-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #484 from DinoChiesa/issue483-CC005
fix: issue483 CC005 no longer modifies truthtable
- Loading branch information
Showing
32 changed files
with
851 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
test/fixtures/resources/CC005/issue483/apiproxy/policies/AssignMessageAPIKeyFault.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageAPIKeyFault"> | ||
<DisplayName>AssignMessageAPIKeyFault</DisplayName> | ||
<AssignVariable> | ||
<Name>user.message</Name> | ||
<Value>The application is not authorized to make this request</Value> | ||
</AssignVariable> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
</AssignMessage> |
29 changes: 29 additions & 0 deletions
29
test/fixtures/resources/CC005/issue483/apiproxy/policies/AssignMessageAddCORS.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageAddCORS"> | ||
<DisplayName>AssignMessageAddCORS</DisplayName> | ||
<FaultRules> | ||
<FaultRule name="serviceCalloutError"> | ||
<Step> | ||
<Name>AssignServiceCalloutErrorResponse</Name> | ||
</Step> | ||
<Step> | ||
<Name>InitializeResponseLog</Name> | ||
</Step> | ||
<Step> | ||
<Name>FlowCalloutLogging</Name> | ||
</Step> | ||
</FaultRule> | ||
</FaultRules> | ||
<Properties /> | ||
<Set> | ||
<Headers> | ||
<Header name="Access-Control-Allow-Origin">*</Header> | ||
<Header name="Access-Control-Allow-Headers">origin, x-requested-with, authorization, | ||
accept, content-type, client_id, X-NW-Message-ID</Header> | ||
<Header name="Access-Control-Max-Age">3628800</Header> | ||
<Header name="Access-Control-Allow-Methods">GET, PUT, POST, OPTIONS</Header> | ||
</Headers> | ||
</Set> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
<AssignTo createNew="false" transport="http" type="response" /> | ||
</AssignMessage> |
9 changes: 9 additions & 0 deletions
9
...s/resources/CC005/issue483/apiproxy/policies/AssignMessageDestinationUnreachableFault.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageDestinationUnreachableFault"> | ||
<DisplayName>AssignMessageDestinationUnreachableFault</DisplayName> | ||
<AssignVariable> | ||
<Name>user.message</Name> | ||
<Value>Service unavailable - please try again later</Value> | ||
</AssignVariable> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
</AssignMessage> |
18 changes: 18 additions & 0 deletions
18
...ixtures/resources/CC005/issue483/apiproxy/policies/AssignMessageGenerateFaultResponse.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageGenerateFaultResponse"> | ||
<DisplayName>AssignMessageGenerateFaultResponse</DisplayName> | ||
<Set> | ||
<Headers> | ||
<Header name="Content-Type">application/json</Header> | ||
</Headers> | ||
<Payload contentType="application/json"> | ||
{ "userMessage": "{user.message}", | ||
"developerMessage": {error.content}, | ||
"messageID": "{request.header.X-NW-Message-ID}", | ||
"code": {error.status.code} | ||
} | ||
</Payload> | ||
</Set> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
<AssignTo createNew="false" transport="http" type="response"/> | ||
</AssignMessage> |
9 changes: 9 additions & 0 deletions
9
test/fixtures/resources/CC005/issue483/apiproxy/policies/AssignMessageGenericFault.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageGenericFault"> | ||
<DisplayName>AssignMessageGenericFault</DisplayName> | ||
<AssignVariable> | ||
<Name>user.message</Name> | ||
<Value>Server error</Value> | ||
</AssignVariable> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
</AssignMessage> |
10 changes: 10 additions & 0 deletions
10
test/fixtures/resources/CC005/issue483/apiproxy/policies/AssignMessageGenericOauthError.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageGenericOauthError"> | ||
<DisplayName>AssignMessageGenericOauthError</DisplayName> | ||
<AssignVariable> | ||
<Name>user.message</Name> | ||
<Value>The user is not authorized to make this request</Value> | ||
</AssignVariable> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
<AssignTo createNew="false" transport="http" type="request"/> | ||
</AssignMessage> |
9 changes: 9 additions & 0 deletions
9
test/fixtures/resources/CC005/issue483/apiproxy/policies/AssignMessageJSTimeoutFault.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageJSTimeoutFault"> | ||
<DisplayName>AssignMessageJSTimeoutFault</DisplayName> | ||
<AssignVariable> | ||
<Name>user.message</Name> | ||
<Value>Javscript execution has exceeded the time limit set.</Value> | ||
</AssignVariable> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
</AssignMessage> |
13 changes: 13 additions & 0 deletions
13
...ixtures/resources/CC005/issue483/apiproxy/policies/AssignMessageRemoveSecurityHeaders.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageRemoveSecurityHeaders"> | ||
<DisplayName>AssignMessageRemoveSecurityHeaders</DisplayName> | ||
<Properties/> | ||
<Remove> | ||
<Headers> | ||
<Header name="client_id"/> | ||
<Header name="Authorization"/> | ||
</Headers> | ||
</Remove> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
<AssignTo createNew="false" transport="http" type="request"/> | ||
</AssignMessage> |
17 changes: 17 additions & 0 deletions
17
test/fixtures/resources/CC005/issue483/apiproxy/policies/AssignMessageResourceNotFound.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageResourceNotFound"> | ||
<DisplayName>AssignMessageResourceNotFound</DisplayName> | ||
<Properties/> | ||
<Set> | ||
<!-- Note: the payload is the error.content, so it can be set in AssignVariable | ||
or in <Set> <Payload> depending on how complex the value needs to be. In | ||
this example a combination of string literal with variable substitution was | ||
desired, so the <Payload> approach was used. --> | ||
<Payload>Resource name: {proxy.pathsuffix}, method: {request.verb}</Payload> | ||
</Set> | ||
<AssignVariable> | ||
<Name>user.message</Name> | ||
<Value>The resource requested was not found</Value> | ||
</AssignVariable> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
</AssignMessage> |
10 changes: 10 additions & 0 deletions
10
test/fixtures/resources/CC005/issue483/apiproxy/policies/AssignMessageSQLInjectionFault.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageSQLInjectionFault"> | ||
<DisplayName>AssignMessageSQLInjectionFault</DisplayName> | ||
<AssignVariable> | ||
<Name>user.message</Name> | ||
<Value>Bad Request</Value> | ||
</AssignVariable> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
<AssignTo createNew="false" transport="http" type="request"/> | ||
</AssignMessage> |
20 changes: 20 additions & 0 deletions
20
test/fixtures/resources/CC005/issue483/apiproxy/policies/AssignMessageSetTargetHost.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageSetTargetHost"> | ||
<DisplayName>AssignMessageSetTargetHost</DisplayName> | ||
<Set> | ||
<Headers> | ||
<Header name="X-NW-Target-URL">{target-url}{proxy.pathsuffix}?{request.querystring}</Header> | ||
<Header name="X-NW-Internal-FWD">false</Header> | ||
</Headers> | ||
</Set> | ||
<AssignVariable> | ||
<Name>target.copy.pathsuffix</Name> | ||
<Value>false</Value> | ||
</AssignVariable> | ||
<AssignVariable> | ||
<Name>target.copy.queryparams</Name> | ||
<Value>false</Value> | ||
</AssignVariable> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
<AssignTo createNew="false" transport="http" type="request"/> | ||
</AssignMessage> |
15 changes: 15 additions & 0 deletions
15
test/fixtures/resources/CC005/issue483/apiproxy/policies/AssignMessageSpikeArrestFault.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<AssignMessage async="false" continueOnError="false" enabled="true" name="AssignMessageSpikeArrestFault"> | ||
<DisplayName>AssignMessageSpikeArrestFault</DisplayName> | ||
<Properties/> | ||
<Set> | ||
<StatusCode>429</StatusCode> | ||
<ReasonPhrase>Spike Arrest Rate Limiting</ReasonPhrase> | ||
</Set> | ||
<AssignVariable> | ||
<Name>user.message</Name> | ||
<Value>Too many requests in a given amount of time</Value> | ||
</AssignVariable> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
<AssignTo createNew="false" transport="http" type="request"/> | ||
</AssignMessage> |
7 changes: 7 additions & 0 deletions
7
test/fixtures/resources/CC005/issue483/apiproxy/policies/FlowCalloutLogging.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<FlowCallout async="false" continueOnError="false" enabled="true" name="FlowCalloutLogging"> | ||
<DisplayName>FlowCalloutLogging</DisplayName> | ||
<FaultRules/> | ||
<Properties/> | ||
<SharedFlowBundle>EnterpriseLogging_1</SharedFlowBundle> | ||
</FlowCallout> |
11 changes: 11 additions & 0 deletions
11
test/fixtures/resources/CC005/issue483/apiproxy/policies/JSONThreatProtection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSONThreatProtection"> | ||
<DisplayName>JSONThreatProtection</DisplayName> | ||
<Properties/> | ||
<ArrayElementCount>20</ArrayElementCount> | ||
<ContainerDepth>10</ContainerDepth> | ||
<ObjectEntryCount>15</ObjectEntryCount> | ||
<ObjectEntryNameLength>50</ObjectEntryNameLength> | ||
<Source>request</Source> | ||
<StringValueLength>500</StringValueLength> | ||
</JSONThreatProtection> |
8 changes: 8 additions & 0 deletions
8
test/fixtures/resources/CC005/issue483/apiproxy/policies/JavaScriptCatchJSErrors.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<Javascript timeLimit="120000" async="false" continueOnError="false" enabled="true" name="JavaScriptCatchJSErrors"> | ||
<DisplayName>JavaScriptCatchJSErrors</DisplayName> | ||
<FaultRules/> | ||
<Properties/> | ||
<IncludeURL>jsc://common.js</IncludeURL> | ||
<ResourceURL>jsc://catchJSErrors.js</ResourceURL> | ||
</Javascript> |
7 changes: 7 additions & 0 deletions
7
test/fixtures/resources/CC005/issue483/apiproxy/policies/JavaScriptValidateRequest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<Javascript async="false" continueOnError="false" enabled="true" timeLimit="120000" name="JavaScriptValidateRequest"> | ||
<DisplayName>JavaScriptValidateRequest</DisplayName> | ||
<Properties/> | ||
<IncludeURL>jsc://common.js</IncludeURL> | ||
<ResourceURL>jsc://validateRequest.js</ResourceURL> | ||
</Javascript> |
Oops, something went wrong.