Commit 0c4c5da
feat: add TLS/mTLS support for experimental host (#1479)
Previously googleapis/python-spanner#1452
introduced changes to support python spanner client against spanner
experimental host endpoints over insecure communication
This PR extends those changes to support python spanner client
connections to experimental host endpoints over TLS / mTLS connections
as well. It also includes changes to run Integration Tests against
experimental hosts across all 3 modes of network communication
(plain-text, TLS, mTLS)
To run IT tests against experimental host set below variables
```
export SPANNER_EXPERIMENTAL_HOST=localhost:15000
```
For tls/mTLS set below additonal variables:
- (mTLS/TLS)
```
export CA_CERTIFICATE=/tmp/experimental_host/ca-certificates/ca.crt
```
- (mTLS)
```
export CLIENT_CERTIFICATE=/tmp/experimental_host/certs/client.crt
export CLIENT_KEY=/tmp/experimental_host/certs/client.key
```
Then we can run below command to tigger the tests:
```
python -m pytest -v -s --disable-warnings tests/system/
```
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com>1 parent c2bbb22 commit 0c4c5daCopy full SHA for 0c4c5da
13 files changed
+197-28Lines changed: 197 additions & 28 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- packages/google-cloud-spanner
- google/cloud
- spanner_dbapi
- spanner_v1
- testing
- tests
- system
- unit
- spanner_dbapi
Expand file treeCollapse file tree
Open diff view settings
Collapse file
packages/google-cloud-spanner/google/cloud/spanner_dbapi/connection.py
Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/google/cloud/spanner_dbapi/connection.py+30Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
736 | 736 | |
737 | 737 | |
738 | 738 | |
| 739 | + |
| 740 | + |
| 741 | + |
| 742 | + |
739 | 743 | |
740 | 744 | |
741 | 745 | |
| ||
789 | 793 | |
790 | 794 | |
791 | 795 | |
| 796 | + |
| 797 | + |
| 798 | + |
| 799 | + |
| 800 | + |
| 801 | + |
| 802 | + |
| 803 | + |
| 804 | + |
| 805 | + |
| 806 | + |
| 807 | + |
| 808 | + |
| 809 | + |
| 810 | + |
| 811 | + |
| 812 | + |
| 813 | + |
| 814 | + |
| 815 | + |
| 816 | + |
| 817 | + |
792 | 818 | |
793 | 819 | |
794 | 820 | |
| ||
817 | 843 | |
818 | 844 | |
819 | 845 | |
| 846 | + |
| 847 | + |
| 848 | + |
| 849 | + |
820 | 850 | |
821 | 851 | |
822 | 852 | |
|
Collapse file
packages/google-cloud-spanner/google/cloud/spanner_v1/_helpers.py
Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/google/cloud/spanner_v1/_helpers.py+62Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
868 | 868 | |
869 | 869 | |
870 | 870 | |
| 871 | + |
| 872 | + |
| 873 | + |
| 874 | + |
| 875 | + |
| 876 | + |
| 877 | + |
| 878 | + |
| 879 | + |
| 880 | + |
| 881 | + |
| 882 | + |
| 883 | + |
| 884 | + |
| 885 | + |
| 886 | + |
| 887 | + |
| 888 | + |
| 889 | + |
| 890 | + |
| 891 | + |
| 892 | + |
| 893 | + |
| 894 | + |
| 895 | + |
| 896 | + |
| 897 | + |
| 898 | + |
| 899 | + |
| 900 | + |
| 901 | + |
| 902 | + |
| 903 | + |
| 904 | + |
| 905 | + |
| 906 | + |
| 907 | + |
| 908 | + |
| 909 | + |
| 910 | + |
| 911 | + |
| 912 | + |
| 913 | + |
| 914 | + |
| 915 | + |
| 916 | + |
| 917 | + |
| 918 | + |
| 919 | + |
| 920 | + |
| 921 | + |
| 922 | + |
| 923 | + |
| 924 | + |
| 925 | + |
| 926 | + |
| 927 | + |
| 928 | + |
| 929 | + |
| 930 | + |
| 931 | + |
| 932 | + |
Collapse file
packages/google-cloud-spanner/google/cloud/spanner_v1/client.py
Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/google/cloud/spanner_v1/client.py+52-6Lines changed: 52 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
50 | 50 | |
51 | 51 | |
52 | 52 | |
53 | | - |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
54 | 57 | |
55 | 58 | |
56 | 59 | |
| ||
227 | 230 | |
228 | 231 | |
229 | 232 | |
| 233 | + |
| 234 | + |
| 235 | + |
| 236 | + |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
| 251 | + |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | + |
230 | 257 | |
231 | 258 | |
232 | 259 | |
| ||
251 | 278 | |
252 | 279 | |
253 | 280 | |
| 281 | + |
| 282 | + |
| 283 | + |
| 284 | + |
254 | 285 | |
255 | 286 | |
256 | 287 | |
| ||
265 | 296 | |
266 | 297 | |
267 | 298 | |
| 299 | + |
| 300 | + |
| 301 | + |
| 302 | + |
| 303 | + |
| 304 | + |
268 | 305 | |
269 | 306 | |
270 | 307 | |
| ||
361 | 398 | |
362 | 399 | |
363 | 400 | |
364 | | - |
365 | | - |
| 401 | + |
| 402 | + |
| 403 | + |
| 404 | + |
| 405 | + |
| 406 | + |
| 407 | + |
366 | 408 | |
367 | 409 | |
368 | 410 | |
| ||
391 | 433 | |
392 | 434 | |
393 | 435 | |
394 | | - |
395 | | - |
| 436 | + |
| 437 | + |
| 438 | + |
| 439 | + |
| 440 | + |
| 441 | + |
| 442 | + |
396 | 443 | |
397 | 444 | |
398 | 445 | |
| ||
539 | 586 | |
540 | 587 | |
541 | 588 | |
542 | | - |
543 | 589 | |
544 | 590 | |
545 | 591 | |
|
Collapse file
packages/google-cloud-spanner/google/cloud/spanner_v1/database.py
Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/google/cloud/spanner_v1/database.py+11-7Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
56 | 56 | |
57 | 57 | |
58 | 58 | |
| 59 | + |
59 | 60 | |
60 | 61 | |
61 | 62 | |
| ||
198 | 199 | |
199 | 200 | |
200 | 201 | |
| 202 | + |
201 | 203 | |
202 | 204 | |
203 | 205 | |
204 | 206 | |
205 | 207 | |
206 | 208 | |
207 | | - |
208 | 209 | |
209 | | - |
210 | | - |
211 | | - |
| 210 | + |
212 | 211 | |
213 | 212 | |
214 | 213 | |
| ||
453 | 452 | |
454 | 453 | |
455 | 454 | |
456 | | - |
457 | | - |
458 | | - |
| 455 | + |
| 456 | + |
| 457 | + |
| 458 | + |
| 459 | + |
| 460 | + |
| 461 | + |
| 462 | + |
459 | 463 | |
460 | 464 | |
461 | 465 | |
|
Collapse file
packages/google-cloud-spanner/google/cloud/spanner_v1/database_sessions_manager.py
Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/google/cloud/spanner_v1/database_sessions_manager.py+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
62 | 62 | |
63 | 63 | |
64 | 64 | |
65 | | - |
| 65 | + |
66 | 66 | |
67 | 67 | |
68 | | - |
69 | 68 | |
70 | 69 | |
71 | 70 | |
| ||
89 | 88 | |
90 | 89 | |
91 | 90 | |
92 | | - |
| 91 | + |
| 92 | + |
93 | 93 | |
94 | 94 | |
95 | 95 | |
|
Collapse file
packages/google-cloud-spanner/google/cloud/spanner_v1/instance.py
Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/google/cloud/spanner_v1/instance.py-2Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
122 | 122 | |
123 | 123 | |
124 | 124 | |
125 | | - |
126 | 125 | |
127 | 126 | |
128 | 127 | |
| ||
143 | 142 | |
144 | 143 | |
145 | 144 | |
146 | | - |
147 | 145 | |
148 | 146 | |
149 | 147 | |
|
Collapse file
packages/google-cloud-spanner/google/cloud/spanner_v1/testing/database_test.py
Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/google/cloud/spanner_v1/testing/database_test.py+11-4Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
17 | 17 | |
18 | 18 | |
19 | 19 | |
| 20 | + |
20 | 21 | |
21 | 22 | |
22 | 23 | |
| ||
86 | 87 | |
87 | 88 | |
88 | 89 | |
89 | | - |
90 | | - |
| 90 | + |
91 | 91 | |
92 | 92 | |
93 | | - |
94 | | - |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
95 | 102 | |
96 | 103 | |
97 | 104 | |
|
Collapse file
packages/google-cloud-spanner/tests/system/_helpers.py
Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/tests/system/_helpers.py+8-1Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | | - |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
64 | 71 | |
65 | 72 | |
66 | 73 | |
|
Collapse file
packages/google-cloud-spanner/tests/system/conftest.py
Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/tests/system/conftest.py+4-1Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
115 | 115 | |
116 | 116 | |
117 | 117 | |
118 | | - |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
119 | 122 | |
120 | 123 | |
121 | 124 | |
|
Collapse file
packages/google-cloud-spanner/tests/system/test_dbapi.py
Copy file name to clipboardExpand all lines: packages/google-cloud-spanner/tests/system/test_dbapi.py+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1442 | 1442 | |
1443 | 1443 | |
1444 | 1444 | |
| 1445 | + |
| 1446 | + |
| 1447 | + |
| 1448 | + |
1445 | 1449 | |
1446 | 1450 | |
1447 | 1451 | |
|
0 commit comments