├── .jsdoc.js ├── .travis.yml ├── .eslintrc.js ├── src ├── usprivacy-string.js └── uspapi.js ├── README.md ├── index-iframes.html ├── iframe.html ├── webpack.config.js ├── package.json ├── .gitignore ├── index2.html ├── index.html └── LICENSE /.jsdoc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | source: { 3 | include: [ 4 | 'README.md', 5 | 'src/uspapi.js', 6 | ], 7 | }, 8 | opts: { 9 | destination: 'docs/', 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - stable 5 | 6 | install: 7 | - npm install 8 | 9 | script: 10 | - npm run coverage 11 | 12 | # Send coverage data to Coveralls 13 | after_script: "cat coverage/lcov.info | node_modules/coveralls/bin/coveralls.js" 14 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "eslint:recommended", 3 | "plugins": [ 4 | "import" 5 | ], 6 | "parserOptions": { 7 | "ecmaVersion": 2017, 8 | "sourceType": "module", 9 | "allowImportExportEverywhere": true 10 | }, 11 | "env": { 12 | "browser": true, 13 | "node": true, 14 | "es6": true 15 | }, 16 | "rules": { 17 | "no-console": "warn", 18 | "no-prototype-builtins": "off", 19 | "max-len": ["error", 100, 2, { 20 | "ignoreUrls": true, 21 | "ignoreComments": true, 22 | "ignoreRegExpLiterals": true, 23 | "ignoreStrings": true, 24 | "ignoreTemplateLiterals": true, 25 | }], 26 | 'no-param-reassign': 'off', 27 | 'no-cond-assign': 'error', 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /src/usprivacy-string.js: -------------------------------------------------------------------------------- 1 | /** 2 | * usprivacy-string.js 3 | * 4 | * Implements class UsprivacyString 5 | * 6 | * The class contains the methods to get/set the usprivacy string 7 | * and a method to get the current version. 8 | * 9 | * The usprivacy string as the format: ”vnol” where 10 | * v = version 11 | * n = Notice Given 12 | * o = OptedOut 13 | * l = lspact (Limited Service Provider Agreement Covered Transaction) 14 | * Example: “1YYY” Version 1, Notice given, Opted out, LSAPCT in place. 15 | * Default is null. 16 | * 17 | **/ 18 | const validStringRegExp = /^[1][nNyY-][nNyY-][nNyY-]$/; 19 | 20 | class UsprivacyString { 21 | constructor() { 22 | this.version = 1; 23 | this.baseString = null; // default is null 24 | } 25 | 26 | // getUsprivacyString() 27 | // return the usprivacy string or null if an error occurs 28 | getUsprivacyString() { 29 | return this.baseString; 30 | } 31 | 32 | // setUsprivacyString(newstr) 33 | // checks for validity of the string before setting internals 34 | // returns true if success otherwise false 35 | setUsprivacyString(newstr) { 36 | let didSet = false; 37 | if(validStringRegExp.test(newstr)) { 38 | this.baseString = newstr; 39 | didSet = true; 40 | } 41 | return didSet; 42 | } 43 | 44 | // getVerion() 45 | // returns the version number 46 | getVersion () { 47 | return this.version; 48 | } 49 | } 50 | 51 | export default UsprivacyString; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CCPA-reference-code 2 | Public workspace for CCPA publisher code dev 3 | 4 | File usprivacy-string.js 5 | Implements class UsprivacyString 6 | 7 | The class contains the methods to get/set the usprivacy string 8 | and a method to get the current version. 9 | 10 | The usprivacy string as the format: ”vnol” where 11 | v = version (int) 12 | n = Notice Given (char) 13 | o = OptedOut (char) 14 | l = Lspact (char) 15 | 16 | Example: “1YYY” Version 1, Notice given, Opted out, under Lspact. 17 | 18 | Default is null. 19 | 20 | File uspapi.js 21 | Implements the IAB tech lab U.S. Privacy API reference implementation 22 | 23 | __uspapi("getuspdata", version, callback) 24 | 25 | getuspdata will return the uspdata object { version, uspstring } 26 | version supported (needs to be set to 1 for v1) 27 | callback function returns uspdata object and success, success is either true of false. 28 | 29 | index.html 30 | Simple reference implementation using U.S. Privacy API 31 | Set param lspact=0 to set yourself as a none signatory 32 | Note: this sample sets the cookie as a first party and secure. You will need HTTPS to get this to work. For debugging you can set the URL param debug=1 to make it work on HTTP, like http://localhost. 33 | 34 | index.html 35 | Simple HTML to test all the API return calls 36 | 37 | README.md 38 | This document 39 | 40 | Build notes: 41 | To build you need NPM. 42 | Run npm install to install npm. 43 | 44 | Run npm run build:dev to build dev 45 | Run npm start to build dev and start the web browser, loading the index.html. 46 | 47 | Currently only tested within dev and on Chrome. 48 | -------------------------------------------------------------------------------- /index-iframes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

IAB Tech Lab U.S. Privacy API Reference Implementation

6 | 7 |

Case 1: Business declared CCPA doesn't apply

8 |
Please wait...
9 | 22 | 23 |

Case 2: User did opt out, do not share data

24 |
Please wait...
25 | 33 |

Case 3: User didn't opt out, business as usual

34 |
Please wait...
35 | 43 | 44 | -------------------------------------------------------------------------------- /iframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 52 | 53 | iframe content 54 |

uspString not yet retrieved

55 | 56 | 57 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const CleanWebpackPlugin = require('clean-webpack-plugin'); 2 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 3 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 4 | const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); 5 | const merge = require('webpack-merge'); 6 | const path = require('path'); 7 | const webpack = require('webpack'); 8 | 9 | // * * * * * Common Config * * * * * // 10 | 11 | const commonConfig = (env) => { 12 | return { 13 | entry: { 14 | uspapi: './src/uspapi.js' 15 | }, 16 | output: { 17 | filename: '[name].js', 18 | path: path.resolve(__dirname, 'build', env) 19 | }, 20 | plugins: [ 21 | new HtmlWebpackPlugin({ 22 | inject: false, 23 | template: './index.html', 24 | minify: { 25 | collapseWhitespace: true, 26 | minifyCSS: true, 27 | minifyJS: true, 28 | removeComments: true 29 | } 30 | }) 31 | ] 32 | }; 33 | }; 34 | 35 | const envSpecificConfig = (env) => 36 | env == 'dev' 37 | ? // ***** Development Config ***** // 38 | { 39 | devServer: { 40 | index: './index.html', 41 | openPage: './index.html', 42 | hot: true, 43 | /* allows /etc/hosts 127.0.0.1 sub.domain.local devserver access for Cookie Domain testing */ 44 | disableHostCheck: true 45 | }, 46 | plugins: [ 47 | new webpack.HotModuleReplacementPlugin(), 48 | new webpack.NamedModulesPlugin() 49 | ] 50 | } 51 | : // ***** Production Config ***** // 52 | { 53 | plugins: [ 54 | new CleanWebpackPlugin([path.resolve('build', env)]), 55 | // new UglifyJSPlugin() 56 | ] 57 | }; 58 | 59 | // ***** Environment Config ***** // 60 | 61 | module.exports = env => { 62 | return merge( 63 | commonConfig(env), 64 | envSpecificConfig(env) 65 | ); 66 | }; 67 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "uspapi", 3 | "version": "1.0.0", 4 | "description": "Reference implementation for IAB U.S. Privacy API", 5 | "homepage": "https://github.com/InteractiveAdvertisingBureau/CCPA-reference-code", 6 | "repository": "https://github.com/InteractiveAdvertisingBureau/CCPA-reference-code", 7 | "keywords": [ 8 | "ccpa", 9 | "uspapi", 10 | "iab" 11 | ], 12 | "license": "MIT", 13 | "main": "prod/uspapi.js", 14 | "files": [ 15 | "prod" 16 | ], 17 | "scripts": { 18 | "test": "mocha test/ --recursive", 19 | "coverage": "nyc --reporter=html --reporter=text-summary --reporter=lcov --check-coverage --lines 60 --functions 60 --branches 60 mocha test/ --recursive", 20 | "lint": "eslint src/. test/.", 21 | "docs": "jsdoc -c .jsdoc.js -r", 22 | "build:dev": "webpack --env dev", 23 | "build:test": "webpack --env test", 24 | "build:prod": "webpack --env prod", 25 | "start": "webpack-dev-server --open --env dev", 26 | "prepublishOnly": "npm run build" 27 | }, 28 | "dependencies": { 29 | "base-64": "^0.1.0", 30 | "uglify-es": "^3.3.9", 31 | "uglifyjs": "^2.4.11" 32 | }, 33 | "devDependencies": { 34 | "clean-webpack-plugin": "^0.1.19", 35 | "copy-webpack-plugin": "^4.5.2", 36 | "chai": "^4.0.2", 37 | "coveralls": "^3.0.0", 38 | "eslint": "^4.0.0", 39 | "eslint-config-airbnb-base": "^11.2.0", 40 | "eslint-plugin-import": "^2.3.0", 41 | "eslint-plugin-mocha": "^4.11.0", 42 | "html-loader": "^0.5.5", 43 | "html-webpack-plugin": "^2.30.1", 44 | "jsdoc": "^3.5.5", 45 | "mocha": "^3.4.2", 46 | "ndb": "^1.1.4", 47 | "nyc": "^11.0.2", 48 | "sinon": "^4.5.0", 49 | "url-loader": "^1.0.1", 50 | "wdio-browserstack-service": "^0.1.16", 51 | "wdio-jasmine-framework": "^0.3.5", 52 | "wdio-selenium-standalone-service": "0.0.10", 53 | "wdio-static-server-service": "^1.0.1", 54 | "wdio-webpack-dev-server-service": "^1.2.0", 55 | "wdio-webpack-service": "^1.0.1", 56 | "webdriverio": "^4.13.1", 57 | "webpack": "^3.12.0", 58 | "webpack-dev-server": "^2.11.5", 59 | "webpack-merge": "^4.1.3" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | .nyc_output 16 | 17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # Compiled binary addons (http://nodejs.org/api/addons.html) 21 | build/Release 22 | 23 | # Dependency directory 24 | # Commenting this out is preferred by some people, see 25 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 26 | node_modules 27 | 28 | # Users Environment Variables 29 | .lock-wscript 30 | 31 | # IDEs and editors (shamelessly copied from @angular/cli's .gitignore) 32 | /.idea 33 | .project 34 | .classpath 35 | .c9/ 36 | *.launch 37 | .settings/ 38 | *.sublime-workspace 39 | *.swp 40 | *.swo 41 | 42 | # IDE - VSCode 43 | .vscode 44 | 45 | ### Linux ### 46 | *~ 47 | 48 | # temporary files which can be created if a process still has a handle open of a deleted file 49 | .fuse_hidden* 50 | 51 | # KDE directory preferences 52 | .directory 53 | 54 | # Linux trash folder which might appear on any partition or disk 55 | .Trash-* 56 | 57 | # .nfs files are created when an open file is removed but is still being accessed 58 | .nfs* 59 | 60 | ### OSX ### 61 | *.DS_Store 62 | .AppleDouble 63 | .LSOverride 64 | 65 | # Icon must end with two \r 66 | Icon 67 | 68 | 69 | # Thumbnails 70 | ._* 71 | 72 | # Files that might appear in the root of a volume 73 | .DocumentRevisions-V100 74 | .fseventsd 75 | .Spotlight-V100 76 | .TemporaryItems 77 | .Trashes 78 | .VolumeIcon.icns 79 | .com.apple.timemachine.donotpresent 80 | 81 | # Directories potentially created on remote AFP share 82 | .AppleDB 83 | .AppleDesktop 84 | Network Trash Folder 85 | Temporary Items 86 | .apdisk 87 | 88 | ### Windows ### 89 | # Windows thumbnail cache files 90 | Thumbs.db 91 | ehthumbs.db 92 | ehthumbs_vista.db 93 | 94 | # Folder config file 95 | Desktop.ini 96 | 97 | # Recycle Bin used on file shares 98 | $RECYCLE.BIN/ 99 | 100 | # Windows Installer files 101 | *.cab 102 | *.msi 103 | *.msm 104 | *.msp 105 | 106 | # Windows shortcuts 107 | *.lnk 108 | 109 | # Others 110 | ./data/ 111 | build/ 112 | *.pyc 113 | *.zip 114 | dist/ 115 | test.js 116 | *.tgz 117 | -------------------------------------------------------------------------------- /index2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

