Skip to content
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

Starrify authorization header in __repr__ overrides HTTPClient header #17

Closed
sserrata opened this issue Apr 24, 2018 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@sserrata
Copy link
Member

  • Palo Alto Networks Cloud Python SDK version: 1.0.2
  • Python version: 2.7.x, 3.5.x, 3.6.x
  • Operating System: All

Description

Starrifying self.kwargs['headers']['authorization'] in __repr__ overrides access_token in HTTPClient header when __str__ or __repr__ are called.

Possible Fixes

  • Refrain from updating the value of self.kwargs['headers']['authorization'].
  • Switch to deepcopy() instead of a shallow copy().

Considerations

  • deepcopy() might be less performant than copy() or even json.dumps().
  • Updating __repr__ so that it doesn't need to update value of self.kwargs['headers']['authorization'] might result in "uglier" pattern.
  • Solution needs to be compatible with all service and HTTPClient classes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant