(self)
| 2100 | ) |
| 2101 | |
| 2102 | def _build_headers(self): |
| 2103 | auth_token = None |
| 2104 | if self.ENV_VAR_AUTH_TOKEN_FILE in self._environ: |
| 2105 | auth_token_file_path = self._environ[self.ENV_VAR_AUTH_TOKEN_FILE] |
| 2106 | with open(auth_token_file_path) as token_file: |
| 2107 | auth_token = token_file.read() |
| 2108 | elif self.ENV_VAR_AUTH_TOKEN in self._environ: |
| 2109 | auth_token = self._environ[self.ENV_VAR_AUTH_TOKEN] |
| 2110 | if auth_token is not None: |
| 2111 | self._validate_auth_token(auth_token) |
| 2112 | return {'Authorization': auth_token} |
| 2113 | |
| 2114 | def _validate_auth_token(self, auth_token): |
| 2115 | if "\r" in auth_token or "\n" in auth_token: |
no test coverage detected