-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support :connect_opts_proc Database option for late binding options
Some modern authentication schemes automatically rotate usernames and/or passwords on a regular basis without user involvement or control. Attempt to support this type of authentication case with this option, so you can do something like: Sequel.connect('postgres://user@host/database', connect_opts_proc: lambda do |h| h[:password] = SomeAuthLibrary.get_current_password(h[:user]) end) The way this is implemented, the :connect_opts_proc is always called before a new connection is made, so directly before the connection is made, it will get the current password for the account. Note that for the jdbc adapter, because it generally works directly on JDBC URIs, the :connect_opts_proc should probably set the :uri key in the hash appropriately.
- Loading branch information
1 parent
52ccf07
commit 8a18971
Showing
5 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters