-
Notifications
You must be signed in to change notification settings - Fork 32
fix: Adding a key for technical/private data in SFEOS #518
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
base: main
Are you sure you want to change the base?
Conversation
4b6e7e0 to
379ea80
Compare
jonhealy1
left a comment
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 really useful, just a couple of thoughts:
- let's allow for a list of private data fields.
- most Users will have private fields listed under
propertiesso we need to account for nested fields
ie. PRIVATE_DATA_FIELDS=properties.private_id,properties.private_name
| private_data_field = os.getenv("PRIVATE_DATA_FIELD") | ||
| if get_bool_env("HIDE_PRIVATE_DATA") and private_data_field: | ||
| stac_item.pop(private_data_field, None) | ||
| return stac_item |
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.
- let's allow for a list of private data fields.
PRIVATE_DATA_FIELDS - most Users will have private fields listed under
propertiesso we need to account for nested fields
83990d9 to
1eaf552
Compare
|
|
||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_hide_private_data_from_item(app_client, txn_client, load_test_data): |
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.
Everything is looking really good. Let's just add a test case with a field like properties.confidential to make sure that nested fields are being excluded.
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.
Thank you @jonhealy1 I have expanded the test with a test case properties.private_data.
6cf20d9 to
92f0ca3
Compare
jonhealy1
left a comment
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.
Looks great thanks!
Description:
Add the
HIDE_PRIVATE_DATAandPRIVATE_DATA_FIELDenvironment variables to toggle inclusion of private or technical fields in SFEOS responses:true: hides private datafalse: returns full responseImproves control over sensitive data exposure while maintaining backward compatibility.
PR Checklist:
pre-commit run --all-files)make test)