feat(flags): Add method for fetching decrypted remote config flag payload#180
feat(flags): Add method for fetching decrypted remote config flag payload#180havenbarnes merged 17 commits intomasterfrom
Conversation
There was a problem hiding this comment.
PR Summary
This PR adds functionality to fetch decrypted remote config flag payloads through new methods in the PostHog Python client, enabling secure access to flag configurations.
- New
remote_configfunction in/posthog/request.pyneeds correction in success message and parameter validation - Added
get_decrypted_feature_flag_payloadmethod in/posthog/__init__.pyrequires improved documentation for parameters and return types - Implemented
get_remote_config_payloadin/posthog/client.pywith personal API key validation and error handling - API endpoint path construction in
/posthog/request.pycould be improved for better clarity - Missing type hints for new methods across all modified files
3 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile
posthog/request.py
Outdated
| def remote_config(api_key: str, host: Optional[str] = None, flag_id: str = "", timeout: int = 15) -> Any: | ||
| res = get(api_key, host, f"/api/projects/@current/feature_flags/{flag_id}/remote_config/", timeout) | ||
| return _process_response(res, success_message="Feature flags decided successfully") |
There was a problem hiding this comment.
logic: Success message should be specific to remote config, e.g. 'Remote config fetched successfully' instead of reusing 'Feature flags decided successfully'
There was a problem hiding this comment.
i agree with greptile here
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
Just so I understand, decryption always happens on the server, correct? And it looks like there's an API endpoint to get a single decrypted setting, but not a way to get all of them? |
Correct!
Yes, the |
Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com>
…tHog/posthog-python into feat/encrypted-flag-payloads
…to feat/encrypted-flag-payloads
Context: https://github.com/PostHog/posthog/pull/27414/files

