-
Notifications
You must be signed in to change notification settings - Fork 74
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
Fides ints 62 greenhouse harvestapi access erasure #4945
Merged
galvana
merged 30 commits into
main
from
fides_ints_62_greenhouse_harvestapi_access_erasure
Jun 11, 2024
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
f23229b
Init commit
MarcGEthyca d0c9d72
Update 1 to the dataset
MarcGEthyca 2a5d838
icon
MarcGEthyca fdb1621
Simplified Version
MarcGEthyca 16ad9bf
access passing (erasure passing too but cheating)
MarcGEthyca 32c26b8
All tests passing ... still cheating with one value
MarcGEthyca 39f8b5d
more cleanup
MarcGEthyca f1ee0b7
Merge branch 'main' into fides_ints_62_greenhouse_harvestapi_access_e…
MarcGEthyca 842bb41
All passing now
MarcGEthyca a30d583
Cleaning a comment
MarcGEthyca 9b0de7f
removed comment
MarcGEthyca edf8a44
Merge branch 'main' into fides_ints_62_greenhouse_harvestapi_access_e…
MarcGEthyca 4868950
Expanding details required to provide requested values
MarcGEthyca 163fa3c
swapped text to indicate navigation
MarcGEthyca 715edcf
Changelog
MarcGEthyca 9125330
fixed name of param
MarcGEthyca 2ba019d
Fixes to labels and descriptions
MarcGEthyca d28770a
Removed extraneous lines
MarcGEthyca 5fba5a9
fixes to icon, general cleanup
MarcGEthyca 62699a8
Cleanup
MarcGEthyca 87b9095
Cleaned up description
MarcGEthyca 847fc2f
Renaming
MarcGEthyca edef1a7
Changed naming to be more user friendly
MarcGEthyca 63a2a51
Merge branch 'main' into fides_ints_62_greenhouse_harvestapi_access_e…
MarcGEthyca 667e8a9
Merge branch 'main' into fides_ints_62_greenhouse_harvestapi_access_e…
MarcGEthyca 12fff6f
Merge branch 'main' into fides_ints_62_greenhouse_harvestapi_access_e…
MarcGEthyca 266fc95
Merge branch 'main' into fides_ints_62_greenhouse_harvestapi_access_e…
MarcGEthyca 6d6dfe7
Updating the basic auth strategy to support empty passwords
galvana 4a6d3b7
Merge branch 'main' into fides_ints_62_greenhouse_harvestapi_access_e…
galvana 43bef14
Mypy fix
galvana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
saas_config: | ||
fides_key: <instance_fides_key> | ||
name: Greenhouse | ||
type: greenhouse | ||
description: A sample schema representing the Greenhouse integration for Fides | ||
user_guide: https://docs.ethyca.com/user-guides/integrations/saas-integrations/greenhouse | ||
version: 0.1.0 | ||
|
||
connector_params: | ||
- name: domain | ||
label: Domain | ||
description: The Harvest domain. Default harvest.greenhouse.io | ||
default_value: harvest.greenhouse.io | ||
- name: api_key | ||
label: API key | ||
description: The Harvest API key. This can be generated by navigating from the Greenhouse main page to Configure then Dev Center then API Credential Management and taking note of the Harvest API key value. | ||
sensitive: True | ||
- name: greenhouse_user_id | ||
label: Greenhouse user ID | ||
description: Your Greenhouse user id. This value can be seen by any Greenhouse user from the main page by examining the URL when viewing this user. From the Greenhouse main page, navigate to Configure select Users then Select the desired user. The URL when viewing the account will look like this https://app8.greenhouse.io/account/users/4054555008/edit where the numeric value is the Greenhouse user ID. | ||
|
||
client_config: | ||
protocol: https | ||
host: <domain> | ||
authentication: | ||
strategy: basic | ||
configuration: | ||
username: <api_key> | ||
|
||
test_request: | ||
method: GET | ||
path: /v1/candidates | ||
query_params: | ||
- name: per_page | ||
value: 1 | ||
|
||
endpoints: | ||
- name: user | ||
requests: | ||
read: | ||
method: GET | ||
path: /v1/candidates | ||
query_params: | ||
- name: email | ||
value: <email> | ||
param_values: | ||
- name: email | ||
identity: email | ||
update: | ||
method: PUT | ||
path: /v1/candidates/<user_id>/anonymize | ||
headers: | ||
- name: On-Behalf-Of | ||
value: <greenhouse_user_id> | ||
param_values: | ||
- name: greenhouse_user_id | ||
connector_param: greenhouse_user_id | ||
- name: user_id | ||
references: | ||
- dataset: <instance_fides_key> | ||
field: user.id | ||
direction: from | ||
query_params: | ||
- name: fields | ||
value: "full_name,current_company,current_title,tags,phone_numbers,emails,social_media_links,websites,addresses,location,custom_candidate_fields,source,recruiter,coordinator,attachments,application_questions,referral_questions,notes,rejection_notes,email_addresses,activity_items,innotes,inmails,rejection_reason,scorecards_and_interviews,offers,credited_to,headline,all_offer_versions,follow_up_reminders,custom_application_fields,education,employment,candidate_stage_data,prospect_owner,custom_rejection_question_fields,touchpoints,prospect_pool_and_stage,prospect_jobs,prospect_offices,prospect_offices_and_departments,third_party_integrations" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
dataset: | ||
- fides_key: <instance_fides_key> | ||
name: Greenhouse Dataset | ||
description: A sample dataset representing the Greenhouse integration for Fides | ||
collections: | ||
- name: user | ||
fields: | ||
- name: id | ||
data_categories: [user.unique_id] | ||
fidesops_meta: | ||
primary_key: True | ||
data_type: integer | ||
- name: first_name | ||
data_categories: [user.name.first] | ||
fidesops_meta: | ||
data_type: string | ||
- name: last_name | ||
data_categories: [user.name.last] | ||
fidesops_meta: | ||
data_type: string | ||
- name: company | ||
- name: title | ||
- name: created_at | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: string | ||
- name: updated_at | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: string | ||
- name: last_activity | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: string | ||
- name: is_private | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: boolean | ||
- name: photo_url | ||
- name: attachments | ||
- name: application_ids | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: "integer[]" | ||
- name: phone_numbers | ||
fidesops_meta: | ||
data_type: "object[]" | ||
fields: | ||
- name: value | ||
data_categories: [user.contact.phone_number] | ||
fidesops_meta: | ||
data_type: string | ||
- name: type | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: string | ||
- name: addresses | ||
- name: email_addresses | ||
fidesops_meta: | ||
data_type: "object[]" | ||
fields: | ||
- name: value | ||
data_categories: [user.contact.email] | ||
fidesops_meta: | ||
data_type: string | ||
- name: type | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: string | ||
- name: website_addresses | ||
- name: social_media_addresses | ||
- name: recruiter | ||
- name: coordinator | ||
- name: can_email | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: boolean | ||
- name: tags | ||
- name: applications | ||
fidesops_meta: | ||
data_type: "object[]" | ||
fields: | ||
- name: id | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: integer | ||
- name: candidate_id | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: integer | ||
- name: prospect | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: boolean | ||
- name: applied_at | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: string | ||
- name: rejected_at | ||
- name: last_activity_at | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: string | ||
- name: location | ||
- name: attachments | ||
- name: source | ||
fidesops_meta: | ||
data_type: object | ||
fields: | ||
- name: id | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: integer | ||
- name: public_name | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: string | ||
- name: credited_to | ||
- name: rejection_reason | ||
- name: rejection_details | ||
- name: jobs | ||
fidesops_meta: | ||
data_type: "object[]" | ||
fields: | ||
- name: id | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: integer | ||
- name: name | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: string | ||
- name: job_post_id | ||
- name: status | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: string | ||
- name: current_stage | ||
fidesops_meta: | ||
data_type: object | ||
fields: | ||
- name: id | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: integer | ||
- name: name | ||
data_categories: [system.operations] | ||
fidesops_meta: | ||
data_type: string | ||
- name: answers | ||
- name: prospective_department | ||
- name: prospective_office | ||
- name: prospect_detail | ||
fidesops_meta: | ||
data_type: object | ||
fields: | ||
- name: prospect_pool | ||
- name: prospect_stage | ||
- name: prospect_owner | ||
- name: educations | ||
- name: employments | ||
- name: linked_user_ids | ||
- name: custom_fields | ||
fidesops_meta: | ||
data_type: object | ||
fields: | ||
- name: work_authorization | ||
- name: keyed_custom_fields | ||
fidesops_meta: | ||
data_type: object | ||
fields: | ||
- name: work_authorization |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
from base64 import b64encode | ||
from typing import Any, Dict, Generator | ||
|
||
import pydash | ||
import pytest | ||
import requests | ||
|
||
from tests.ops.integration_tests.saas.connector_runner import ( | ||
ConnectorRunner, | ||
generate_random_email, | ||
) | ||
from tests.ops.test_helpers.vault_client import get_secrets | ||
|
||
secrets = get_secrets("greenhouse") | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def greenhouse_secrets(saas_config) -> Dict[str, Any]: | ||
return { | ||
"domain": pydash.get(saas_config, "greenhouse.domain") or secrets["domain"], | ||
"api_key": pydash.get(saas_config, "greenhouse.api_key") or secrets["api_key"], | ||
"greenhouse_user_id": pydash.get(saas_config, "greenhouse.greenhouse_user_id") | ||
or secrets["greenhouse_user_id"], | ||
} | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def greenhouse_identity_email(saas_config) -> str: | ||
return ( | ||
pydash.get(saas_config, "greenhouse.identity_email") | ||
or secrets["identity_email"] | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def greenhouse_erasure_identity_email() -> str: | ||
return generate_random_email() | ||
|
||
|
||
@pytest.fixture | ||
def greenhouse_erasure_data( | ||
greenhouse_secrets, | ||
greenhouse_erasure_identity_email: str, | ||
) -> Generator: | ||
base_url = f"https://{greenhouse_secrets['domain']}/v1/candidates" | ||
headers = { | ||
"On-Behalf-Of": f"{greenhouse_secrets['greenhouse_user_id']}", | ||
} | ||
# details of the test user - note that the job_id value below is from our instance and the sample job. This id is required for this call to work. | ||
body = { | ||
"first_name": "Test", | ||
"last_name": "Ethyca", | ||
"company": "Ethyca", | ||
"title": "Customer Success Representative", | ||
"is_private": "false", | ||
"phone_numbers": [{"value": "555-1212", "type": "mobile"}], | ||
"addresses": [{"value": "123 Fake St.", "type": "home"}], | ||
"email_addresses": [ | ||
{"value": greenhouse_erasure_identity_email, "type": "work"}, | ||
{"value": "testpersonal@example.com", "type": "personal"}, | ||
], | ||
"website_addresses": [{"value": "ethyca.example.com", "type": "personal"}], | ||
"social_media_addresses": [ | ||
{"value": "linkedin.example.com/ethyca"}, | ||
{"value": "@ethyca"}, | ||
], | ||
"educations": [ | ||
{ | ||
"start_date": "2001-09-15T00:00:00.000Z", | ||
"end_date": "2004-05-15T00:00:00.000Z", | ||
} | ||
], | ||
"employments": [ | ||
{ | ||
"company_name": "Greenhouse", | ||
"title": "Engineer", | ||
"start_date": "2017-08-15T00:00:00.000Z", | ||
"end_date": "2018-05-15T00:00:00.000Z", | ||
} | ||
], | ||
"tags": ["Walkabout", "Orientation"], | ||
"applications": [{"job_id": 4020768008}], | ||
} | ||
response = requests.post( | ||
base_url, auth=(greenhouse_secrets["api_key"], ""), headers=headers, json=body | ||
) | ||
assert response.ok | ||
json_response = response.json() | ||
user_id = json_response["id"] | ||
assert json_response["id"] > 1 | ||
yield {user_id} | ||
|
||
|
||
@pytest.fixture | ||
def greenhouse_runner( | ||
db, | ||
cache, | ||
greenhouse_secrets, | ||
) -> ConnectorRunner: | ||
return ConnectorRunner( | ||
db, | ||
cache, | ||
"greenhouse", | ||
greenhouse_secrets, | ||
) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
In the future, we could make this more dynamic by using the keys of the
masked_object_fields
map as the query params