Commit c76bc91
committed
fix: check cache for secret
Only using data.auth.password would reuse the password for the
is_manager user when trying to authenticate against the upstream.
The first request, from the is_manager to the upstream should use the
password, while the subsequent connection with the authenticating user
should use secret.
feat: support e2e password flow
chore: check password against auth_query
chore: set client_key
Sets the client_key when using password auth (jit) and the incomming
password is a valid password that matches the scram-sha-256. This allows
supporting the case where the tenant has switched back to scram-sha-256
but pooler is still checking for cleartext password.
chore: todo - api implementation
feat: support api lookup
chore: ensure user secret caching works with jit
chore: add jit expire checks
chore: cleanup credo warnings
chore: store client_key for cleartext auth exchange
If the cleartext auth exchange was for a normal password (not PAT/JWT),
we will have a valid client_key that was calculated for the
scram-sha-256. Ensure this is always present in secrets, along with the
clear password if we have it. This allows for the case where the
upstream server either stops using JIT and reverts to scram-sha-256. Or
has a pg_hba entry for the specific user to use scram-sha-256 rather
than pam. This allows both JIT users and non-JIT users to exist in the
same tenant.
chore: support md5 on JIT, lazy eval secrets
fix: migration
fix: terminate does not need additional message
Update lib/supavisor/helpers.ex
Co-authored-by: felipe stival <14948182+v0idpwn@users.noreply.github.com>
chore: start adding more tests
test: add jit api tester
chore: use simplified API with role, rhost1 parent a44394d commit c76bc91
File tree
9 files changed
+344
-20
lines changed- lib/supavisor
- protocol
- tenants
- priv/repo/migrations
- test/supavisor
9 files changed
+344
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | | - | |
| 360 | + | |
| 361 | + | |
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| |||
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| 667 | + | |
667 | 668 | | |
668 | 669 | | |
669 | 670 | | |
| |||
681 | 682 | | |
682 | 683 | | |
683 | 684 | | |
684 | | - | |
| 685 | + | |
685 | 686 | | |
686 | 687 | | |
687 | 688 | | |
| |||
747 | 748 | | |
748 | 749 | | |
749 | 750 | | |
750 | | - | |
| 751 | + | |
751 | 752 | | |
752 | | - | |
753 | | - | |
754 | | - | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
755 | 762 | | |
756 | 763 | | |
757 | 764 | | |
| |||
793 | 800 | | |
794 | 801 | | |
795 | 802 | | |
796 | | - | |
| 803 | + | |
797 | 804 | | |
798 | 805 | | |
799 | 806 | | |
| |||
805 | 812 | | |
806 | 813 | | |
807 | 814 | | |
808 | | - | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
809 | 833 | | |
810 | 834 | | |
811 | 835 | | |
| |||
839 | 863 | | |
840 | 864 | | |
841 | 865 | | |
842 | | - | |
| 866 | + | |
843 | 867 | | |
844 | 868 | | |
845 | 869 | | |
| |||
886 | 910 | | |
887 | 911 | | |
888 | 912 | | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
889 | 964 | | |
890 | 965 | | |
891 | 966 | | |
| |||
949 | 1024 | | |
950 | 1025 | | |
951 | 1026 | | |
952 | | - | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
953 | 1030 | | |
954 | 1031 | | |
955 | 1032 | | |
| |||
1041 | 1118 | | |
1042 | 1119 | | |
1043 | 1120 | | |
1044 | | - | |
1045 | | - | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1046 | 1133 | | |
1047 | 1134 | | |
1048 | 1135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
186 | 191 | | |
187 | 192 | | |
188 | 193 | | |
| |||
663 | 668 | | |
664 | 669 | | |
665 | 670 | | |
666 | | - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
667 | 679 | | |
668 | 680 | | |
669 | 681 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
402 | 472 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| |||
329 | 332 | | |
330 | 333 | | |
331 | 334 | | |
332 | | - | |
| 335 | + | |
333 | 336 | | |
334 | 337 | | |
335 | | - | |
336 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
337 | 346 | | |
338 | 347 | | |
339 | 348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
104 | 108 | | |
105 | 109 | | |
106 | | - | |
107 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
108 | 129 | | |
109 | 130 | | |
110 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments