-
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.
- Loading branch information
1 parent
cbec6a4
commit 8367444
Showing
13 changed files
with
1,991 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
test/fixtures/resources/BN001-incorrect-resources/apiproxy/BN001-xsd-resources.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 @@ | ||
<APIProxy revision="1" name="BN001-xsd-resources"> | ||
<ConfigurationVersion minorVersion="0" majorVersion="4"/> | ||
<CreatedAt>1489339923158</CreatedAt> | ||
<CreatedBy>dino</CreatedBy> | ||
<Description/> | ||
<DisplayName>BN001-xsd-resources</DisplayName> | ||
<LastModifiedAt>1489340418969</LastModifiedAt> | ||
<LastModifiedBy>orgAdmin</LastModifiedBy> | ||
<TargetEndpoints/> | ||
</APIProxy> |
5 changes: 5 additions & 0 deletions
5
...ixtures/resources/BN001-incorrect-resources/apiproxy/policies/AM-CleanResponseHeaders.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,5 @@ | ||
<AssignMessage name='AM-CleanResponseHeaders'> | ||
<Remove> | ||
<Headers/> | ||
</Remove> | ||
</AssignMessage> |
7 changes: 7 additions & 0 deletions
7
...res/resources/BN001-incorrect-resources/apiproxy/policies/AM-InjectProxyVersionHeader.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 @@ | ||
<AssignMessage name="AM-InjectProxyVersionHeader"> | ||
<Set> | ||
<Headers> | ||
<Header name="apiproxy">{apiproxy.name} r{apiproxy.revision}</Header> | ||
</Headers> | ||
</Set> | ||
</AssignMessage> |
24 changes: 24 additions & 0 deletions
24
test/fixtures/resources/BN001-incorrect-resources/apiproxy/policies/AM-Response-1.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,24 @@ | ||
<AssignMessage name='AM-Response-1'> | ||
|
||
<AssignVariable> | ||
<Name>t</Name> | ||
<Template>{timeFormatUTCMs(propertyset.set1.timeformat,system.timestamp)}</Template> | ||
</AssignVariable> | ||
|
||
<AssignVariable> | ||
<Name>d</Name> | ||
<Template>{timeFormatUTCMs(propertyset.set1.dateformat,system.timestamp)}</Template> | ||
</AssignVariable> | ||
|
||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
<Set> | ||
<Payload contentType='application/json'>{ | ||
"status" : "ok", | ||
"time" : "{t}", | ||
"date" : "{d}" | ||
}</Payload> | ||
<ReasonPhrase>OK</ReasonPhrase> | ||
<StatusCode>200</StatusCode> | ||
</Set> | ||
<AssignTo>response</AssignTo> | ||
</AssignMessage> |
16 changes: 16 additions & 0 deletions
16
test/fixtures/resources/BN001-incorrect-resources/apiproxy/policies/JS-1.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,16 @@ | ||
<Javascript name='JS-1' timeLimit='200' > | ||
<Source> | ||
function getProp(setname, shortpropname) { | ||
try { | ||
var name = 'propertyset.' + setname + '.' + shortpropname; | ||
var c = String(context.getVariable(name)); | ||
return c; | ||
} | ||
catch (e) { | ||
return String(e); | ||
} | ||
} | ||
var keys = ['value1','value2','bailiwick','identifier'] | ||
keys.forEach(function(k) {getProp('set1',k);}); | ||
</Source> | ||
</Javascript> |
4 changes: 4 additions & 0 deletions
4
test/fixtures/resources/BN001-incorrect-resources/apiproxy/policies/MV-1.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,4 @@ | ||
<MessageValidation name="MV-1"> | ||
<Source>message</Source> | ||
<ResourceURL>xsd://ProduceService.xsd</ResourceURL> | ||
</MessageValidation> |
16 changes: 16 additions & 0 deletions
16
test/fixtures/resources/BN001-incorrect-resources/apiproxy/policies/RF-UnknownRequest.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,16 @@ | ||
<RaiseFault name='RF-UnknownRequest'> | ||
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> | ||
<FaultResponse> | ||
<Set> | ||
<Payload contentType='application/json'>{ | ||
"error" : { | ||
"code" : 404.01, | ||
"message" : "that request was unknown; try a different request." | ||
} | ||
} | ||
</Payload> | ||
<StatusCode>404</StatusCode> | ||
<ReasonPhrase>Not Found</ReasonPhrase> | ||
</Set> | ||
</FaultResponse> | ||
</RaiseFault> |
75 changes: 75 additions & 0 deletions
75
test/fixtures/resources/BN001-incorrect-resources/apiproxy/proxies/endpoint1.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,75 @@ | ||
<ProxyEndpoint name="endpoint1"> | ||
<Description>Proxy Endpoint 1</Description> | ||
<HTTPProxyConnection> | ||
<BasePath>/BN001-propertiesset-demo1</BasePath> | ||
<Properties/> | ||
<VirtualHost>secure</VirtualHost> | ||
</HTTPProxyConnection> | ||
|
||
<FaultRules/> | ||
<DefaultFaultRule name="fault-rule"> | ||
<Step> | ||
<Name>AM-InjectProxyVersionHeader</Name> | ||
</Step> | ||
<AlwaysEnforce>true</AlwaysEnforce> | ||
</DefaultFaultRule> | ||
|
||
<PreFlow name="PreFlow"> | ||
<Request> | ||
<Step> | ||
<Name>JS-1</Name> | ||
</Step> | ||
</Request> | ||
<Response> | ||
<Step> | ||
<Name>AM-CleanResponseHeaders</Name> | ||
</Step> | ||
</Response> | ||
</PreFlow> | ||
<PostFlow name="PostFlow"> | ||
<Request> | ||
</Request> | ||
<Response> | ||
<Step> | ||
<Name>AM-InjectProxyVersionHeader</Name> | ||
</Step> | ||
</Response> | ||
</PostFlow> | ||
<PostClientFlow name="PostClientFlow"> | ||
<Request> | ||
</Request> | ||
<Response> | ||
</Response> | ||
</PostClientFlow> | ||
|
||
<Flows> | ||
|
||
<Flow name="flow1"> | ||
<Request> | ||
<Step> | ||
<Name>MV-1</Name> | ||
</Step> | ||
</Request> | ||
<Response> | ||
<Step> | ||
<Name>AM-Response-1</Name> | ||
</Step> | ||
</Response> | ||
<Condition>(proxy.pathsuffix MatchesPath "/t1") and (request.verb = "POST")</Condition> | ||
</Flow> | ||
|
||
<Flow name="unknown request"> | ||
<Request> | ||
<Step> | ||
<Name>RF-UnknownRequest</Name> | ||
</Step> | ||
</Request> | ||
<Response> | ||
</Response> | ||
</Flow> | ||
|
||
</Flows> | ||
|
||
<RouteRule name="NoRouteRule"/> | ||
|
||
</ProxyEndpoint> |
Empty file.
Oops, something went wrong.