- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitefb6f4a
committed
Support the same patterns for pg-user in pg_ident.conf as in pg_hba.conf
While pg_hba.conf has support for non-literal username matches, andthis commit extends the capabilities that are supported for thePostgreSQL user listed in an ident entry part of pg_ident.conf, withsupport for:1. The "all" keyword, where all the requested users are allowed.2. Membership checks using the + prefix.3. Using a regex to match against multiple roles.1. is a feature that has been requested by Jelte Fennema, 2. somethingthat has been mentioned independently by Andrew Dunstan, and 3. issomething I came up with while discussing how to extend the first one,whose implementation is facilitated by8fea868.This allows matching certain system users against many differentpostgres users with a single line in pg_ident.conf. Without this, onewould need one line for each of the postgres users that a system usercan log in as, which can be cumbersome to maintain.Tests are added to the TAP test of peer authentication to providecoverage for all that.Note that this introduces a set of backward-incompatible changes to beable to detect the new patterns, for the following cases:- A role named "all".- A role prefixed with '+' characters, which is something that would nothave worked in HBA entries anyway.- A role prefixed by a slash character, similarly to8fea868.Any of these can be still be handled by using quotes in the Postgresrole defined in an ident entry.A huge advantage of this change is that the code applies the same checksfor the Postgres roles in HBA and ident entries, via the common routinecheck_role().**This compatibility change should be mentioned in the release notes.**Author: Jelte FennemaDiscussion:https://postgr.es/m/DBBPR83MB0507FEC2E8965012990A80D0F7FC9@DBBPR83MB0507.EURPRD83.prod.outlook.com1 parent74739d1 commitefb6f4a
File tree
3 files changed
+246
-39
lines changed- doc/src/sgml
- src
- backend/libpq
- test/authentication/t
3 files changed
+246
-39
lines changedLines changed: 26 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
941 | 941 |
| |
942 | 942 |
| |
943 | 943 |
| |
944 |
| - | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
945 | 960 |
| |
946 | 961 |
| |
947 | 962 |
| |
| |||
964 | 979 |
| |
965 | 980 |
| |
966 | 981 |
| |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
967 | 992 |
| |
968 | 993 |
| |
969 | 994 |
| |
|
Lines changed: 67 additions & 31 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
| 76 | + | |
76 | 77 |
| |
77 | 78 |
| |
| 79 | + | |
78 | 80 |
| |
79 | 81 |
| |
80 | 82 |
| |
| |||
995 | 997 |
| |
996 | 998 |
| |
997 | 999 |
| |
998 |
| - | |
| 1000 | + | |
| 1001 | + | |
999 | 1002 |
| |
1000 | 1003 |
| |
1001 |
| - | |
| 1004 | + | |
1002 | 1005 |
| |
1003 | 1006 |
| |
1004 | 1007 |
| |
1005 | 1008 |
| |
1006 | 1009 |
| |
1007 | 1010 |
| |
1008 | 1011 |
| |
1009 |
| - | |
| 1012 | + | |
1010 | 1013 |
| |
1011 | 1014 |
| |
1012 | 1015 |
| |
| |||
1018 | 1021 |
| |
1019 | 1022 |
| |
1020 | 1023 |
| |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
1021 | 1029 |
| |
1022 | 1030 |
| |
1023 | 1031 |
| |
| |||
2614 | 2622 |
| |
2615 | 2623 |
| |
2616 | 2624 |
| |
2617 |
| - | |
| 2625 | + | |
2618 | 2626 |
| |
2619 | 2627 |
| |
2620 | 2628 |
| |
| |||
2804 | 2812 |
| |
2805 | 2813 |
| |
2806 | 2814 |
| |
2807 |
| - | |
| 2815 | + | |
2808 | 2816 |
| |
2809 | 2817 |
| |
2810 | 2818 |
| |
| |||
2813 | 2821 |
| |
2814 | 2822 |
| |
2815 | 2823 |
| |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
2816 | 2831 |
| |
2817 | 2832 |
| |
2818 | 2833 |
| |
| |||
2827 | 2842 |
| |
2828 | 2843 |
| |
2829 | 2844 |
| |
| 2845 | + | |
| 2846 | + | |
2830 | 2847 |
| |
2831 | 2848 |
| |
2832 | 2849 |
| |
2833 | 2850 |
| |
2834 | 2851 |
| |
2835 | 2852 |
| |
2836 | 2853 |
| |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
2837 | 2857 |
| |
2838 | 2858 |
| |
2839 | 2859 |
| |
| |||
2845 | 2865 |
| |
2846 | 2866 |
| |
2847 | 2867 |
| |
2848 |
| - | |
| 2868 | + | |
| 2869 | + | |
2849 | 2870 |
| |
2850 | 2871 |
| |
2851 | 2872 |
| |
| |||
2865 | 2886 |
| |
2866 | 2887 |
| |
2867 | 2888 |
| |
2868 |
| - | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
2869 | 2897 |
| |
| 2898 | + | |
2870 | 2899 |
| |
2871 | 2900 |
| |
2872 | 2901 |
| |
| |||
2891 | 2920 |
| |
2892 | 2921 |
| |
2893 | 2922 |
| |
2894 |
| - | |
2895 |
| - | |
2896 |
| - | |
2897 |
| - | |
2898 |
| - | |
2899 |
| - | |
2900 | 2923 |
| |
2901 |
| - | |
2902 |
| - | |
2903 |
| - | |
2904 |
| - | |
2905 |
| - | |
2906 |
| - | |
2907 |
| - | |
2908 |
| - | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
2909 | 2932 |
| |
2910 | 2933 |
| |
2911 | 2934 |
| |
2912 |
| - | |
2913 |
| - | |
| 2935 | + | |
2914 | 2936 |
| |
2915 |
| - | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
2916 | 2945 |
| |
2917 | 2946 |
| |
2918 | 2947 |
| |
2919 | 2948 |
| |
2920 | 2949 |
| |
2921 |
| - | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
2922 | 2954 |
| |
2923 | 2955 |
| |
2924 |
| - | |
2925 |
| - | |
2926 |
| - | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
2927 | 2959 |
| |
2928 | 2960 |
| |
2929 | 2961 |
| |
2930 |
| - | |
2931 |
| - | |
2932 |
| - | |
| 2962 | + | |
| 2963 | + | |
2933 | 2964 |
| |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
2934 | 2970 |
| |
2935 | 2971 |
| |
2936 | 2972 |
| |
|
0 commit comments
Comments
(0)