Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bing Ads Integration #5197

Merged
merged 43 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
422e75b
Microsoft Advertising (Bing Ads)
galvana Aug 14, 2024
aaaad5f
Adding Base Bing script placeholder space
Vagoasdf Aug 14, 2024
3fc13c0
Base Bing Script. Using Sanbox credentials.
Vagoasdf Aug 20, 2024
5cdec3c
Adding fixture csv for Bulk Uploading
Vagoasdf Aug 20, 2024
41c9053
Setting up Call Nro 1
Vagoasdf Aug 20, 2024
f0412d7
Updating Call Nro 2, Getting Account Request
Vagoasdf Aug 20, 2024
3d2a009
Updating Call Nro 3: Getting Audiences by ID
Vagoasdf Aug 20, 2024
2723fc3
Building up the CSV
Vagoasdf Aug 20, 2024
9080d63
Creating the CSV and sending the Bulk Upload
Vagoasdf Aug 21, 2024
c215989
Updating SaaSPreparedRequests to send Files
Vagoasdf Aug 21, 2024
8cdaec9
Cleaning Up Bing Script and Playground
Vagoasdf Aug 21, 2024
80874ed
implementing XPath to avoid nesting loops
Vagoasdf Aug 21, 2024
23efb45
preparing Productiond endpoints in config
Vagoasdf Aug 21, 2024
e2c68ca
Managing Common Requests Failures
Vagoasdf Aug 22, 2024
162b8a1
Adding Base Fixtures Data
Vagoasdf Aug 22, 2024
a4a2199
Adding Endpoints for Production
Vagoasdf Aug 22, 2024
7e16d11
Setting up missing mixture data
Vagoasdf Aug 23, 2024
1b070c3
Using Client URI for proper targeting of endpoints
Vagoasdf Aug 23, 2024
e7172fd
Adding required parameter on the delete request
Vagoasdf Aug 23, 2024
5b22de6
Using request override for the test connection
Vagoasdf Aug 23, 2024
a2284f9
Setting up for multiple audiences
Vagoasdf Aug 23, 2024
f6e5cb2
Updating Request Overrides for multiple accounts sucessfully
Vagoasdf Aug 26, 2024
7cdb936
Properly setting up the headers authentication on Bulk Upload
Vagoasdf Aug 26, 2024
c81eece
Setting Correctly the base variables for the Test Connection override…
Vagoasdf Aug 26, 2024
4a1363c
Using live endpoints in microsoft ads config
Vagoasdf Aug 26, 2024
5dcd8cb
running linters and format checkers
Vagoasdf Aug 26, 2024
4e5bc7a
base defusedxm and Element import and funciton mapping
Vagoasdf Aug 26, 2024
a467a61
Adding dev token to the missing config
Vagoasdf Aug 26, 2024
5310cf2
FInalizing update import on the request override
Vagoasdf Aug 26, 2024
511696b
Adding removal of file after being used
Vagoasdf Aug 26, 2024
059b09f
Updating Shared Schemas to comply with Pydantic V2 Upgrade
Vagoasdf Aug 26, 2024
46a536b
Merge branch 'main' into bing-ads
galvana Aug 27, 2024
c095a9e
Running Linters and static tests
Vagoasdf Aug 27, 2024
c1bef90
Adding Types stub so mypy can recognize the defusedXML library
Vagoasdf Aug 27, 2024
b1ee7e3
Merge branch 'main' into bing-ads
galvana Aug 27, 2024
91fb2c4
Merge branch 'main' into bing-ads
galvana Aug 28, 2024
cd6e057
Remove Sandbox References
Vagoasdf Aug 28, 2024
5dc3ace
Removing Sandbox Input on the base user delete
Vagoasdf Aug 28, 2024
57b274d
Setting up a proper Type for files. Adding Arbitrary types
Vagoasdf Aug 28, 2024
b63e025
Removing unnecesary parameters
Vagoasdf Aug 28, 2024
488c78c
Updating Changelog
Vagoasdf Aug 28, 2024
203e887
Uploading Import order on shared schema
Vagoasdf Aug 28, 2024
8f0fe95
Merge branch 'main' into bing-ads
galvana Aug 28, 2024
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The types of changes are:
- Added Gzip Middleware for responses [#5225](https://github.com/ethyca/fides/pull/5225)
- Adding source and submitted_by fields to privacy requests (Fidesplus) [#5206](https://github.com/ethyca/fides/pull/5206)
- Added Action Required / Monitored / Unmonitored tabs to Data Detection & Discovery page [#5236](https://github.com/ethyca/fides/pull/5236)

- Adding erasure support for Microsoft Advertising [#5197](https://github.com/ethyca/fides/pull/5197)

### Changed
- Removed unused `username` parameter from the Delighted integration configuration [#5220](https://github.com/ethyca/fides/pull/5220)
Expand Down
88 changes: 88 additions & 0 deletions data/saas/config/microsoft_advertising_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
saas_config:
fides_key: <instance_fides_key>
name: Microsoft Advertising
type: microsoft_advertising
description: A sample schema representing the Microsoft Advertising integration for Fides
user_guide: https://docs.ethyca.com/user-guides/integrations/saas-integrations/microsoft-advertising
version: 0.1.0

connector_params:
- name: domain
default_value: login.microsoftonline.com
description: The base URL for Microsoft Advertising Login Authentication
- name: client_id
label: Client ID
description: Your Microsoft Advertising application's client ID
- name: client_secret
label: Client secret
description: Your Microsoft Advertising application's client secret
sensitive: True
- name: dev_token
label: Developer token
description: Your Microsoft Advertising application's developer token
sensitive: True
- name: redirect_uri
label: Redirect URL
description: The Fides URL to which users will be redirected upon successful authentication

client_config:
protocol: https
host: <domain>
authentication:
strategy: oauth2_authorization_code
configuration:
expires_in: 3600
authorization_request:
method: GET
path: /consumers/oauth2/v2.0/authorize
query_params:
- name: client_id
value: <client_id>
- name: redirect_uri
value: <redirect_uri>
- name: response_type
value: code
- name: scope
value: openid profile offline_access https://ads.microsoft.com/msads.manage
- name: state
value: <state>
token_request:
method: POST
path: /consumers/oauth2/v2.0/token
headers:
- name: Content-Type
value: application/x-www-form-urlencoded
body: |
{
"client_id": "<client_id>",
"client_secret": "<client_secret>",
"grant_type": "authorization_code",
"code": "<code>",
"redirect_uri": "<redirect_uri>"
}
refresh_request:
method: POST
path: /consumers/oauth2/v2.0/token
headers:
- name: Content-Type
value: application/x-www-form-urlencoded
body: |
{
"client_id": "<client_id>",
"client_secret": "<client_secret>",
"grant_type": "refresh_token",
"refresh_token": "<refresh_token>",
"redirect_uri": "<redirect_uri>"
}

test_request:
request_override: microsoft_advertising_test_connection

endpoints:
- name: user
requests:
delete:
request_override: microsoft_advertising_user_delete
param_values:
- name: email
identity: email
5 changes: 5 additions & 0 deletions data/saas/dataset/microsoft_advertising_dataset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dataset:
- fides_key: <instance_fides_key>
name: Microsoft Advertising Dataset
description: A sample dataset representing the Microsoft Advertising integration for Fides
collections: []
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cryptography==42.0.0
dask==2022.9.2
deepdiff==6.3.0
defusedxml==0.7.1
types-defusedxml==0.7.0.20240218
expandvars==0.9.0
fastapi[all]==0.111.0
fastapi-pagination[sqlalchemy]==0.12.25
Expand Down
8 changes: 6 additions & 2 deletions src/fides/api/schemas/saas/shared_schemas.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from enum import Enum
from typing import Any, Dict, Optional
from io import BufferedReader
from typing import Any, Dict, List, Optional, Tuple

from pydantic import BaseModel, ConfigDict

RequestFile = Tuple[str, Tuple[str, BufferedReader, str]]


class HTTPMethod(Enum):
"""Enum to represent HTTP Methods"""
Expand All @@ -26,7 +29,8 @@ class SaaSRequestParams(BaseModel):
headers: Dict[str, Any] = {}
query_params: Dict[str, Any] = {}
body: Optional[str] = None
model_config = ConfigDict(use_enum_values=True)
files: Optional[List[RequestFile]] = None
model_config = ConfigDict(use_enum_values=True, arbitrary_types_allowed=True)


class ConnectorParamRef(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def get_authenticated_request(
headers=request_params.headers,
params=request_params.query_params,
data=request_params.body,
files=request_params.files,
).prepare()

# add authentication if provided
Expand Down
Loading
Loading