Skip to content

Conversation

DAlperin
Copy link
Member

When I originally wrote auth I used a postgres inspired string format to
store the hashes, but didn't index on making it 1:1 compatible since we
had originally decided not to surface the hash to the user... That
didn't last.

Notion (and perhaps others) want to be able to use pgbouncer. It would
be easy enough to give instructions/a script to make the existing hash
format into the one pgbouncer wants in its config file but... we could
just not do that.

(This PR also adds platform-checks for passwords to ensure functionality
across versions)

Motivation

Tips for reviewer

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@DAlperin DAlperin requested review from a team as code owners September 25, 2025 14:35
@DAlperin DAlperin requested a review from ggevay September 25, 2025 14:35
Copy link
Contributor

@def- def- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding tests!
Nightly triggered: https://buildkite.com/materialize/nightly/builds/13582

@DAlperin DAlperin force-pushed the dov/migrate-auth-string-compatability branch from 6c8ceef to 3baac42 Compare September 25, 2025 14:59
@DAlperin
Copy link
Member Author

@DAlperin DAlperin force-pushed the dov/migrate-auth-string-compatability branch 5 times, most recently from e82e4e9 to 6286755 Compare September 29, 2025 15:34
This adds auth testdrive tests (and the ability for testdrive to test
auth).
@DAlperin DAlperin force-pushed the dov/migrate-auth-string-compatability branch 3 times, most recently from f1f3b1c to e25a29c Compare September 29, 2025 17:29
@DAlperin DAlperin requested a review from SangJunBak September 29, 2025 17:34
@DAlperin DAlperin force-pushed the dov/migrate-auth-string-compatability branch from e25a29c to 643670c Compare September 29, 2025 18:42
When I originally wrote auth I used a postgres inspired string format to
store the hashes, but didn't index on making it 1:1 compatible since we
had originally decided not to surface the hash to the user... That
didn't last.

Notion (and perhaps others) want to be able to use pgbouncer. It would
be easy enough to give instructions/a script to make the existing hash
format into the one pgbouncer wants in its config file but... we could
just not do that.
@DAlperin DAlperin force-pushed the dov/migrate-auth-string-compatability branch from 643670c to a119277 Compare September 29, 2025 19:33
@DAlperin
Copy link
Member Author

DAlperin commented Oct 6, 2025

@def- I've had to do some unfortunate hacks to get around the lack of auth in older versions. Can you take a look when you get a chance and see if there is a better way to do what I've done?

Copy link
Contributor

@def- def- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that bad, but having 2 extra ports exposed in all tests isn't great.

auth_user3
auth_user_nopass
# Test connection with user2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should test with all users during the validate phase.

Comment on lines +73 to +79
listeners_config_path = (
f"{MZ_ROOT}/src/materialized/ci/listener_configs/no_auth.json"
)
if (self.tag and self.tag >= MzVersion.parse("v0.159.0-dev")) or not self.tag:
listeners_config_path = (
f"{MZ_ROOT}/src/materialized/ci/listener_configs/mixed_auth.json"
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might conflict with some changes @SangJunBak is working on, but I guess we can merge it.

config: ServiceConfig = {
"mzbuild": name,
"ports": [6875, 6876, 6877, 6878, 26257],
"ports": [6875, 6876, 6877, 6878, 6885, 6895, 26257],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment would be nice about what these ports do. Do they always exist? If not, have a ports parameter and pass it in for platform-checks and other tests that require these extra ports.

.Raw != "postgresql://materialize:[email protected]:5432" and
.Raw != "d3aa325086974cdfb3912f28e5a8c168" and
.Raw != "jdbc:postgresql://postgres:5432/postgres" and
(.Raw | test("^postgres://auth_user[0-9]:password[0-9]@[^:]+:68$") | not) and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ending on 68 is weird, but I guess trufflehog was complaining like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants