(func)
| 64 | |
| 65 | |
| 66 | def add_auth_token_to_headers(func): |
| 67 | def decorate(*args, **kwargs): |
| 68 | headers = kwargs.get("headers", dict()) |
| 69 | |
| 70 | token = kwargs.pop("token", None) |
| 71 | if token: |
| 72 | headers["X-Auth-Token"] = str(token) |
| 73 | kwargs["headers"] = headers |
| 74 | |
| 75 | api_key = kwargs.pop("api_key", None) |
| 76 | if api_key: |
| 77 | headers["St2-Api-Key"] = str(api_key) |
| 78 | kwargs["headers"] = headers |
| 79 | |
| 80 | return func(*args, **kwargs) |
| 81 | |
| 82 | return decorate |
| 83 | |
| 84 | |
| 85 | def add_json_content_type_to_headers(func): |
nothing calls this directly
no outgoing calls
no test coverage detected