- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitb3f0be7
Add support for OAUTHBEARER SASL mechanism
This commit implements OAUTHBEARER, RFC 7628, and OAuth 2.0 DeviceAuthorization Grants, RFC 8628. In order to use this there is anew pg_hba auth method called oauth. When speaking to a OAuth-enabled server, it looks a bit like this: $ psql 'host=example.org oauth_issuer=... oauth_client_id=...' Visithttps://oauth.example.org/login and enter the code: FPQ2-M4BGDevice authorization is currently the only supported flow so theOAuth issuer must support that in order for users to authenticate.Third-party clients may however extend this and provide their ownflows. The built-in device authorization flow is currently notsupported on Windows.In order for validation to happen server side a new framework forplugging in OAuth validation modules is added. As validation isimplementation specific, with no default specified in the standard,PostgreSQL does not ship with one built-in. Each pg_hba entry canspecify a specific validator or be left blank for the validatorinstalled as default.This adds a requirement on libcurl for the client side support,which is optional to build, but the server side has no additionalbuild requirements. In order to run the tests, Python is requiredas this adds a https server written in Python. Tests are gatedbehind PG_TEST_EXTRA as they open ports.This patch has been a multi-year project with many contributorsinvolved with reviews and in-depth discussions: Michael Paquier,Heikki Linnakangas, Zhihong Yu, Mahendrakar Srinivasarao, AndreyChudnovsky and Stephen Frost to name a few. While Jacob Championis the main author there have been some levels of hacking by others.Daniel Gustafsson contributed the validation module and various bitsand pieces; Thomas Munro wrote the client side support for kqueue.Author: Jacob Champion <jacob.champion@enterprisedb.com>Co-authored-by: Daniel Gustafsson <daniel@yesql.se>Co-authored-by: Thomas Munro <thomas.munro@gmail.com>Reviewed-by: Daniel Gustafsson <daniel@yesql.se>Reviewed-by: Peter Eisentraut <peter@eisentraut.org>Reviewed-by: Antonin Houska <ah@cybertec.at>Reviewed-by: Kashif Zeeshan <kashi.zeeshan@gmail.com>Discussion:https://postgr.es/m/d1b467a78e0e36ed85a09adf979d04cf124a9d4b.camel@vmware.com1 parent1fd1bd8 commitb3f0be7
File tree
60 files changed
+9278
-39
lines changed- config
- doc/src/sgml
- src
- backend
- libpq
- utils
- adt
- misc
- include
- common
- libpq
- interfaces/libpq
- makefiles
- test
- authentication/t
- modules
- oauth_validator
- t
- OAuth
- perl/PostgreSQL/Test
- tools/pgindent
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
60 files changed
+9278
-39
lines changedLines changed: 9 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| |||
167 | 167 |
| |
168 | 168 |
| |
169 | 169 |
| |
170 |
| - | |
| 170 | + | |
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
| |||
329 | 329 |
| |
330 | 330 |
| |
331 | 331 |
| |
| 332 | + | |
332 | 333 |
| |
333 | 334 |
| |
334 | 335 |
| |
| |||
422 | 423 |
| |
423 | 424 |
| |
424 | 425 |
| |
425 |
| - | |
426 |
| - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
427 | 430 |
| |
428 | 431 |
| |
429 | 432 |
| |
| |||
799 | 802 |
| |
800 | 803 |
| |
801 | 804 |
| |
802 |
| - | |
803 |
| - | |
| 805 | + | |
| 806 | + | |
804 | 807 |
| |
805 | 808 |
| |
806 | 809 |
| |
|
Lines changed: 65 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
274 | 274 |
| |
275 | 275 |
| |
276 | 276 |
| |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + |
0 commit comments
Comments
(0)