Skip to content
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

Enable setting a user when connecting to PGlite #147

Merged
merged 16 commits into from
Aug 6, 2024

Conversation

pmp-p
Copy link
Collaborator

@pmp-p pmp-p commented Aug 5, 2024

No description provided.

Copy link
Contributor

github-actions bot commented Aug 5, 2024

@github-actions github-actions bot temporarily deployed to pull request August 5, 2024 12:59 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 5, 2024 13:27 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 5, 2024 14:16 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 5, 2024 19:40 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 5, 2024 20:02 Inactive
@pmp-p pmp-p changed the title always take username from ENV switch ROLE from ENV username Aug 5, 2024
@pmp-p pmp-p changed the title switch ROLE from ENV username WIP: switch ROLE from ENV username Aug 5, 2024
@github-actions github-actions bot temporarily deployed to pull request August 5, 2024 20:46 Inactive
@github-actions github-actions bot temporarily deployed to commit August 6, 2024 05:05 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 6, 2024 09:05 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 6, 2024 09:23 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 6, 2024 11:07 Inactive
@pmp-p
Copy link
Collaborator Author

pmp-p commented Aug 6, 2024

now after initdb has run ( as WASM_USERNAME default "postgres" ) once it is now possible to drop connexion real user id ( session_user ) and match the privileges to a value set via options.username ( PGUSER ). user has to be created from initial run
eg
CREATE USER test_user WITH PASSWORD 'md5abdbecd56d5fbd2cdaee3d0fa9e4f434';

At the same time is possible to connect to a different options.dbname (PGDATABASE) but only if it has been created before (initial run) and proper rights set.
eg:
CREATE DATABASE test_user WITH OWNER = test_user;
CREATE SCHEMA test_user;

@pmp-p pmp-p marked this pull request as ready for review August 6, 2024 11:19
@pmp-p pmp-p requested a review from samwillis August 6, 2024 11:20
@samwillis samwillis changed the title WIP: switch ROLE from ENV username Enable setting a user when connecting to PGlite Aug 6, 2024
@github-actions github-actions bot temporarily deployed to pull request August 6, 2024 12:47 Inactive
@samwillis samwillis merged commit fbb4c57 into main Aug 6, 2024
1 check passed
@github-actions github-actions bot temporarily deployed to pull request August 6, 2024 13:01 Inactive
@samwillis samwillis deleted the pmp-p/username-from-env branch October 11, 2024 14:18
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