forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf8d8581
committed
require_auth: prepare for multiple SASL mechanisms
Prior to this patch, the require_auth implementation assumed thatthe AuthenticationSASL protocol message was using SCRAM-SHA-256.In preparation for future SASL mechanisms, like OAUTHBEARER, splitthe implementation into two tiers: the first checks the acceptableAUTH_REQ_* codes, and the second checks acceptable mechanisms ifAUTH_REQ_SASL et.al are permitted.conn->allowed_sasl_mechs contains a list of pointers to acceptablemechanisms, and pg_SASL_init() will bail if the selected mechanismisn't contained in this array.Since there's only one mechansism supported right now, one branchof the second tier cannot be exercised yet and is protected by anAssert(false) call. This assertion will need to be removed whenthe next mechanism is added.This patch is extracted from a larger body of work aimed at addingsupport for OAUTHBEARER in libpq.Author: Jacob Champion <jacob.champion@enterprisedb.com>Reviewed-by: Daniel Gustafsson <daniel@yesql.se>Reviewed-by: Peter Eisentraut <peter@eisentraut.org>Discussion:https://postgr.es/m/CAOYmi+kJqzo6XsR9TEhvVfeVNQ-TyFM5LATypm9yoQVYk=4Wrw@mail.gmail.com1 parente21d6f2 commitf8d8581
File tree
4 files changed
+208
-17
lines changed- src
- interfaces/libpq
- test/authentication/t
4 files changed
+208
-17
lines changedLines changed: 29 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
543 | 543 |
| |
544 | 544 |
| |
545 | 545 |
| |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
546 | 575 |
| |
547 | 576 |
| |
548 | 577 |
| |
|
Lines changed: 167 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
396 | 396 |
| |
397 | 397 |
| |
398 | 398 |
| |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
399 | 405 |
| |
400 | 406 |
| |
401 | 407 |
| |
| |||
1117 | 1123 |
| |
1118 | 1124 |
| |
1119 | 1125 |
| |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1120 | 1177 |
| |
1121 | 1178 |
| |
1122 | 1179 |
| |
| |||
1358 | 1415 |
| |
1359 | 1416 |
| |
1360 | 1417 |
| |
1361 |
| - | |
1362 |
| - | |
| 1418 | + | |
| 1419 | + | |
1363 | 1420 |
| |
1364 | 1421 |
| |
1365 | 1422 |
| |
| 1423 | + | |
1366 | 1424 |
| |
1367 | 1425 |
| |
1368 | 1426 |
| |
1369 | 1427 |
| |
1370 | 1428 |
| |
1371 |
| - | |
| 1429 | + | |
| 1430 | + | |
1372 | 1431 |
| |
1373 | 1432 |
| |
1374 | 1433 |
| |
| |||
1384 | 1443 |
| |
1385 | 1444 |
| |
1386 | 1445 |
| |
1387 |
| - | |
1388 |
| - | |
| 1446 | + | |
| 1447 | + | |
1389 | 1448 |
| |
1390 | 1449 |
| |
1391 | 1450 |
| |
| 1451 | + | |
1392 | 1452 |
| |
1393 | 1453 |
| |
1394 | 1454 |
| |
| |||
1413 | 1473 |
| |
1414 | 1474 |
| |
1415 | 1475 |
| |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
1416 | 1480 |
| |
1417 | 1481 |
| |
1418 | 1482 |
| |
| |||
1431 | 1495 |
| |
1432 | 1496 |
| |
1433 | 1497 |
| |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
1434 | 1505 |
| |
1435 | 1506 |
| |
1436 |
| - | |
1437 |
| - | |
1438 |
| - | |
1439 |
| - | |
| 1507 | + | |
1440 | 1508 |
| |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
1441 | 1513 |
| |
1442 | 1514 |
| |
1443 | 1515 |
| |
| |||
1473 | 1545 |
| |
1474 | 1546 |
| |
1475 | 1547 |
| |
1476 |
| - | |
1477 |
| - | |
| 1548 | + | |
1478 | 1549 |
| |
1479 |
| - | |
1480 |
| - | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
1481 | 1574 |
| |
1482 |
| - | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
1483 | 1590 |
| |
1484 | 1591 |
| |
1485 | 1592 |
| |
1486 |
| - | |
1487 |
| - | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
1488 | 1607 |
| |
1489 |
| - | |
| 1608 | + | |
| 1609 | + | |
1490 | 1610 |
| |
1491 | 1611 |
| |
1492 | 1612 |
| |
| |||
1505 | 1625 |
| |
1506 | 1626 |
| |
1507 | 1627 |
| |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
1508 | 1658 |
| |
1509 | 1659 |
| |
1510 | 1660 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
505 | 505 |
| |
506 | 506 |
| |
507 | 507 |
| |
| 508 | + | |
| 509 | + | |
508 | 510 |
| |
509 | 511 |
| |
510 | 512 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
277 | 277 |
| |
278 | 278 |
| |
279 | 279 |
| |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
280 | 290 |
| |
281 | 291 |
| |
282 | 292 |
| |
|
0 commit comments
Comments
(0)