Create ClickHouse customer user provisioning script
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Description
Create create_user.sh — a fully self-contained script that provisions a ClickHouse user for a given customer. Takes customerId and password as arguments.
Script must:
- Create the ClickHouse user
- Create a
customerrole with aROW POLICYscoped toanalytics.*usingcustomer_id = '{customerId}' - Assign the role to the user
- Grant
SELECT ON analytics.* - Grant
INSERT ON analytics.events - Allow connection from any host
Check the existing test-only docker/init/50-users.sql.
Note: The
analytics.*wildcard RLS is safe to use here because the lookup tables have been removed in Phase 2 (#35061, #35062).
Improvement plan: https://docs.google.com/document/d/1hVfIurPqAJJ1PN1EalmvrWXnGNt5sY21MI-409lrXpU/edit?tab=t.klqavlz4cis7#heading=h.8vek9yxw
Parent epic: #35048
Acceptance Criteria
-
create_user.shcreated and takescustomerIdandpasswordas arguments - Script creates the ClickHouse user with the given credentials
- ROW POLICY created scoped to
analytics.*filtering bycustomer_id = '{customerId}' - Role created and assigned to the user
-
SELECT ON analytics.*granted -
INSERT ON analytics.eventsgranted - Connection allowed from any host
- Existing
docker/init/50-users.sqlreplaced by this script - Script is idempotent — safe to re-run without errors
Additional Context
- Source task: Task 13 (User provisioning script) from the improvement plan
- Blocked by: Phase 2 completion (#35062 — lookup tables removed,
analytics.*wildcard RLS is now safe) - Related branch:
issue-34849-Add-dotCMS-Analytics-Proxy-Endpoint-for-/v1/analytics/-to-dot-ca-event-manager
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing test-only docker/init/50-users.sql and the issue's acceptance criteria, then determine where create_user.sh should replace it. Done means the script accepts customerId and password, provisions the ClickHouse user, role, row policy, grants, and host access, and can be rerun without errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clickhouse, shell
- Domain
- databases, security
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100