Skip to content

TypeError when using keyword replacement with database enabled clients #929

Open
@snorfalorpagus

Description

@snorfalorpagus

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of this tool and the issue still persists.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

I’m trying to implement keyword replacement 1 to allow me to manage our development and production tenants. It’s working as expected, but I’m getting an error when I try to use it for the enabled_clients attribute on a username/password database connection. The goal is to enable it for some applications in development, but not in production.

Originally posted in the community forum: https://community.auth0.com/t/typeerror-when-using-keyword-replacement-with-database-enabled-clients/139339/2

Expectation

If I enable debug output when running a0deploy export I see the following:

2024-07-19T16:10:14.369Z - debug: TypeError: (enabledClients || []).map is not a function or its return value is not iterable

Using the same technique for another attribute in the file (e.g. realms) works as expected.

Have I made some mistake in the syntax? Or is this a bug in the CLI?

Reproduction

My config looks like this:

  "AUTH0_KEYWORD_REPLACE_MAPPINGS": {
    "DATABASE_CONNECTIONS_USERNAME_PASSWORD_ENABLED_CLIENTS": [
      "AnApplication",
      "AnotherApplication"
    ],
  }

with a replacement like:

"enabled_clients": "@@DATABASE_CONNECTIONS_USERNAME_PASSWORD_ENABLED_CLIENTS@@"

Deploy CLI version

7.23.1

Node version

18.20.4

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions