Improve/client: update public api and refactoring - #15
Closed
gagantrivedi wants to merge 5 commits into
Closed
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
|
|
||
| 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) |
Contributor
There was a problem hiding this comment.
We should also change this from self.bt
| """ | ||
| headers = headers or {} | ||
|
|
||
| headers["X-Environment-Key"] = environment_key |
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
Since we're changing the method signatures, we should change this from identity to identifier.
Contributor
|
I think this can be closed in favour of #17 @gagantrivedi ? |
Member
Author
|
Closing in favor of #17 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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