Skip to content

Key names in credentials.template.yml do not match Pydantic config objects. #1609

@junhaoliao

Description

@junhaoliao

Bug

There is a mismatch between the key names defined in credentials.template.yml and the corresponding Pydantic config objects:

## Database credentials
#database:
# user: "user"
# password: "pass"
#
## Queue credentials
#queue:
# user: "user"
# password: "pass"
#
## Redis credentials
#redis:
# password: "pass"

vs

the database credentials loading for example:

self.username = get_config_value(config, f"{DB_COMPONENT_NAME}.user")
self.password = get_config_value(config, f"{DB_COMPONENT_NAME}.password")

Additionally:

  • The commented-out default values in credentials.template.yml do not match the generated values when the credentials.yml file is missing:
    credentials = {
    DB_COMPONENT_NAME: {"user": "clp-user", "password": secrets.token_urlsafe(8)},
    QUEUE_COMPONENT_NAME: {"user": "clp-user", "password": secrets.token_urlsafe(8)},
    REDIS_COMPONENT_NAME: {"password": secrets.token_urlsafe(16)},
    }

If the credentials loading mechanism is changed, can cause confusion for developers trying to populate credentials.yml correctly and may lead to runtime errors if the keys are misaligned.

CLP version

dfb4526

Environment

N/A: code issue

Reproduction steps

N/A: code issue

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions