data-deidentification/bundle/apiproxy/policies/SC-DLP-DeIdentify-Template1.xml (37 lines of code) (raw):
<!--
Copyright 2023 Google LLC
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<ServiceCallout name='SC-DLP-DeIdentify-Template1'>
<Request clearPayload="true" variable="dlpRequest">
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<Set>
<Verb>POST</Verb>
<Headers>
<Header name="x-goog-user-project">{propertyset.dlp.project}</Header>
</Headers>
<!--
The payload sent to DLP must be JSON. The following element uses a
message template to generate the appropriate json. Within the JSON,
we can encapsulate any string, even XML format, via the escapeJson
function.
-->
<Payload contentType="application/json">
{
"inspectConfig": {
"infoTypes": [ {propertyset.dlp.infotypes} ]
},
"deidentifyTemplateName": "{propertyset.dlp.deidentify_template1}",
"item": {
"value": "{escapeJSON(request.content)}"
}
}
</Payload>
<Path>v2/projects/{propertyset.dlp.project}/content:deidentify</Path>
</Set>
</Request>
<Response>dlpResponse</Response>
<HTTPTargetConnection>
<!--
The following configuration tells Apigee to automatically attach an
Access Token when invoking the DLP endpoint. Apigee obtains the access
token from the Service Account that you use to deploy this API proxy.
-->
<Authentication>
<GoogleAccessToken>
<Scopes>
<Scope>https://www.googleapis.com/auth/cloud-platform</Scope>
</Scopes>
</GoogleAccessToken>
</Authentication>
<Properties>
<Property name='success.codes'>2xx</Property>
</Properties>
<URL>https://dlp.googleapis.com</URL>
</HTTPTargetConnection>
</ServiceCallout>