Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Keycloak module hardcodes KC_DB: postgres despite consuming a generic sql-database contract

Open
#682 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
docker-compose, python, yaml

Research direction

Start with modules/identity/keycloak/module.yaml and trace how metadataDatabase.contractRef is validated and how the Compose service gets its environment. The issue leaves two approaches open, and the configurable option depends on having another sql-database provider to design against. Done means the Postgres compatibility assumption is explicitly enforced, or KC_DB is correctly derived/configured for the bound provider.

Written by the indexing model from the issue text.

Description

area:configuration enhancement priority:low

Summary

modules/identity/keycloak/module.yaml declares metadataDatabase.contractRef
as a generic sql-database binding (spec.consumes[0].contract.kind: sql-database), matching the same contract kind any sql-database-providing
module could expose. However, the rendered Compose service hardcodes
KC_DB: postgres unconditionally:

environment:
  KC_DB: postgres
  KC_DB_URL_HOST: "${bindings.metadata-database.host}"
  ...

Today modules/warehouse/postgres is the only module providing
sql-database, so this is a silent assumption rather than an active bug --
but if a non-Postgres sql-database provider is ever added (e.g. a
managed/cloud database module), binding it to Keycloak would silently
misconfigure the container (Keycloak would try to speak the Postgres wire
protocol to a different database engine) rather than failing validation.

Proposed fix

Either:

  • Document this as an explicit, enforced assumption -- e.g. a validator
    check that metadataDatabase.contractRef resolves to a provider whose
    module declares Postgres compatibility (needs a way to express that in a
    contract or module metadata), or
  • Make KC_DB itself configurable/derived from the bound contract's
    provider, once a second sql-database provider exists to design against.

Context

Flagged during review of PR #677 (feat: add Keycloak identity module,
closing part of #370) as a named follow-up. Low priority today since
Postgres is the only sql-database provider in the repository, but should
not be forgotten once a second one exists.

Dominant language
Python
Stars
8
Forks
12
Avg merge
1d 19m
Merged PRs (30d)
119

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RonaldHensbergen/composable-data-stack

All issues in RonaldHensbergen/composable-data-stack

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.