Configuration
A sample configuration in XML, JSON, and YAML format.
- XML
- JSON
- YAML
sql.config.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cfg:configuration xmlns:cfg="http://www.axiomatics.com/jdbc.config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="">
<cfg:connnection>
<cfg:url>jdbc:postgresql://localhost/postgres?user=postgres&password=password</cfg:url>
<cfg:driver>org.postgresql.Driver</cfg:driver>
</cfg:connnection>
<cfg:mapping>
<cfg:xacmlAttribute Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="role" DataType="http://www.w3.org/2001/XMLSchema#string"/>
<cfg:nativeAttribute outputIndex="0">
<cfg:sqlType>2004</cfg:sqlType>
<cfg:query>select employee_role from employee_details where employee_name=?</cfg:query>
<cfg:key allowMultiple="false" sqlType="12" inputType="IN">
<cfg:xacmlAttribute Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="name" DataType="http://www.w3.org/2001/XMLSchema#string"/>
</cfg:key>
</cfg:nativeAttribute>
<cfg:uId>a34a514e-a5d8-4860-9dfd-71af8b7e7998</cfg:uId>
</cfg:mapping>
</cfg:configuration>
JSON configuration files offer the option to use either ALFA or XACML for attribute definitions.
- XACML
- ALFA
sql.config.json
{
"connection": {
"url": "jdbc:postgresql://localhost/postgres?user=postgres&password=password",
"driver": "org.postgresql.Driver"
},
"mappings": [
{
"xacmlAttribute": {
"category": "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject",
"attributeId": "role",
"datatype": "http://www.w3.org/2001/XMLSchema#string",
"issuer": null
},
"nativeAttribute": {
"outputIndex": 0,
"sqlType": 2004,
"query": "select employee_role from employee_details where employee_name=?",
"keys": [
{
"allowMultiple": false,
"sqlType": 12,
"inputType": "IN",
"xacmlAttribute": {
"category": "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject",
"attributeId": "name",
"datatype": "http://www.w3.org/2001/XMLSchema#string",
"issuer": null
}
}
]
},
"uId": "a34a514e-a5d8-4860-9dfd-71af8b7e7998"
}
]
}
sql.config.alfa.json
{
"connection": {
"url": "jdbc:postgresql://localhost/postgres?user=postgres&password=password",
"driver": "org.postgresql.Driver"
},
"mappings": [
{
"attributeName": "role",
"nativeAttribute": {
"outputIndex": 0,
"sqlType": 2004,
"query": "select employee_role from employee_details where employee_name=?",
"keys": [
{
"attributeName": "name",
"allowMultiple": false,
"sqlType": 12,
"inputType": "IN"
}
]
},
"uId": "a34a514e-a5d8-4860-9dfd-71af8b7e7998"
}
]
}
YAML configuration files offer the option to use either ALFA or XACML for attribute definitions.
- XACML
- ALFA
sql.config.yaml
connection:
url: "jdbc:postgresql://localhost/postgres?user=postgres&password=password"
driver: "org.postgresql.Driver"
mappings:
- xacmlAttribute:
category: "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
attributeId: "role"
datatype: "http://www.w3.org/2001/XMLSchema#string"
issuer: null
nativeAttribute:
outputIndex: 0
sqlType: 2004
query: "select employee_role from employee_details where employee_name=?"
keys:
- allowMultiple: false
sqlType: 12
inputType: "IN"
xacmlAttribute:
category: "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
attributeId: "name"
datatype: "http://www.w3.org/2001/XMLSchema#string"
issuer: null
uId: "a34a514e-a5d8-4860-9dfd-71af8b7e7998"
sql.config.alfa.yaml
connection:
url: "jdbc:postgresql://localhost/postgres?user=postgres&password=password"
driver: "org.postgresql.Driver"
mappings:
- attributeName: "role"
nativeAttribute:
outputIndex: 0
sqlType: 2004
query: "select employee_role from employee_details where employee_name=?"
keys:
- attributeName: "name"
sqlType: 12
inputType: "IN"
allowMultiple: false
uId: "a34a514e-a5d8-4860-9dfd-71af8b7e7998"