[Django] #36169: Allow callable PASSWORD in settings_dict for postgresql backend

18 views
Skip to first unread message

Django

unread,
Feb 4, 2025, 8:47:02 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: franktore | Type: New
| feature
Status: new | Component: Database
| layer (models, ORM)
Version: 5.1 | Severity: Normal
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Connecting to cloud-services via bearer token is currently not feasible
for continuous services as the token is never refreshed and will
ultimately expire.
By setting the password as a callable function a new bearer-token is
created on demand when new connection is established.
--
Ticket URL: <https://code.djangoproject.com/ticket/36169>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 4, 2025, 8:48:02 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: franktore | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by franktore):

* Attachment "base.py" added.

Django

unread,
Feb 4, 2025, 8:48:11 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: franktore | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by franktore):

* Attachment "base.py" removed.

Django

unread,
Feb 4, 2025, 8:48:41 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: franktore | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by franktore):

* Attachment "base.py.diff" added.

Django

unread,
Feb 4, 2025, 8:50:37 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: franktore | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by franktore):

* Attachment "base.py.2.diff" added.

modify
django.db.backends.postgresql.base.DatabaseWrapper.get_connection_params
to accept a callable object as password

Django

unread,
Feb 4, 2025, 8:50:49 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: franktore | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by franktore):

* Attachment "base.py.2.diff" removed.

Django

unread,
Feb 4, 2025, 8:50:55 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: franktore | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by franktore):

* Attachment "base.py.diff" removed.

Django

unread,
Feb 4, 2025, 8:51:00 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: Frank Tore Sæther | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Frank Tore Sæther):

* Attachment "base.py.diff" added.

modify
django.db.backends.postgresql.base.DatabaseWrapper.get_connection_params
to accept a callable object as password

Django

unread,
Feb 4, 2025, 9:32:05 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: Frank Tore Sæther | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Frank Tore Sæther):

* Attachment "base.py.2.diff" added.

Django

unread,
Feb 4, 2025, 9:32:10 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: Frank Tore Sæther | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Frank Tore Sæther):

* Attachment "base.py.diff" removed.

modify
django.db.backends.postgresql.base.DatabaseWrapper.get_connection_params
to accept a callable object as password

Django

unread,
Feb 4, 2025, 9:32:16 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: Frank Tore Sæther | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Frank Tore Sæther):

* Attachment "base.py.2.diff" removed.

Django

unread,
Feb 4, 2025, 9:32:34 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: Frank Tore Sæther | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Frank Tore Sæther):

* Attachment "base.py.diff" added.

git diff for modified file

Django

unread,
Feb 4, 2025, 9:44:12 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: Frank Tore Sæther | Owner: Tanish
| Yelgoe
Type: New feature | Status: assigned
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tanish Yelgoe):

* owner: (none) => Tanish Yelgoe
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/36169#comment:1>

Django

unread,
Feb 4, 2025, 11:00:09 AMFeb 4
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: Frank Tore Sæther | Owner: Tanish
| Yelgoe
Type: New feature | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* resolution: => wontfix
* status: assigned => closed

Comment:

Hi Frank, could you please check this ticket #30178 as I believe this
might document how to achieve this with the current setup

If this doesn't work for you (or it works but you would still like this
feature to be added to Django), you should discuss the idea with the
community on the [https://forum.djangoproject.com/c/internals/5 Django
Forum], where you'll reach a broader audience and receive additional
feedback.

I'll close the ticket for now, but if the community agrees with the
proposal, please return to this ticket and reference the forum discussion
so we can re-open it.
For more information, please refer to
[https://docs.djangoproject.com/en/stable/internals/contributing/bugs-and-
features/#requesting-features the documented guidelines for requesting
features].
--
Ticket URL: <https://code.djangoproject.com/ticket/36169#comment:2>

Django

unread,
Feb 5, 2025, 2:49:25 AMFeb 5
to django-...@googlegroups.com
#36169: Allow callable PASSWORD in settings_dict for postgresql backend
-------------------------------------+-------------------------------------
Reporter: Frank Tore Sæther | Owner: Tanish
| Yelgoe
Type: New feature | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: bearer-token, | Triage Stage:
authentication, cloud | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Frank Tore Sæther):

Your proposed solution works fine for us. I like it even better than the
one I suggested. Thanks.

Replying to [comment:2 Sarah Boyce]:
> Hi Frank, could you please check this ticket #30178 as I believe this
might document how to achieve this with the current setup
>
> If this doesn't work for you (or it works but you would still like this
feature to be added to Django), you should discuss the idea with the
community on the [https://forum.djangoproject.com/c/internals/5 Django
Forum], where you'll reach a broader audience and receive additional
feedback.
>
> I'll close the ticket for now, but if the community agrees with the
proposal, please return to this ticket and reference the forum discussion
so we can re-open it.
> For more information, please refer to
[https://docs.djangoproject.com/en/stable/internals/contributing/bugs-and-
features/#requesting-features the documented guidelines for requesting
features].
--
Ticket URL: <https://code.djangoproject.com/ticket/36169#comment:3>
Reply all
Reply to author
Forward
0 new messages