IAB Tech Lab U.S. Privacy API Reference Implementation

6 | Case 1: Business declared CCPA doesn't apply 7 |
8 |

9 | 31 |
32 | Case 2: User did opt out, do not share data 33 |
34 |

35 | 48 |
49 | Case 3: User didn't opt out, business as usual 50 |
51 |

52 | 65 | -------------------------------------------------------------------------------- /src/uspapi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * IAB's Reference UspAPI reference implementation 3 | **/ 4 | 5 | // import the UsprivacyString class 6 | import UsprivacyString from './usprivacy-string'; 7 | 8 | // global vars 9 | const API_VERSION = 1; 10 | let pendingCalls = []; 11 | let uspString = new UsprivacyString(); 12 | 13 | // helper functions 14 | let getCookie = function(cookiename) { 15 | var name = cookiename + "="; 16 | var cookiearray = document.cookie.split(';'); 17 | for (var i = 0; i < cookiearray.length; i++) { 18 | var cookie = cookiearray[i]; 19 | while (cookie.charAt(0) == ' ') { 20 | cookie = cookie.substring(1); 21 | } 22 | if (cookie.indexOf(name) == 0) { 23 | return cookie.substring(name.length, cookie.length); 24 | } 25 | } 26 | return ""; 27 | }; 28 | 29 | // function to dynamically add the "__uspapiLocator" frame to the window 30 | let addFrame = function() { 31 | // if the frame does not already exist 32 | if (!window.frames['__uspapiLocator']) { 33 | // in case this is running in the , make sure exists 34 | // (can't/shouldn't add a frame to the 35 | if (document.body) { 36 | // create iframe and append it to 37 | const iframe = document.createElement('iframe'); 38 | iframe.style.cssText = 'display:none'; 39 | iframe.name = '__uspapiLocator'; 40 | document.body.appendChild(iframe); 41 | } else { 42 | /** 43 | * Wait for the body tag to exist. 44 | * 45 | * Since this API "stub" is located in the , 46 | * setTimeout allows us to inject the iframe more 47 | * quickly than relying on DOMContentLoaded or 48 | * other events. 49 | */ 50 | setTimeout(addFrame, 5); 51 | } 52 | } 53 | } 54 | 55 | // add the "__uspapiLocator" frame to the window 56 | addFrame(); 57 | 58 | let getuspdata = function(apiver, callback) { 59 | if (typeof callback === 'function') { 60 | if ( 61 | apiver !== null && 62 | apiver !== undefined && 63 | apiver != API_VERSION 64 | ) { 65 | if (typeof callback === 'function') 66 | callback(null, false); 67 | return; 68 | } 69 | 70 | // Get the data from the storage 71 | let str1 = null; 72 | if ((str1 = getCookie("usprivacy"))) { 73 | if (!uspString.setUsprivacyString(str1)) { 74 | console.log("Warning: uspString not set."); 75 | } 76 | } 77 | 78 | // get the uspstring and stuff it into the uspdata object 79 | let str = uspString.getUsprivacyString(); 80 | if (str) { 81 | callback( 82 | { 83 | version: uspString.getVersion(), 84 | uspString: str 85 | }, 86 | true 87 | ); 88 | } else { 89 | callback( 90 | { 91 | version: null, 92 | uspString: null 93 | }, 94 | false 95 | ); 96 | } 97 | } else { 98 | console.error("__uspapi: callback parameter not a function"); 99 | } 100 | }; 101 | 102 | /** 103 | * U.S. Privacy API implementation 104 | */ 105 | window.__uspapi = new function (win) { 106 | if (win.__uspapi) { 107 | try { 108 | // if the api was already loaded, then use it 109 | if (win.__uspapi('__uspapi')) { 110 | return win.__uspapi; 111 | } else { 112 | // Making a call to __uspapi with no arguments will return the pending calls; 113 | pendingCalls = win.__uspapi() || []; 114 | } 115 | } catch (nfe) { 116 | return win.__uspapi; 117 | } 118 | } 119 | 120 | let api = function (cmd) { 121 | try { 122 | return { 123 | getUSPData: getuspdata, 124 | __uspapi: function () { 125 | return true; 126 | } 127 | } [cmd].apply(null, [].slice.call(arguments, 1)); 128 | } 129 | catch (err) { 130 | console.error("__uspapi: Invalid command: ", cmd) 131 | } 132 | }; 133 | 134 | return api; 135 | } (window); 136 | 137 | // register postMessage handler 138 | function __handleUspapiMessage (event) { 139 | const data = event && event.data && event.data.__uspapiCall; 140 | if (data) { 141 | window.__uspapi(data.command, data.version, (returnValue, success) => { 142 | event.source.postMessage({ 143 | __uspapiReturn: { 144 | returnValue, 145 | success, 146 | callId: data.callId 147 | } 148 | }, '*'); 149 | }); 150 | } 151 | } 152 | 153 | window.addEventListener('message', __handleUspapiMessage, false); 154 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 88 | 89 | IAB Tech Lab U.S. Privacy API Reference Implementation 90 | 91 | 92 | 93 | 94 |

95 | 107 | 108 |
109 |
110 |

Nova diei

111 |

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

112 |
113 |
114 |
115 |

116 | Do not sell my data 117 | License Agreement 118 |
119 |
120 |

IAB Tech Lab U.S. Privacy API Reference Implementation

121 |

122 |
123 |
124 | 125 |
126 |
127 | 150 |
151 |
152 | 153 | 154 | 169 | 170 | 258 | 259 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [2019] [IAB Technology Laboratory, Inc] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------