|
22 | 22 | @mark.parametrize( |
23 | 23 | "csrf_settings, reason", |
24 | 24 | ( |
25 | | - ((("cookie_samesite", None),), "CsrfConfig must be a sequence of tuples"), |
26 | | - ((("cookie_samesite", "none"),), "CsrfConfig must be a sequence of tuples"), |
27 | | - ((("cookie_samesite", b"lax"),), "CsrfConfig must be a sequence of tuples"), |
28 | | - ((("cookie_samesite", b"none"),), "CsrfConfig must be a sequence of tuples"), |
29 | | - ((("cookie_samesite", b"strict"),), "CsrfConfig must be a sequence of tuples"), |
30 | | - ((("cookie_samesite", "null"),), "CsrfConfig must be a sequence of tuples"), |
31 | | - ((("cookie_samesite", b"null"),), "CsrfConfig must be a sequence of tuples"), |
32 | | - ((("cookie_samesite", 0),), "CsrfConfig must be a sequence of tuples"), |
33 | | - ((("cookie_samesite", 1),), "CsrfConfig must be a sequence of tuples"), |
34 | | - ((("cookie_samesite", True),), "CsrfConfig must be a sequence of tuples"), |
35 | | - ((("cookie_samesite", False),), "CsrfConfig must be a sequence of tuples"), |
36 | | - ((("cookie_samesite", 2.0),), "CsrfConfig must be a sequence of tuples"), |
37 | | - ((("cookie_samesite", {1, 2, 3}),), "CsrfConfig must be a sequence of tuples"), |
38 | | - ((("cookie_samesite", {1.0, 2.0, 3.0}),), "CsrfConfig must be a sequence of tuples"), |
39 | | - ((("cookie_samesite", {"1", "2", "3"}),), "CsrfConfig must be a sequence of tuples"), |
40 | | - ((("cookie_samesite", [1, 2, 3]),), "CsrfConfig must be a sequence of tuples"), |
41 | | - ((("cookie_samesite", [1.0, 2.0, 3.0]),), "CsrfConfig must be a sequence of tuples"), |
42 | | - ((("cookie_samesite", ["1", "2", "3"]),), "CsrfConfig must be a sequence of tuples"), |
43 | | - ((("cookie_samesite", {"key": "value"}),), "CsrfConfig must be a sequence of tuples"), |
44 | | - ((("cookie_secure", "false"),), "CsrfConfig must be a sequence of tuples"), |
45 | | - ((("cookie_secure", b"true"),), "CsrfConfig must be a sequence of tuples"), |
46 | | - ((("header_name", 2),), "CsrfConfig must be a sequence of tuples"), |
47 | | - ((("header_name", 1.0),), "CsrfConfig must be a sequence of tuples"), |
48 | | - ((("header_name", True),), "CsrfConfig must be a sequence of tuples"), |
49 | | - ((("header_name", b"header_name"),), "CsrfConfig must be a sequence of tuples"), |
50 | | - ((("header_name", []),), "CsrfConfig must be a sequence of tuples"), |
51 | | - ((("header_name", {}),), "CsrfConfig must be a sequence of tuples"), |
52 | | - ((("header_type", 2),), "CsrfConfig must be a sequence of tuples"), |
53 | | - ((("header_type", 1.0),), "CsrfConfig must be a sequence of tuples"), |
54 | | - ((("header_type", True),), "CsrfConfig must be a sequence of tuples"), |
55 | | - ((("header_type", b"header_type"),), "CsrfConfig must be a sequence of tuples"), |
56 | | - ((("header_type", []),), "CsrfConfig must be a sequence of tuples"), |
57 | | - ((("header_type", {}),), "CsrfConfig must be a sequence of tuples"), |
58 | | - ((("httponly", "false"),), "CsrfConfig must be a sequence of tuples"), |
59 | | - ((("httponly", b"true"),), "CsrfConfig must be a sequence of tuples"), |
60 | | - ((("methods", 2),), "CsrfConfig must be a sequence of tuples"), |
61 | | - ((("methods", 1.0),), "CsrfConfig must be a sequence of tuples"), |
62 | | - ((("methods", True),), "CsrfConfig must be a sequence of tuples"), |
63 | | - ((("methods", b"GET, POST"),), "CsrfConfig must be a sequence of tuples"), |
64 | | - ((("methods", "GET, POST"),), "CsrfConfig must be a sequence of tuples"), |
65 | | - ((("methods", {}),), "CsrfConfig must be a sequence of tuples"), |
66 | | - ((("methods", []),), "CsrfConfig must be a sequence of tuples"), |
67 | | - ((("methods", [1, 2, 3]),), "CsrfConfig must be a sequence of tuples"), |
68 | | - ((("methods", ["GET", "POST", "DELETE"]),), "CsrfConfig must be a sequence of tuples"), |
69 | | - ((("methods", (1, 2, 3)),), "CsrfConfig must be a sequence of tuples"), |
70 | | - ((("methods", ("GET", "POST", "DELETE")),), "CsrfConfig must be a sequence of tuples"), |
71 | | - ((("methods", {1, 2, 3}),), "CsrfConfig must be a sequence of tuples"), |
72 | | - ((("methods", ["1", "2", "3"]),), "CsrfConfig must be a sequence of tuples"), |
73 | | - ((("methods", ("1", "2", "3")),), "CsrfConfig must be a sequence of tuples"), |
74 | | - ((("methods", {"1", "2", "3"}),), "CsrfConfig must be a sequence of tuples"), |
75 | | - ((("methods", {"key": "value"}),), "CsrfConfig must be a sequence of tuples"), |
76 | | - ((("secret_key", 2),), "CsrfConfig must be a sequence of tuples"), |
77 | | - ((("secret_key", 1.0),), "CsrfConfig must be a sequence of tuples"), |
78 | | - ((("secret_key", True),), "CsrfConfig must be a sequence of tuples"), |
79 | | - ((("secret_key", b"secret"),), "CsrfConfig must be a sequence of tuples"), |
80 | | - ((("secret_key", []),), "CsrfConfig must be a sequence of tuples"), |
81 | | - ((("secret_key", {}),), "CsrfConfig must be a sequence of tuples"), |
82 | | - ((("token_location", "body"),), "CsrfConfig must be a sequence of tuples"), |
| 25 | + ((("cookie_samesite", None),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 26 | + ((("cookie_samesite", "none"),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 27 | + ((("cookie_samesite", b"lax"),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 28 | + ( |
| 29 | + (("cookie_samesite", b"none"),), |
| 30 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 31 | + ), |
| 32 | + ( |
| 33 | + (("cookie_samesite", b"strict"),), |
| 34 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 35 | + ), |
| 36 | + ((("cookie_samesite", "null"),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 37 | + ( |
| 38 | + (("cookie_samesite", b"null"),), |
| 39 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 40 | + ), |
| 41 | + ((("cookie_samesite", 0),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 42 | + ((("cookie_samesite", 1),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 43 | + ((("cookie_samesite", True),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 44 | + ((("cookie_samesite", False),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 45 | + ((("cookie_samesite", 2.0),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 46 | + ( |
| 47 | + (("cookie_samesite", {1, 2, 3}),), |
| 48 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 49 | + ), |
| 50 | + ( |
| 51 | + (("cookie_samesite", {1.0, 2.0, 3.0}),), |
| 52 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 53 | + ), |
| 54 | + ( |
| 55 | + (("cookie_samesite", {"1", "2", "3"}),), |
| 56 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 57 | + ), |
| 58 | + ( |
| 59 | + (("cookie_samesite", [1, 2, 3]),), |
| 60 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 61 | + ), |
| 62 | + ( |
| 63 | + (("cookie_samesite", [1.0, 2.0, 3.0]),), |
| 64 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 65 | + ), |
| 66 | + ( |
| 67 | + (("cookie_samesite", ["1", "2", "3"]),), |
| 68 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 69 | + ), |
| 70 | + ( |
| 71 | + (("cookie_samesite", {"key": "value"}),), |
| 72 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 73 | + ), |
| 74 | + ((("cookie_secure", "false"),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 75 | + ((("cookie_secure", b"true"),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 76 | + ((("header_name", 2),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 77 | + ((("header_name", 1.0),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 78 | + ((("header_name", True),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 79 | + ( |
| 80 | + (("header_name", b"header_name"),), |
| 81 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 82 | + ), |
| 83 | + ((("header_name", []),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 84 | + ((("header_name", {}),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 85 | + ((("header_type", 2),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 86 | + ((("header_type", 1.0),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 87 | + ((("header_type", True),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 88 | + ( |
| 89 | + (("header_type", b"header_type"),), |
| 90 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 91 | + ), |
| 92 | + ((("header_type", []),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 93 | + ((("header_type", {}),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 94 | + ((("httponly", "false"),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 95 | + ((("httponly", b"true"),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 96 | + ((("methods", 2),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 97 | + ((("methods", 1.0),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 98 | + ((("methods", True),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 99 | + ((("methods", b"GET, POST"),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 100 | + ((("methods", "GET, POST"),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 101 | + ((("methods", {}),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 102 | + ((("methods", []),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 103 | + ((("methods", [1, 2, 3]),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 104 | + ( |
| 105 | + (("methods", ["GET", "POST", "DELETE"]),), |
| 106 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 107 | + ), |
| 108 | + ((("methods", (1, 2, 3)),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 109 | + ( |
| 110 | + (("methods", ("GET", "POST", "DELETE")),), |
| 111 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 112 | + ), |
| 113 | + ((("methods", {1, 2, 3}),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 114 | + ( |
| 115 | + (("methods", ["1", "2", "3"]),), |
| 116 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 117 | + ), |
| 118 | + ( |
| 119 | + (("methods", ("1", "2", "3")),), |
| 120 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 121 | + ), |
| 122 | + ( |
| 123 | + (("methods", {"1", "2", "3"}),), |
| 124 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 125 | + ), |
| 126 | + ( |
| 127 | + (("methods", {"key": "value"}),), |
| 128 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 129 | + ), |
| 130 | + ((("secret_key", 2),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 131 | + ((("secret_key", 1.0),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 132 | + ((("secret_key", True),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 133 | + ((("secret_key", b"secret"),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 134 | + ((("secret_key", []),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 135 | + ((("secret_key", {}),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
| 136 | + ((("token_location", "body"),), 'CsrfConfig must be pydantic "BaseSettings" or list of tuple'), |
83 | 137 | ( |
84 | 138 | (("token_location", b"body"), ("token_key", "csrf-token")), |
85 | | - "CsrfConfig must be a sequence of tuples", |
| 139 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
| 140 | + ), |
| 141 | + ( |
| 142 | + (("token_location", b"header"),), |
| 143 | + 'CsrfConfig must be pydantic "BaseSettings" or list of tuple', |
86 | 144 | ), |
87 | | - ((("token_location", b"header"),), "CsrfConfig must be a sequence of tuples"), |
88 | 145 | ), |
89 | 146 | ids=[ |
90 | 147 | "cookie-samesite-None", |
|
0 commit comments