Audit Alfresco Authority Deletion: no event is recorded - alfresco

My goal is to audit deletion of authorities in Alfresco. When audit logging is enabled (which generates a lot of log entries), deleting a group results in these log entries (shortend):
/alfresco-api/pre/AuthorityService/deleteAuthority/args/name=GROUP_test_group_for_audit
/alfresco-node/beforeDeleteNode/node=workspace://SpacesStore/a4f5e9bb-6584-4997-a550-6080d0dce177
/alfresco-api/post/AuthorityService/deleteAuthority/args/name=GROUP_test_group_for_audit
/alfresco-api/post/AuthorityService/deleteAuthority/no-error=null
If I understand the documentation correctly, an audit XML file like this should record the first event:
<?xml version='1.0' encoding='UTF-8'?>
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<DataExtractors>
<DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue"/>
</DataExtractors>
<DataGenerators>
<DataGenerator name="currentUser" class="org.alfresco.repo.audit.generator.AuthenticatedUserDataGenerator"/>
<DataGenerator name="personFullName" class="org.alfresco.repo.audit.generator.AuthenticatedPersonDataGenerator"/>
</DataGenerators>
<PathMappings>
<PathMap source="/alfresco-api/pre/AuthorityService/deleteAuthority" target="/deleteAuthority"/>
</PathMappings>
<Application name="DeleteAuthority" key="deleteAuthority">
<AuditPath key="deleteAuthority">
<RecordValue key="name" dataExtractor="simpleValue" dataSource="/deleteAuthority/args/name"/>
</AuditPath>
</Application>
</Audit>
Note that in the source of the PathMap I use the path /alfresco-api/pre/AuthorityService/deleteAuthority as it appears in the first log entry. This looks correct to me, even though I am quite unsure how the Application element should look.
Putting this into the XML file tomcat/shared/classes/alfresco/extension/audit/alfresco-audit-deleteAuthority-extractors.xml registers the application correclty:
$ curl -u 'admin:secret' http://alfresco:8080/alfresco/service/api/audit/control
{
"enabled" : true,
"applications":
[
{
"name": "Alfresco Tagging Service",
"path" : "/tagging",
"enabled" : true
}
,
{
"name": "DeleteAuthority",
"path" : "/deleteAuthority",
"enabled" : true
}
,
{
"name": "alfresco-access",
"path" : "/alfresco-access",
"enabled" : true
}
]
}
But when I now delete a group, nothing is recorded. A query for the application returns an empty result:
$ curl -u 'admin:secret' http://alfresco:8080/alfresco/service/api/audit/query/DeleteAuthority
{
"count":0,
"entries":
[
]
}
Question: Is my above audit application configuration correct? How would I have to change it to generate audit entries for the deletion of authorities?

Your path-mapping section is correct, your application definition though is not set correctly to track the correct path.
You probably should try something like :
<?xml version='1.0' encoding='UTF-8'?>
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<DataExtractors>
<DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue"/>
</DataExtractors>
<DataGenerators>
<DataGenerator name="currentUser" registeredName="auditModel.generator.user"/>
</DataGenerators>
<PathMappings>
<PathMap source="/alfresco-api/pre/AuthorityService/deleteAuthority" target="/deleteAuthority"/>
</PathMappings>
<Application name="DeleteAuthority" key="deleteAuthority">
<AuditPath key="deleteAuthority">
<RecordValue key="authority" dataExtractor="simpleValue" dataSource="/deleteAuthority/args/name" dataTrigger="/deleteAuthority/args/name"/>
<GenerateValue key="deletingUser" dataGenerator="currentUser"/>
</AuditPath>
</Application>
</Audit>

Related

How to configure artifactory CEPH S3 with Direct Upload Mechanism?

