Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 41 additions & 6 deletions sdk/privacy/docs/module-Privacy-Privacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ <h5 class="subsection-title">Properties:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line354">line 354</a>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line361">line 361</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -1018,7 +1018,7 @@ <h5 class="subsection-title">Properties:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line366">line 366</a>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line373">line 373</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -1179,6 +1179,37 @@ <h6>Properties</h6>
</tr>


<tr>

<td class="name"><code>profileId</code></td>


<td class="type">


<span class="param-type">
string
</span>





</td>





<td class="description last">
<p>The Privacy profile ID configured on
Verify. If provided, other fields are ignored and assessment is performed
using this identifier.</p>

</td>
</tr>


<tr>

<td class="name"><code>accessTypeId</code></td>
Expand Down Expand Up @@ -1357,7 +1388,7 @@ <h5>Returns:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line121">line 121</a>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line128">line 128</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -1401,6 +1432,10 @@ <h5 id="assess-examples">Example</h5>
{
// default end user license agreement
"purposeId": "defaultEULA",
},
{
// Privacy profile identifier
"profileId": "gdprprofile",
}
])

Expand Down Expand Up @@ -1730,7 +1765,7 @@ <h5>Returns:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line205">line 205</a>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line212">line 212</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -1999,7 +2034,7 @@ <h5>Returns:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line268">line 268</a>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line275">line 275</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -2204,7 +2239,7 @@ <h5>Returns:</h5>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line315">line 315</a>
<a href="privacy.js.html">privacy.js</a>, <a href="privacy.js.html#line322">line 322</a>
</li>
</ul>
</dd>
Expand Down
7 changes: 7 additions & 0 deletions sdk/privacy/docs/privacy.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ <h1 class="page-title">
* @param {string} items.purposeId The purpose ID representing the privacy
* purpose configured on Verify. If you are checking for the consent status
* of EULA, use the EULA identifier here.
* @param {string} items.profileId The Privacy profile ID configured on
* Verify. If provided, other fields are ignored and assessment is performed
* using this identifier.
* @param {string} items.accessTypeId The access type ID representing the
* available access types on Verify. This must be one of the access types
* selected for the purpose.
Expand All @@ -187,6 +190,10 @@ <h1 class="page-title">
* {
* // default end user license agreement
* "purposeId": "defaultEULA",
* },
* {
* // Privacy profile identifier
* "profileId": "gdprprofile",
* }
* ])
*
Expand Down
7 changes: 7 additions & 0 deletions sdk/privacy/lib/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class Privacy {
* @param {string} items.purposeId The purpose ID representing the privacy
* purpose configured on Verify. If you are checking for the consent status
* of EULA, use the EULA identifier here.
* @param {string} items.profileId The Privacy profile ID configured on
* Verify. If provided, other fields are ignored and assessment is performed
* using this identifier.
* @param {string} items.accessTypeId The access type ID representing the
* available access types on Verify. This must be one of the access types
* selected for the purpose.
Expand All @@ -104,6 +107,10 @@ class Privacy {
* {
* // default end user license agreement
* "purposeId": "defaultEULA",
* },
* {
* // Privacy profile identifier
* "profileId": "gdprprofile",
* }
* ])
*
Expand Down
3 changes: 3 additions & 0 deletions sdk/privacy/lib/services/dpcm/dpcmService.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class DPCMService extends Service {
* @param {Array} duaRequest The data items that require approval for use
* @param {string} duaRequest.purposeId The purpose ID representing the
* privacy purpose configured on Verify.
* @param {string} duaRequest.profileId The Privacy profile ID representing
* the privacy profile configured on Verify. If provided, other
* fields are ignored
* @param {string} duaRequest.accessTypeId The access type ID representing
* the available access types on Verify. This must be one of the access types
* selected for the purpose.
Expand Down
2 changes: 1 addition & 1 deletion sdk/privacy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ibm-verify/privacy",
"version": "1.0.0",
"version": "1.0.1",
"description": "Data Privacy and Consent Management SDK",
"main": "index.js",
"files": [
Expand Down
23 changes: 23 additions & 0 deletions sdk/privacy/test/privacy/assessTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,29 @@ describe('Privacy', () => {
]);
assert.strictEqual(result.status, 'consent');
});

it('should assess by profileId', async () => {
const client = new Privacy(
config, auth, context,
);
const result = await client.assess([
{
'profileId': 'marketingprofile',
},
]);
// email (attributeId=3) is not consented but
// mobile_number (attributeId=11) is already consented
for (let i = 0; i < result.assessment.length; i++) {
const item = result.assessment[i];
if (item.attributeId === '11') {
assert.strictEqual(item.result.length, 1);
assert.strictEqual(item.result[0].approved, true);
} else if (item.attributeId === '3') {
assert.strictEqual(item.result.length, 1);
assert.strictEqual(item.result[0].approved, false);
}
}
});
});

describe('#error', () => {
Expand Down