Skip to content

Instantly share code, notes, and snippets.

View klevak's full-sized avatar

Kristopher Kleva klevak

View GitHub Profile
@klevak
klevak / Script-ParseSetCookies.js
Created March 17, 2015 01:33
Apigee Script Parse Set-Cookie
var cookieParty = (function () {
function isExpiresComma(str){
// Returns a boolean indicating whether the comma at the end of the string
// is part of an expires NVP.
return /expires\s*=\s*(mon|tue|wed|thu|fri|sat|sun)\s*,$/i.test(str);
}
return {
parseCookieString: function (setCookieString){
@klevak
klevak / Extract-Api-Key-Soap-Header.xml
Created September 4, 2014 16:58
Extracting an API Key from a SOAP message header using Apigee ExtractVariables Policy
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="true" enabled="true" name="Extract-Api-Key-Soap-Header">
<DisplayName>Extract-Api-Key-Soap-Header</DisplayName>
<VariablePrefix>apigee</VariablePrefix>
<XMLPayload stopPayloadProcessing="true">
<Variable name="apikey" type="string">
<XPath>//*[local-name()='apiAppKey']</XPath>
</Variable>
</XMLPayload>
</ExtractVariables>
@klevak
klevak / api.json
Last active August 29, 2015 14:04 — forked from kinlane/api.json
{
"name": "API Commons",
"description": "An API for adding and pulling APIs that are in the commons.",
"image": "https://s3.amazonaws.com/kinlane-productions/api-commons/api-commons-icon.png",
"url": "https://api-commons.3scale.net/docs",
"type": "default",
"version": "0.12",
"apis": [
{
"name": "API Commons",
@klevak
klevak / default.xml
Created June 28, 2014 06:52
ProxyEndpoint-InvalidVerb
<?xml version="1.0" encoding="UTF-8"?>
<ProxyEndpoint name="default">
<Description/>
<FaultRules>
</FaultRules>
<Flows>
<Flow name="Get Procedures">
<Description/>
<Request>
<Step>
@klevak
klevak / StatisticsCollector-AnalyzeData.xml
Created June 28, 2014 06:47
Apigee-StatisticsCollector
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<StatisticsCollector async="false" continueOnError="false" enabled="true" name="statisticscollector-analyzedata">
<DisplayName>StatisticsCollector-AnalyzeData</DisplayName>
<FaultRules/>
<Properties/>
<Statistics>
<Statistic name="visitor_id" ref="visitor.id" type="string">id</Statistic>
<Statistic name="visitor_name" ref="visitor.name" type="string">name</Statistic>
<Statistic name="visitor_attributes" ref="visitor.attributes" type="string">attributes</Statistic>
</Statistics>