Artifactory: 7.38.8
It works fine with the Eventual Upload Mechanism. I try to change it to the Direct Upload Mechanism, but I cannot upload any file.
My binarystore.xml configuration:
<config version="1">
<chain>
<provider id="cache-fs" type="cache-fs">
<provider id="s3" type="s3"/>
</provider>
</chain>
<provider type="s3" id="s3">
<bucketName>xxx</bucketName>
<endpoint>xxx.xx.xx.xxx</endpoint>
<port>8060</port>
<credential>xxxxx</credential>
<identity>xxxxx</identity>
<s3AwsVersion>AWS2</s3AwsVersion>
<httpsOnly>false</httpsOnly>
<property name="s3service.disable-dns-buckets" value="true"/>
</provider>
</config>
Error messages:
{
"errors" : [ {
"status" : 500,
"message" : "Expecting stream to be instance of FileWrappingInputStream"
} ]
2022-08-16T07:56:25.351Z [jfrt ] [ERROR] [31d9214b03152aae] [o.a.w.s.RepoFilter:315 ] [http-nio-8081-exec-8] - Upload request of example-repo-local:test/1/delivery/test.sh failed due to {}
java.lang.RuntimeException: Expecting stream to be instance of FileWrappingInputStream
The chain defined in the storage configuration doesn't have an actual definition. Removing <provider id="cache-fs" type="cache-fs"> from the configuration file (binarystore.xml) and restarting Artifactory should help resolving the error.
[OR]
Amendment of cache settings for the definition you have made under should help.

Create VS extension with Analyzer and Options Page for Visual Studio 2022

I am trying (and failing) to port a Visual Studio [extension][1] to the latest version of Visual Studio.
The extension provides a set of Roslyn analyzers and code fixes as well as an options page to configure some aspects of the analyzers' operation.
A reduction of the problem can be demonstrated with the following steps:
Follow instructions [here][2] to create an analyzer
Follow instructions [here][3] to create an options page
Now try to combine the two into a single VSIX.
I have tried starting from #1 and then adding relevant items from #2 and vice versa. To no avail.
Unfortunately the two samples produce different project types, and target different .NET frameworks which doesn't simplify things.
Depending on which sample I start with either the analyzers or the options page are not loaded.
Here is what the .vsixmanifest looks like (started by using the options page sample and then adding in the analyzer code):
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="MyToolsOptionsExtension.208a3dc2-4dd7-40db-bb6c-ab135b5ddaca" Version="1.0" Language="en-US" Publisher="ME" />
<DisplayName>MyToolsOptionsExtension</DisplayName>
<Description xml:space="preserve">Empty VSIX Project.</Description>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0, 18.0)">
<ProductArchitecture>amd64</ProductArchitecture>
</InstallationTarget>
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
<Dependency Id="Microsoft.VisualStudio.MPF.16.0" DisplayName="Visual Studio MPF 16.0" d:Source="Installed" Version="[16.0,17.0)" />
</Dependencies>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,18.0)" DisplayName="Visual Studio core editor" />
<Prerequisite Id="Microsoft.VisualStudio.Component.Roslyn.LanguageServices" Version="[15.0,)" DisplayName="Roslyn Language Services" />
</Prerequisites>
<Assets>
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
<Asset Type="Microsoft.VisualStudio.Analyzer" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
</Assets>
</PackageManifest>
How can I debug why a specific asset defined in the .vsixmanifest file is not being loaded?
Would be great to see a sample where these are combined.
Peering into the compiled *.vsix (as zip file) it looks like an error in the auto-generation of the .pkgdef / catalog.json file, depending on what kind of project I start from. One or the other is missing from here despite having an identical vsixmanifest. For example catalog.json looks like this (note that the options page is missing):
"manifestVersion": "1.1",
"info": {
"id": "Analyzer1.2d1c1928-c190-4711-b986-1f7d0f3d8f5c,version=1.0",
"manifestType": "Extension"
},
"packages": [
{
"id": "Component.Analyzer1.2d1c1928-c190-4711-b986-1f7d0f3d8f5c",
"version": "1.0",
"type": "Component",
"extension": true,
"dependencies": {
"Analyzer1.2d1c1928-c190-4711-b986-1f7d0f3d8f5c": "1.0",
"Microsoft.VisualStudio.Component.CoreEditor": "15.0",
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices": "15.0"
},
"localizedResources": [
{
"language": "en-US",
"title": "Analyzer1",
"description": "This is a sample diagnostic extension for the .NET Compiler Platform (\"Roslyn\")."
}
]
},
{
"id": "Analyzer1.2d1c1928-c190-4711-b986-1f7d0f3d8f5c",
"version": "1.0",
"type": "Vsix",
"payloads": [
{
"fileName": "Analyzer1.Vsix.vsix",
"size": 33906
}
],
"vsixId": "Analyzer1.2d1c1928-c190-4711-b986-1f7d0f3d8f5c",
"extensionDir": "[installdir]\\Common7\\IDE\\Extensions\\pv2xi53w.cfr",
"installSizes": {}
}
]
}```
[1]: https://marketplace.visualstudio.com/items?itemName=YoavFrandzel.CheckedExceptions
[2]: https://learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/tutorials/how-to-write-csharp-analyzer-code-fix
[3]: https://learn.microsoft.com/en-us/visualstudio/extensibility/creating-an-options-page?view=vs-2022

Adding custom jmx metrics to google cloud monitoring collectd configuration

I've added the JVM Monitoring plugin as described here
That's all working great and I can, but now I'd like to add more JMX metrics. e.g. MemoryPool specific counters
So I've added this config to /opt/stackdriver/collectd/etc/collectd.d/jvm-sun-hotspot.conf
<MBean "jvm_localhost_MemoryPool">
ObjectName "java.lang:type=MemoryPool,name=*"
InstanceFrom "name"
<Value>
Type "gauge"
InstancePrefix "memorypool-usage_used"
Table false
Attribute "Usage.used"
</Value>
</MBean>
and
Collect "jvm_localhost_MemoryPool"
in the Connection section
It seems to be valid collectd config but when it's getting sent to Stackdriver/Google Cloud Monitoring it is rejected.
012 {#012 "index": 261,#012 "valueErrors": [#012 {#012 "error": {#012 "code": 3,#012 "message": "Unsupported
collectd id: plugin: \"jvm\" type: \"gauge\" type_instance: \"memorypool-usagecommitted\""#012 }#012 }#012 ]#012 },#012 {#012
"index": 262,#012 "valueErrors": [#012 {#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd id: plug
in: \"jvm\" type: \"gauge\" type_instance: \"memorypool-usageinit\""#012 }#012 }#012 ]#012 },#012 {#012 "index": 263,#012
"valueErrors": [#012 {#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd id: plugin: \"jvm\" type: \"gau
ge\" type_instance: \"memorypool-usagemax\""#012 }#012 }#012 ]#012 },#012 {#012 "index": 264,#012 "valueErrors": [#012
{#012 "error": {#012 "code": 3,#012 "message": "Unsupported
Now from what I understand it needs to be added as a custom metric, but this document suggests it would be auto created.
And indeed when I look at the list of builtin jvm metrics I can't see how they map onto the existing ones in the collectd configuration.
e.g. how is os-open_fd_count mapped to os/open_files ?
It would be helpful to see the actual api request being sent by Google's custom collectd implementation but I can't see a way of increasing logging.
I can see from this post that it's probably custom metrics where I want to be looking but how do I do that in the collectd configuration?
I've tried
InstancePrefix "custom.googleapis.com/memorypool-usage"
but still no joy.
Has anyone done this before or can offer any suggestions on what I'm doing wrong?
To get this logging I needed to add stackdriver_metric_type metadata.
The complete chain is now
<Chain "GenericJMX_jvm">
<Rule "rewrite_custom_jmx">
<Match regex>
Plugin "^GenericJMX$"
PluginInstance "^jvm.*$"
TypeInstance "^memorypool-usage_used$"
</Match>
<Target "set">
MetaData "stackdriver_metric_type" "custom.googleapis.com/jvm/memorypool/usage_used"
MetaData "label:pool" "%{plugin_instance}"
</Target>
<Target "replace">
MetaData "label:pool" "jvm" ""
</Target>
</Rule>
<Rule "rewrite_genericjmx_to_jvm">
<Match regex>
Plugin "^GenericJMX$"
PluginInstance "^jvm.*$"
</Match>
<Target "replace">
PluginInstance "jvm" ""
</Target>
<Target "set">
Plugin "jvm"
</Target>
Target "return"
</Rule>
</Chain>
The plugin instance is the pool name (e.g. G1 Eden Space) which is why I copied it into the 'pool' label.
This did auto-create the metric in Stackdriver but I also used the following body to the projects.metricDescriptors.create method to add description and units.
{
"name": "projects/yourprojecthere/metricDescriptors/custom.googleapis.com/jvm/memorypool/usage_used",
"labels": [
{
"key": "pool",
"description": "Name of the JVM memory pool."
}
],
"metricKind": "GAUGE",
"valueType": "DOUBLE",
"unit": "By",
"description": "Current size in bytes of the memory pool.",
"type": "custom.googleapis.com/jvm/memorypool/usage_used",
"monitoredResourceTypes": [
"gce_instance"
]
}
The resulting graph in metric explorer looks like this
The troubleshooting documents [1] could be helpful to determine what points need to be transformed, as well as to ensure your transformations behave as expected.
[1] https://cloud.google.com/monitoring/agent/custom-metrics-agent#troubleshooting

Stream notifications subscription to Exchange server not working

I trying to stream notification from exchange server to my meterojs application.
I am sending following SOAP message as streaming subscription request:
{
"body":{
"m:Subscribe":{
"m:StreamingSubscriptionRequest":{
"t:FolderIds":{
"t:DistinguishedFolderId":{
"attributes":[
{
"Id":"calendar"
}
]
}
},
"t:EventTypes":{
"t:EventType":"CreatedEvent"
}
}
}
},
"headers":{
"Authorization":"Basic YW5kZXJzLmthcmxzc29uQGNlcnR1c2ludGVybmF0aW9uYWwub25taWNyb3NvZnQuY29tOmxpaXNzc29vb280MzIh"
},
"additionalNamespaces":[
"xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\"",
"xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\""
],
"soapHeader":"",
"method":"POST",
"url":"https://outlook.office365.com/EWS/Exchange.asmx"
}
I get following response with subscription ID:
{
"xmlns:s":"http://schemas.xmlsoap.org/soap/envelope/",
"MajorVersion":"15",
"MinorVersion":"1",
"MajorBuildNumber":"434",
"MinorBuildNumber":"14",
"xmlns:h":"http://schemas.microsoft.com/exchange/services/2006/types",
"xmlns:xsd":"http://www.w3.org/2001/XMLSchema",
"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance",
"xmlns:m":"http://schemas.microsoft.com/exchange/services/2006/messages",
"xmlns:t":"http://schemas.microsoft.com/exchange/services/2006/types",
"ResponseClass":"Success",
"m:ResponseCode":"NoError",
"m:SubscriptionId":"JwBkYjVwcjA3bWIxMzk3LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAA/wYNryw5gEeJFs3T7NXJvglEUWvERtMIEAAAAPP2lIvBykJBqcK1FSVk+mk="
}
Per documentation next step is to sent get strsaming events request with subscription ID:
{
"body":{
"GetStreamingEvents":{
"attributes":[
{
"xmlns":"http://schemas.microsoft.com/exchange/services/2006/messages"
}
],
"SubscriptionId":"JwBkYjVwcjA3bWIxMzk3LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAA/wYNryw5gEeJFs3T7NXJvglEUWvERtMIEAAAAPP2lIvBykJBqcK1FSVk+mk=",
"ConnectionTimeout":30
}
},
"headers":{
"Authorization":"Basic YW5kZXJzLmthcmxzc29uQGNlcnR1c2ludGVybmF0aW9uYWwub25taWNyb3NvZnQuY29tOmxpaXNzc29vb280MzIh"
},
"additionalNamespaces":[
"xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\"",
"xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\""
],
"soapHeader":{
"t:RequestServerVersion":{
"attributes":[
{
"Version":"Exchange2013"
}
]
}
},
"method":"POST",
"url":"https://outlook.office365.com/EWS/Exchange.asmx"
}
On this I get response with status 500 and response body:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<s:Envelope
xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">
<s:Body>
<s:Fault>
<faultcode
xmlns:a=\"http://schemas.microsoft.com/exchange/services/2006/types\">a:ErrorSchemaValidation
</faultcode>
<faultstring xml:lang=\"en-US\">The request failed schema validation: The element 'GetStreamingEvents' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'SubscriptionId' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. List of possible elements expected: 'SubscriptionIds' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'.</faultstring>
<detail>
<e:ResponseCode
xmlns:e=\"http://schemas.microsoft.com/exchange/services/2006/errors\">ErrorSchemaValidation
</e:ResponseCode>
<e:Message
xmlns:e=\"http://schemas.microsoft.com/exchange/services/2006/errors\">The request failed schema validation.
</e:Message>
<t:MessageXml
xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\">
<t:LineNumber>3</t:LineNumber>
<t:LinePosition>201</t:LinePosition>
<t:Violation>The element 'GetStreamingEvents' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'SubscriptionId' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. List of possible elements expected: 'SubscriptionIds' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'.</t:Violation>
</t:MessageXml>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Can you please advise on this.
Update:
New request with corrections:
{
"body":{
"m:GetStreamingEvents":{
"m:SubscriptionIds":{
"t:SubscriptionId":"JwBhbTRwcjA3bWIxMzk1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAnjsBVFou+0u0dglnKKEJ0CDsxAkYR9MIEAAAAPP2lIvBykJBqcK1FSVk+mk="
},
"m:ConnectionTimeout":30
}
},
"headers":{
"Authorization":"Basic YW5kZXJzLmthcmxzc29uQGNlcnR1c2ludGVybmF0aW9uYWwub25taWNyb3NvZnQuY29tOmxpaXNzc29vb280MzIh"
},
"additionalNamespaces":[
"xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\"",
"xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\""
],
"soapHeader":{
"t:RequestServerVersion":{
"attributes":[
{
"Version":"Exchange2013"
}
]
}
},
"method":"POST",
"url":"https://outlook.office365.com/EWS/Exchange.asmx"
}
New response with different error:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<s:Envelope
xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">
<s:Body>
<s:Fault>
<faultcode
xmlns:a=\"http://schemas.microsoft.com/exchange/services/2006/types\">a:ErrorSchemaValidation
</faultcode>
<faultstring xml:lang=\"en-US\">The request failed schema validation: The 'http://schemas.microsoft.com/exchange/services/2006/messages:ConnectionTimeout' element is invalid - The value 'undefined' is invalid according to its datatype 'http://schemas.microsoft.com/exchange/services/2006/types:StreamingSubscriptionConnectionTimeoutType' - The string 'undefined' is not a valid Int32 value.</faultstring>
<detail>
<e:ResponseCode
xmlns:e=\"http://schemas.microsoft.com/exchange/services/2006/errors\">ErrorSchemaValidation
</e:ResponseCode>
<e:Message
xmlns:e=\"http://schemas.microsoft.com/exchange/services/2006/errors\">The request failed schema validation.
</e:Message>
<t:MessageXml
xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\">
<t:LineNumber>3</t:LineNumber>
<t:LinePosition>361</t:LinePosition>
<t:Violation>The 'http://schemas.microsoft.com/exchange/services/2006/messages:ConnectionTimeout' element is invalid - The value 'undefined' is invalid according to its datatype 'http://schemas.microsoft.com/exchange/services/2006/types:StreamingSubscriptionConnectionTimeoutType' - The string 'undefined' is not a valid Int32 value.</t:Violation>
</t:MessageXml>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
I don't think the online documentation is correct a working request should look like
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:SmtpAddress>target#Mailbox.com</t:SmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:GetStreamingEvents>
<m:SubscriptionIds>
<t:SubscriptionId>JwB0eTFwcjA0bWIwNzE4LmFwY3ByZDA0LnByb2Qub3V0bG9vay5jb20QAAAAhKGBpeZ5jEWJiN8rkO4xNxQ6jxrvRtMIEAAAAGhtpJbjoodMsSowkUdd9qk=</t:SubscriptionId>
</m:SubscriptionIds>
<m:ConnectionTimeout>15</m:ConnectionTimeout>
</m:GetStreamingEvents>
</soap:Body>
</soap:Envelope>
So the error your getting back makes sense because your missing the SubscriptionIds element. (Not sure why doco is wrong)
Cheers
Glen

Organization level key value map operation in apigee

I'm trying to use a key/value map operation on apigee edge but I can't seem to get any variables. I've since figured out that I have created an organization level key/value but I still can't figure out how to get the values. The data I created was from the samples and looks as follows:
{
"entry": [
{
"name": "Development",
"value": "65.87.18.18"
},
{
"name": "Staging",
"value": "65.87.18.22"
}
],
"name": "ipAddresses"
}
I've configured my policy up like so
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="Key-Value-Map-Operations-1" mapIdentifier="ipAddresses">
<DisplayName>Key Value Map Operations 1</DisplayName>
<FaultRules/>
<Properties/>
<ExclusiveCache>false</ExclusiveCache>
<ExpiryTimeInSecs>-1</ExpiryTimeInSecs>
<Get assignTo="myvar" index="1" >
<Key>
<Parameter ref="entry.Development"></Parameter>
</Key>
</Get>
<Scope>organization</Scope>
</KeyValueMapOperations>
But whenever I run a trace on this, myVar is always empty. I've tried various values for the Parameter ref such as
entry
Development
entry.Development
But nothing seems to work. Any suggestions? Do I need a basic auth header in there somewhere?
I've even tried doing this on an apiproxy scope and seeding the map at the same time, but even this doesn't return anything. And this is using the defaults from the policy!
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="Key-Value-Map-Operations-2" mapIdentifier="newkey">
<DisplayName>Key Value Map Operations 2</DisplayName>
<FaultRules/>
<Properties/>
<ExclusiveCache>false</ExclusiveCache>
<ExpiryTimeInSecs>-1</ExpiryTimeInSecs>
<InitialEntries>
<Entry>
<Key>
<Parameter>k1</Parameter>
</Key>
<Value>v1</Value>
</Entry>
<Entry>
<Key>
<Parameter>k2</Parameter>
</Key>
<Value>v3</Value>
<Value>v4</Value>
</Entry>
</InitialEntries>
<Get assignTo="mynewvar" index="1">
<Key>
<Parameter ref="k1"></Parameter>
</Key>
</Get>
<Scope>apiproxy</Scope>
</KeyValueMapOperations>
I can't help but think I'm missing something really obvious, or I've totally misunderstood the concept of the maps
For anyone else who has this problem, the issue was I was using
<Parameter ref="k1"></Parameter>
To retrieve the value when in fact it should be
<Parameter>k1</Parameter>

Resources