forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit edbe587

Isaac Dettman
Rubicon Adapter - support User ID module (prebid#3531)
* add initial files
* add local storage and cookie browser support functions
* added additional test cases for functions related to local storage and cookie browser support
* added validate config function and first unit test
* add validate config test
* updated local storage key value to match change to requirements/spec
* updated submodule config key names to match requirements/spec
* added TODO with validation logic breakdown as well as a question on how to handle both 'value' and 'storage' existing in config
* add TODO addressing use-case: Publisher has integrated with OpenID on their own
* fixed comment
* rearranged unit tests for config functions to be grouped correctly
* added logic to valid that a submodule contains a config with a value or storage obj
* removed sinon mock of config.getConfig, replaced with obj literal definition in function arguments
* additional use cases added to validateConfig tests
* refactored init function
* refactored to remove a function and reduce number of iterations of submodules and configs
* add logic to pass config value obj data to adapter, also a small amount of refactoring/formatting cleanup
* added configuration examples to markdown file
* add add request bid hook to the initSubmodules function
* added requestBidBook in preparation to test mock setup/configuration. add test for one storage type active with only one module configured to use that type
* refactored requestBidHook with dependency injection for unit testing
* had to revert revision to use dependency injection in the requestBidHook due to necessary use of prebid global object affecting following tests
* created initial file for integration example
* updated integration using brett's test page.
* updated extendedBidRequestData to be a function expression, which allows watching the first element added to add the bid request hook
* removed redundant constant for enabled submodules within init submodules
* added retrieve storage value and logic to call submodule.getId if stored value does not exist
* added submodule getId fallback when storage value does not exist
* extended addUnit bid requests with universalId data, add logging for invalid config storage type, revised commenting
* add logic to set storage and pass decoded data in getId response handler
* updated initModules unit test mock data to fix broken tests from previous module additions/updates
* updated comments for consistency
* fixed module description comment
* add overrideId interface and implementation to the pubCommonId submodule
* fix to only check for override method value if submodule has a configKey set in the config
* added unit test for submodule override method implementation
* completed the pubCommonId submodule getId implementation; changed pubCommonId submodule default expires value to today + 8 years
* changed openId submodule default expires value to today + 8 years; added final todo comments, pertaining to openId submodule decode and getId methods
* fixed formatting to correct linting errors during building
* update jsdoc comments for IdSubmodule
* added jsdoc comments for overrideId submodule interface method
* changed the overrideId return value conditional to require a valid object, added a todo note to investigate using separate instance callbacks to handle multiple timers for syncDelay/auctionDelay
* add ajax request to openId submodule getId, awaiting values for request params and response structure and format for storage and structure for adding to bid requests
* updated openId submodule getId error logging and callback handling
* fix obj path access for syncDelay, updated example file with pubCommonId configured
* fix for broken unit tests resulting from update of overrideId addition to submodule interface
* replace use of built-in array find method, with import of 'core-js/library/fn/array/find', fixes/updates for integration example for module
* refactored config handling in initSubmodules to accept a plain js object opposed to a prebid Config object (this simplifies testing setup)
* created init method to wrap initSubmodules with config
* refactored module's config to watch/handle changes
* removed overrideId submodule interface, change openId to unifiedId
* update getId and decode uid data structure also updated integration example
* updated object structure for universal ids that is added to bid request, add universalID object handling to rubiconBidAdapter
* updated markdown example configuration
* fix for syncDelay, added auction end listener before setting syncDelay timer
* update to prepare universalID object if adUnits exists
* add gdpr consent data to request bids hook, warn on not found, info if found
* add test for valid gdpr consent string, exits universal id module on fail
* update gdpr consent to check gdprApplies, add cmp code to integration example. update init to use dependency injection
* implemented test for gdpr consent to store locally (purpose #1)
* added consentString decode to check for purpose #1 (user consents to have data stored locally)
* fix initSubmodule function arguments for changed signature
* changed submodule getId method signature to pass a consentData argument
* tests update with dependency container
* update spec to un-comment disabled expect statement
* in-progress DI conversion
* update to fix test missing dependency for utils
* removed getIdCallbackHandler function because it was inlined within initSubmodules. refactored dependencyContainer argument names to dependencies
* add unit test case for configurations that define invalid storage.type values (only cookie or html5 are valid)
* fixes for html5 storage in module and unit tests. temp comment-out for gdpr test in requestBid hook as it's being refactored into getId submodule methods
* fixes for html5 storage in module and unit tests. temp comment-out for gdpr test in requestBid hook as it's being refactored into getId submodule methods
* added opt_out cookie logic to init
* in-progress commit to update getId method signature with initialized consentManagement data
* changed priority to consent management module's value + 1
* updated both submodule getId functions with consent data handling.
* update hasGDPRConsent to remove unnecessary test for consentData obj since it's tested outside of function, removed utils from dependency injection
* update to move local declarations outside if block, added local var for log prefix since it was accessed more than twice
* changed log prefix to build the string locally instead of passing through getIdData obj
* bug fix for request bid hook priority race condition
* removed consentData prop from init dependencies obj, updated jsdoc comments removing consentData prop
* removed consentData prop from init arguments
* update integration example to test gdpr cmpApi type of 'static'
* refactor to combine request bid hooks into single hook, also other opts and formatting changes
* additions/updates to logging, additions/updates to jsdoc comments, various refactoring and formatting updates
* fixed how GDPR purpose 1 permission is checked, removed decode function and read from consentData.vendorConsents.purposeConsents[1] (key value 1 is for "purpose 1")
* fix for hasGDPRConsent functions, changed object prop accessor name from 'consentData.vendorConsent' to 'consentData.vendorData'
* small changes to log messages and code formatting
* changed submodule property configKey to configName for consistency with the submodule config property name
* updated logging message text and small format change
* updated jsdoc comment to reduce line length
* formatting fix and jsdoc update
* reverted changes to support universal id in rubiconBidAdapter, will open a separate PR for the adapter code changes.
* added logging messages to catch statements
* fix unit tests using the document cookie
* fix to extra module name in log message
* changed function return type array to undefined on invalid config
* moved encodeURIComponenent and decodeURIComponenent into setCookie and getCookie
* refactor to resolve issues creating certain unit tests
* add tests for config variations, small fixes for issues found writing tests
* removed debug console.log statements
* removed set initializedSubmodules value in init
* fix to remove test cookie from spec, updated example with submodule config value object
* added tests checking that config submodule props create correct number of submodules
* added test for syncDelay config update
* fixes for LGTM and imports for src are now relative
* formatting fix semicolon
* test reverted to debug circleci failure
* changed request bids hook priority to load after consentManagement
* test to resolve circle ci errors
* test to resolve circle ci errors
* fixed name camel case error
* changed unifiedid decode test property name from pubcid to ttid
* added universal id support to bid adapter
* added unit test for universal id support in bid adapter
* optimized last unit test added
* add initial files
* add local storage and cookie browser support functions
* added additional test cases for functions related to local storage and cookie browser support
* added validate config function and first unit test
* add validate config test
* updated local storage key value to match change to requirements/spec
* updated submodule config key names to match requirements/spec
* added TODO with validation logic breakdown as well as a question on how to handle both 'value' and 'storage' existing in config
* add TODO addressing use-case: Publisher has integrated with OpenID on their own
* fixed comment
* rearranged unit tests for config functions to be grouped correctly
* added logic to valid that a submodule contains a config with a value or storage obj
* removed sinon mock of config.getConfig, replaced with obj literal definition in function arguments
* additional use cases added to validateConfig tests
* refactored init function
* refactored to remove a function and reduce number of iterations of submodules and configs
* add logic to pass config value obj data to adapter, also a small amount of refactoring/formatting cleanup
* added configuration examples to markdown file
* add add request bid hook to the initSubmodules function
* added requestBidBook in preparation to test mock setup/configuration. add test for one storage type active with only one module configured to use that type
* refactored requestBidHook with dependency injection for unit testing
* had to revert revision to use dependency injection in the requestBidHook due to necessary use of prebid global object affecting following tests
* created initial file for integration example
* updated integration using brett's test page.
* updated extendedBidRequestData to be a function expression, which allows watching the first element added to add the bid request hook
* removed redundant constant for enabled submodules within init submodules
* added retrieve storage value and logic to call submodule.getId if stored value does not exist
* added submodule getId fallback when storage value does not exist
* extended addUnit bid requests with universalId data, add logging for invalid config storage type, revised commenting
* add logic to set storage and pass decoded data in getId response handler
* updated initModules unit test mock data to fix broken tests from previous module additions/updates
* updated comments for consistency
* fixed module description comment
* add overrideId interface and implementation to the pubCommonId submodule
* fix to only check for override method value if submodule has a configKey set in the config
* added unit test for submodule override method implementation
* completed the pubCommonId submodule getId implementation; changed pubCommonId submodule default expires value to today + 8 years
* changed openId submodule default expires value to today + 8 years; added final todo comments, pertaining to openId submodule decode and getId methods
* fixed formatting to correct linting errors during building
* update jsdoc comments for IdSubmodule
* added jsdoc comments for overrideId submodule interface method
* changed the overrideId return value conditional to require a valid object, added a todo note to investigate using separate instance callbacks to handle multiple timers for syncDelay/auctionDelay
* add ajax request to openId submodule getId, awaiting values for request params and response structure and format for storage and structure for adding to bid requests
* updated openId submodule getId error logging and callback handling
* fix obj path access for syncDelay, updated example file with pubCommonId configured
* fix for broken unit tests resulting from update of overrideId addition to submodule interface
* replace use of built-in array find method, with import of 'core-js/library/fn/array/find', fixes/updates for integration example for module
* refactored config handling in initSubmodules to accept a plain js object opposed to a prebid Config object (this simplifies testing setup)
* created init method to wrap initSubmodules with config
* refactored module's config to watch/handle changes
* removed overrideId submodule interface, change openId to unifiedId
* update getId and decode uid data structure also updated integration example
* updated object structure for universal ids that is added to bid request, add universalID object handling to rubiconBidAdapter
* updated markdown example configuration
* fix for syncDelay, added auction end listener before setting syncDelay timer
* update to prepare universalID object if adUnits exists
* add gdpr consent data to request bids hook, warn on not found, info if found
* add test for valid gdpr consent string, exits universal id module on fail
* update gdpr consent to check gdprApplies, add cmp code to integration example. update init to use dependency injection
* implemented test for gdpr consent to store locally (purpose #1)
* added consentString decode to check for purpose #1 (user consents to have data stored locally)
* fix initSubmodule function arguments for changed signature
* changed submodule getId method signature to pass a consentData argument
* tests update with dependency container
* update spec to un-comment disabled expect statement
* in-progress DI conversion
* update to fix test missing dependency for utils
* removed getIdCallbackHandler function because it was inlined within initSubmodules. refactored dependencyContainer argument names to dependencies
* add unit test case for configurations that define invalid storage.type values (only cookie or html5 are valid)
* fixes for html5 storage in module and unit tests. temp comment-out for gdpr test in requestBid hook as it's being refactored into getId submodule methods
* fixes for html5 storage in module and unit tests. temp comment-out for gdpr test in requestBid hook as it's being refactored into getId submodule methods
* added opt_out cookie logic to init
* in-progress commit to update getId method signature with initialized consentManagement data
* changed priority to consent management module's value + 1
* updated both submodule getId functions with consent data handling.
* update hasGDPRConsent to remove unnecessary test for consentData obj since it's tested outside of function, removed utils from dependency injection
* update to move local declarations outside if block, added local var for log prefix since it was accessed more than twice
* changed log prefix to build the string locally instead of passing through getIdData obj
* bug fix for request bid hook priority race condition
* removed consentData prop from init dependencies obj, updated jsdoc comments removing consentData prop
* removed consentData prop from init arguments
* update integration example to test gdpr cmpApi type of 'static'
* refactor to combine request bid hooks into single hook, also other opts and formatting changes
* additions/updates to logging, additions/updates to jsdoc comments, various refactoring and formatting updates
* fixed how GDPR purpose 1 permission is checked, removed decode function and read from consentData.vendorConsents.purposeConsents[1] (key value 1 is for "purpose 1")
* fix for hasGDPRConsent functions, changed object prop accessor name from 'consentData.vendorConsent' to 'consentData.vendorData'
* small changes to log messages and code formatting
* changed submodule property configKey to configName for consistency with the submodule config property name
* updated logging message text and small format change
* updated jsdoc comment to reduce line length
* formatting fix and jsdoc update
* reverted changes to support universal id in rubiconBidAdapter, will open a separate PR for the adapter code changes.
* added logging messages to catch statements
* fix unit tests using the document cookie
* fix to extra module name in log message
* changed function return type array to undefined on invalid config
* moved encodeURIComponenent and decodeURIComponenent into setCookie and getCookie
* refactor to resolve issues creating certain unit tests
* add tests for config variations, small fixes for issues found writing tests
* removed debug console.log statements
* removed set initializedSubmodules value in init
* fix to remove test cookie from spec, updated example with submodule config value object
* added tests checking that config submodule props create correct number of submodules
* added test for syncDelay config update
* fixes for LGTM and imports for src are now relative
* formatting fix semicolon
* test reverted to debug circleci failure
* changed request bids hook priority to load after consentManagement
* test to resolve circle ci errors
* test to resolve circle ci errors
* fixed name camel case error
* changed unifiedid decode test property name from pubcid to ttid
* added universal id support to bid adapter
* added unit test for universal id support in bid adapter
* optimized last unit test added
* renamed universalID to userId
* removed file from universal id branch1 parent eeddc24 commit edbe587Copy full SHA for edbe587
File tree
Expand file treeCollapse file tree
2 files changed
+18
-0
lines changedFilter options
- modules
- test/spec/modules
Expand file treeCollapse file tree
2 files changed
+18
-0
lines changedmodules/rubiconBidAdapter.js
Copy file name to clipboardExpand all lines: modules/rubiconBidAdapter.js+5Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
265 | 265 |
| |
266 | 266 |
| |
267 | 267 |
| |
| 268 | + | |
268 | 269 |
| |
269 | 270 |
| |
270 | 271 |
| |
| |||
367 | 368 |
| |
368 | 369 |
| |
369 | 370 |
| |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
370 | 375 |
| |
371 | 376 |
| |
372 | 377 |
| |
|
test/spec/modules/rubiconBidAdapter_spec.js
Copy file name to clipboardExpand all lines: test/spec/modules/rubiconBidAdapter_spec.js+13Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1060 | 1060 |
| |
1061 | 1061 |
| |
1062 | 1062 |
| |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
1063 | 1076 |
| |
1064 | 1077 |
| |
1065 | 1078 |
| |
|
0 commit comments