Skip to content

Instantly share code, notes, and snippets.

@RackerWilliams
RackerWilliams / container.cfg.xml
Created April 24, 2013 20:43
Logging in Repose
<repose-container xmlns='http://docs.rackspacecloud.com/repose/container/v2.0'>
<deployment-config http-port="8080" connection-timeout="30000" read-timeout="30000" client-request-logging="true">
<deployment-directory auto-clean="false">/Users/jorgew/powerapi/deploy</deployment-directory>
<artifact-directory check-interval="60000">/Users/jorgew/powerapi/artifacts</artifact-directory>
<logging-configuration href="log4j.properties"/>
</deployment-config>
</repose-container>
@RackerWilliams
RackerWilliams / gist:9280415
Created February 28, 2014 21:36
Test Script
from build import create_war_fromjar
create_war_fromjar("Test.war", "../../clamped/clamped-0.1-single.jar",
"MyApplication")
@RackerWilliams
RackerWilliams / compute.wadl.xml
Created August 26, 2015 06:10
compute WADL ips issue
<resource id="ips" path="ips">
<method href="#getServerAddresses"/>
<resource id="Network_label" path="{network_label}"
type="#NetworkAddressList">
<param xmlns="http://wadl.dev.java.net/2009/02" name="network_label" style="template"
type="xsd:string">
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook" title="network_label">
<para>The network label, such as <literal>public</literal> or
<literal>private</literal>.</para>
</wadl:doc>
@RackerWilliams
RackerWilliams / ExpressionProcessor.scala
Created May 26, 2017 19:58
ExpressionProcessor.scala
/***
* Copyright 2017 Rackspace US, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
xquery version "3.0" encoding "UTF-8";
declare namespace mapping = "http://docs.rackspace.com/identity/api/ext/MappingRules";
<mapping:remoteNS>
{
for $remote in //mapping:remote/mapping:attribute[@path] return
<mapping:remote>
{
@RackerWilliams
RackerWilliams / xpath-rule.yaml
Last active June 29, 2017 21:09
YAML attribute mapping rule with a complex XPath
---
mapping:
rules:
- remote:
- path: |
(:
If the number of seconds is even, then the role should be
nova:admin and lbaas:admin
Otherwise the roles should be nova:observe and lbaas:observer.
@RackerWilliams
RackerWilliams / xpath-rule.js
Created June 29, 2017 21:11
JSON attribute mapping rule with a complex XPath
{
"mapping": {
"rules": [
{
"remote": [
{
"path": "(:\n If the number of seconds is even, then the role should be\n nova:admin and lbaas:admin\n\n Otherwise the roles should be nova:observe and lbaas:observer.\n:)\nif ((xs:integer(seconds-from-time(current-time())) mod 2) = 0)\n then ('nova:admin','lbaas:admin')\n else ('nova:observer','lbaas:observer')\n",
"multiValue": true
}
],
@RackerWilliams
RackerWilliams / xpath-rule.xml
Last active June 29, 2017 21:16
XML attribute mapping rule with complex XPath
<?xml version="1.0" encoding="UTF-8"?>
<mapping xmlns="http://docs.rackspace.com/identity/api/ext/MappingRules"
xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="RAX-1">
<rules>
<rule>
<remote>
<attribute multiValue="true"
@RackerWilliams
RackerWilliams / test-times.org
Created August 11, 2017 14:24
Saxon 9.7 vs Saxon 9.8 all Feeds WADL

Saxon 9.7

COLD (First Run)

time wadl2checker -dgxlpjHbr -t 20 -S SaxonEE -E XalanC allfeeds.wadl allfeeds.checker

[parseWADL : 17 Millis]
[schematronWADL : [compile /xsl/wadl-links.xsl : 369 Millis] 6749 Millis]
[svrlHandler : [compile /xsl/svrl-handler.xsl : 11 Millis] 31 Millis]
[Check Additional SRVL Reports : [compile XVRLCheck XPath : 3 Millis] 11 Millis]
[validateWADL : [SaxonEE wadl schema compile : 71 Millis] 102 Millis]
@RackerWilliams
RackerWilliams / mkpolicy.yaml
Last active September 26, 2017 21:24
MK Policy
---
mapping:
version: RAX-1
rules:
- local:
user:
domain: '1025468' # Can eventually just be {D}
email: "{At(urn:oid:1.2.840.113549.1.9.1.1)}" # Can also be {D}
expire: "{Pt(/saml2p:Response/saml2:Assertion/saml2:Conditions/@NotOnOrAfter[1])}" # Ditto {D} unless you specifically want it from cond
name: "{D}"