-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement clientauth feature #227
Merged
Merged
Changes from 34 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
d221c01
Initial implementation of clientauth
adamguo0 5adff7f
Process queue entries one at a time
adamguo0 d4c75d6
Add GUC to skip databases
adamguo0 ffca9b1
Call previous client auth hook before ours
adamguo0 18ac02d
Fix compiler warnings
adamguo0 eb96dfa
Add pgtle.enable_clientauth = require test
adamguo0 5b17684
Fix tests for PG13 and 14
adamguo0 16a2a01
Add some comments
adamguo0 2924d17
Add clientauth to pgtle.pg_tle_features enum
adamguo0 3e591ed
Add pg_tle--1.1.1.sql to Makefile
adamguo0 bdda8fb
Improve signalling stability
adamguo0 ba11052
Fix the race condition that left an entry unprocessed
adamguo0 6bd7ba2
Mark helper functions as static
adamguo0 5321724
Assign each worker a partition of the queue
adamguo0 4c2d378
Apply pg_indent
adamguo0 dbe01f0
Add pg_tle--$(EXTVERSION).sql back to EXTRA_CLEAN
adamguo0 9d088d9
pg_indent and small changes
adamguo0 804ddb9
Add an index offset to worker loop when checking for pending entries
adamguo0 b4458cc
Refactor clientauth users_to_skip and databases_to_skip checks
adamguo0 92b90bf
Refactor worker query logic
adamguo0 8875a03
Move SPI calls to clientauth_launcher_run_user_functions
adamguo0 f5f2d5f
Set enable_clientauth to POSTMASTER and other fixes
adamguo0 f56f12e
Fix stale entry bug
adamguo0 38d4637
Signal BGW before doing any work in client
adamguo0 944f423
Handle pg_upgrade
adamguo0 95245f3
Change LW_EXCLUSIVE to LW_SHARED when reading only
adamguo0 acee3f3
Check IsBinaryUpgrade before registering hooks
adamguo0 fa05713
Set version to 1.2.0
adamguo0 5689169
Replace SELECT func with SELECT * FROM func
adamguo0 511c727
Remove elog
adamguo0 ac30344
Rename WAIT_EVENT_MQ_* to WAIT_EVENT_MESSAGE_QUEUE_*
adamguo0 2c03e67
Set pgtle.enable_clientauth context back to SIGHUP
adamguo0 5e9c01b
Fix test numbering
adamguo0 57c400f
Update deadlock comment
adamguo0 6e13965
ereport if SPI_execute fails
adamguo0 bd76413
Report SPI error if < 0 instead of != SPI_OK_SELECT
adamguo0 42fadf0
Revert "Report SPI error if < 0 instead of != SPI_OK_SELECT"
adamguo0 29dfe78
Remove extra compatibility defines
adamguo0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* clientauth.h | ||
* | ||
* contains the changes needed by uni_api to load the functionality for | ||
* clientauth. | ||
*/ | ||
void clientauth_init(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Updates since v1.1.1 | ||
* 1. Introduced clientauth feature | ||
*/ | ||
|
||
-- complain if script is sourced in psql, rather than via CREATE EXTENSION | ||
\echo Use "CREATE EXTENSION pg_tle" to load this file. \quit | ||
|
||
ALTER TYPE pgtle.pg_tle_features ADD VALUE 'clientauth'; | ||
|
||
CREATE TYPE pgtle.clientauth_port_subset AS ( | ||
noblock boolean, | ||
|
||
remote_host text, | ||
remote_hostname text, | ||
remote_hostname_resolv integer, | ||
remote_hostname_errcode integer, | ||
|
||
database_name text, | ||
user_name text | ||
); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one's duplicated, and we're only using one right might not need to declare all