Request with no auth header returns MissingAuthenticationToken.
(self)
| 622 | self.mgmt.delete_user(self.account_id, user) |
| 623 | |
| 624 | def test_missing_auth_header(self): |
| 625 | """Request with no auth header returns MissingAuthenticationToken.""" |
| 626 | # Use a raw HTTP request to avoid boto3 adding auth. |
| 627 | resp = requests.post( |
| 628 | self.endpoint, |
| 629 | headers={ |
| 630 | "Content-Type": "application/x-amz-json-1.0", |
| 631 | "X-Amz-Target": "DynamoDB_20120810.ListTables", |
| 632 | }, |
| 633 | json={}, |
| 634 | timeout=30, |
| 635 | verify=not self.endpoint.startswith("https://"), |
| 636 | ) |
| 637 | assert resp.status_code in (400, 403) |
| 638 | body = resp.json() |
| 639 | assert body.get("__type", "").endswith("MissingAuthenticationToken") |
| 640 | # --------------------------------------------------------------------------- |
| 641 | # Mode 1 Backward Compatibility |
| 642 | # --------------------------------------------------------------------------- |