-
Notifications
You must be signed in to change notification settings - Fork 16
Start a new "email" ConnectionConfig type [#1134] #1142
Conversation
…the email connector isn't fleshed out yet.
dataset: | ||
- fides_key: email_dataset | ||
name: Dataset not accessible automatically | ||
description: Example of a email dataset with a collection waiting on postgres input | ||
collections: | ||
- name: daycare_customer | ||
fields: | ||
- name: id | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
primary_key: true | ||
- name: customer_id | ||
data_categories: [user] | ||
fidesops_meta: | ||
references: | ||
- dataset: postgres_example_test_dataset | ||
field: customer.id | ||
direction: from | ||
- name: children | ||
fields: | ||
- name: id | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
primary_key: true | ||
- name: first_name | ||
data_categories: [user.childrens] | ||
- name: last_name | ||
data_categories: [user.childrens] | ||
- name: birthday | ||
data_categories: [user.childrens] | ||
fidesops_meta: | ||
data_type: string | ||
- name: parent_id | ||
data_categories: [user] | ||
fidesops_meta: | ||
references: | ||
- dataset: email_dataset | ||
field: daycare_customer.id | ||
direction: from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contrived dataset that will be used for testing in a followup PR.
class EmailSchema(ConnectionConfigSecretsSchema): | ||
"""Schema to validate the secrets needed for the EmailConnector""" | ||
|
||
to_email: str | ||
test_email: Optional[str] # Email to send a connection test email | ||
|
||
_required_components: List[str] = ["to_email"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently I'm thinking the user can just configure the single email that should be sent out (or we could do a list of emails, that's in an earlier commit). Additionally, if they have a "test_email" configured, I think they could send an email to themselves if they wanted with the same template they'd send to the user, just without the data in it, so they could preview if they wished.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current design just has this separately creating the single EmailConfig
that Catherine developed, and using that resource to do the sending part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To one email
address is a fair assumption for now! And good thoughts on the test email for testing the connector.
|
||
class EmailConnector(BaseConnector[None]): | ||
def query_config(self, node: TraversalNode) -> ManualQueryConfig: | ||
""" | ||
Stub | ||
""" | ||
|
||
def create_client(self) -> None: | ||
"""Stub""" | ||
|
||
def close(self) -> None: | ||
"""Stub""" | ||
|
||
def test_connection(self) -> Optional[ConnectionTestStatus]: | ||
""" | ||
Override to skip connection test for now | ||
""" | ||
return ConnectionTestStatus.skipped | ||
|
||
def retrieve_data( # type: ignore | ||
self, | ||
node: TraversalNode, | ||
policy: Policy, | ||
privacy_request: PrivacyRequest, | ||
input_data: Dict[str, List[Any]], | ||
) -> Optional[List[Row]]: | ||
"""Access requests are not supported at this time.""" | ||
return [] | ||
|
||
def mask_data( # type: ignore | ||
self, | ||
node: TraversalNode, | ||
policy: Policy, | ||
privacy_request: PrivacyRequest, | ||
rows: List[Row], | ||
) -> Optional[int]: | ||
"""Stub""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all being fleshed out in a follow-up PR. "retrieve_data" won't do anything, "mask_data" will figure out what data we need to send to the user.
Normally "mask_data" has rows retrieved from the access portion, but we won't have that for an email connector, so the email we send will need to be a combination of access/erasure information, to both tell them how to locate the data (access) and how/which fields to mask.
…onnector_base # Conflicts: # CHANGELOG.md
* Start a new "email" ConnectionConfig type. * Hide "email" type from the get_connection_types endpoint for now, as the email connector isn't fleshed out yet. * Update CHANGELOG. * Simplify by sending one email to start? * Update request body in postman collection. * Fix CHANGELOG formatting.
👉 Currently undocumented, the EmailConnector isn't fully fleshed out yet, that will come in a follow-up PR.
❗ Contains migration
Purpose
Add the foundation for a new
email
ConnectionConfig type. EmailConnector doesn't work yet here, that will be added in a follow-up PR.Changes
email
to the ConnectionType enumto_email
for the user that must be notified and an optionaltest_email
to be used for the connection testEmailConnector
class with most methods stubbed out.Checklist
CHANGELOG.md
fileCHANGELOG.md
file is being appended toUnreleased
section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.Run Unsafe PR Checks
label has been applied, and checks have passed, if this PR touches any external servicesTicket
Fixes #1134