-
Notifications
You must be signed in to change notification settings - Fork 11
Improve/client: update public api and refactoring #15
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
Conversation
Update argument name used for environment key to environment_api_key from environment_id
Add http_headers: which accepts a dict of headers required to talk to the server including auth or any custom headers
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.
We should make this version 3.0.
|
|
||
| def setUp(self) -> None: | ||
| self.bt = Flagsmith(environment_id=self.test_environment_key, api=TEST_API_URL) | ||
| self.bt = Flagsmith(environment_key=self.test_environment_key, api=TEST_API_URL) |
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.
We should also change this from self.bt
| """ | ||
| headers = headers or {} | ||
|
|
||
| headers["X-Environment-Key"] = environment_key |
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.
We should probably pull this out into a constant
API_TOKEN_HEADER = "X-Environment-Key"|
|
||
| def get_flags_for_user(self, identity): | ||
| def get_flags_for_user( | ||
| self, identity: str |
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.
Since we're changing the method signatures, we should change this from identity to identifier.
|
I think this can be closed in favour of #17 @gagantrivedi ? |
|
Closing in favor of #17 |
Update argument name used for environment key to environment_api_key
from environment_id
Add type hints
move generate_header content to utils
Add http_headers to analytics processor which accepts a dict of headers required to talk
to the server including auth or any custom headers