Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

3.2.2.3 Support filtering and metadata configuration of Tiles #18

Closed
pjenvey opened this issue Feb 22, 2021 · 3 comments · Fixed by #51
Closed

3.2.2.3 Support filtering and metadata configuration of Tiles #18

pjenvey opened this issue Feb 22, 2021 · 3 comments · Fixed by #51
Assignees
Labels
5 Estimate - l - Moderately complex, will require some effort but clearly defined. question Further information is requested

Comments

@pjenvey
Copy link
Member

pjenvey commented Feb 22, 2021

We need the ability to:

  • restrict which tiles are presented to the client
  • addition of metadata to each tile
@pjenvey pjenvey added the 5 Estimate - l - Moderately complex, will require some effort but clearly defined. label Feb 22, 2021
@pjenvey pjenvey self-assigned this Feb 22, 2021
@jrconlin jrconlin changed the title Support filtering and metadata configuration of Tiles 3.2.2.3 Support filtering and metadata configuration of Tiles Apr 9, 2021
@pjenvey pjenvey assigned jrconlin and unassigned pjenvey Apr 19, 2021
@pjenvey
Copy link
Member Author

pjenvey commented Apr 19, 2021

@ncloudioj The current top-sites bucket has an include/exclude-regions field. Will contile need the ability to include advertisers by region at this point?

E.g. we may want to include Yandex but only in the RU region. However adM might only return Yandex when contile asks for RU Tiles anyway. What I'm getting at is does the top-sites' buckets' include/exclude-region exist only to workaround the bucket including data for all regions (these include/excludes are specified by adM) or do we use it for our own curation purposes?

@pjenvey
Copy link
Member Author

pjenvey commented Apr 19, 2021

The only metadata we need added is a position field. E.g. include the "Amazon" tile with a position of 1.

The other 2 bits that should likely be defined with the inclusion filter are an allow list of hostnames advertiser_url may reside on. At some point when we begin serving images through the CDN (and the client actually uses them, they currently do not), approved by a human image_url configuration would also be defined with the inclusion filter.

E.g. include the "Amazon" tile with a position of 1, url allow list of [amazon.com, amazon.ca]. And later, additionally with an image allow list of probably a sha1?

@jrconlin
Copy link
Member

I had originally thought that the list of sites would be fairly small, but what you're describing makes me think that the rules could get fairly complex quickly. Enough to already make me wonder if using a centralized db to store the filter criteria might be a better option, even if there's some criteria duplication possible. (e.g.
a schema of "id", "country","region", "lang" where a given ID would be shown, unless there was a filter specified, and then it would use that filter to determine viewership.

for example:

rule description
"123", "us", None, None display partner "123", if the client IP reports being in the "US"
"456", "ca", "bc", "en" display partner "456" only in British Columbia, CA if the UA reports being set to "English"

etc.

Granted, this does potentially raise a lot more questions (who has access to that DB, how are changes performed, how are they audited, etc.) but it does mean that changes could be reflected quickly, tiles could be brought down or up with greatly reduced propagation, and we have a fair bit of control over display.

@jrconlin jrconlin added the question Further information is requested label Apr 19, 2021
jrconlin added a commit that referenced this issue Apr 21, 2021
This allows strict host filtering based on a config setting `allowed_vendors`
which is a JSON array of allowed vendor host names (e.g.
`["example.com", "foo.example.org", "bar.foo.example.org"]`)
Note: currently hosts must match exactly. so for this example
"https://example.com/link" would match, but
"https://gorp.example.com/link" would not.

Closes #18
jrconlin added a commit that referenced this issue May 4, 2021
* feat: Add initial filtering

This allows strict host filtering based on a config setting 

`--adm_settings` / `CONTILE_ADM_SETTINGS` accepts a JSON formatted hash of values. The argument should be flattened, but it is expanded below for legibility:

```javascript
CONTILE_ADM_SETTINGS='{
"Example": {   /* The partner name (while case insensitive, it should match the 'name' field response */
   "advertiser_hosts": ["example.com", "www.example.com"], /* Allowed host names for `advertiser_url` */
   "position": 0, /* The tile position suggestion */
   "include_regions": ["en", "en-US/TX"], /* valid region codes for this tile. */
},
"Default": { /* A default set of values. These are used if no value is specified for an individual partner */
   "impression_hosts": ["example.org", "www.example.org"], /* valid hosts for the `impression_url` */
   "click_hosts": ["example.net", "click.foo.example.net"], /* valid hosts for `click_url` */
}}
```

This PR also:
* wires up location information
* Tracks anominal partner info 


Closes #18, #50
Issue #36, #22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
5 Estimate - l - Moderately complex, will require some effort but clearly defined. question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants