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

Warn when resources have same names during import #771

Open
6 tasks done
darcien opened this issue Mar 21, 2023 · 3 comments
Open
6 tasks done

Warn when resources have same names during import #771

darcien opened this issue Mar 21, 2023 · 3 comments

Comments

@darcien
Copy link

darcien commented Mar 21, 2023

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

TL;DR exporting tenant that has multiple clients with the same name with a0deploy export --format=directory will merge the config into a single JSON file without any warnings.

I've seen this issue #98 that mention clients name must be unique.

But when exporting as directory, there was no warning and the CLI happily merged the clients with the same name name into one JSON file.

I just noticed this issue after doing a0deploy import and it failed to update the client connections.
In the meantime, I can update the tenant to not use duplicate names.

Expectation

It would be nice if the a0deploy export --format=directory command logs a warning or just error out when duplicate client names are found.

Or this behavior/limitation could be mentioned in the docs.

Reproduction

  1. Given Auth0 tenant with duplicate client names
  2. When running a0deploy export --format=directory for that tenant
  3. It should warn or error telling the user that duplicate client names are found and is invalid.

Deploy CLI version

7.17.0

Node version

16.14.0

@darcien darcien added the bug label Mar 21, 2023
@willvedd willvedd changed the title No warning or error when exporting tenant with duplicate client names and format=directory Warn when resources have same names during import Mar 24, 2023
@willvedd
Copy link
Contributor

Thanks for the suggestion, I agree that a warning or error would be beneficial in these cases. A core assumption of the Deploy CLI is that all resources have unique names for a single tenant, it is how the tenant-agnostic behavior is enabled. It is my opinion that resources with the same name is an anti-pattern for tenant management, but perhaps your use case is reasonable. For now, I advise to have separate names for your clients but will keep this request open because it is still a valid pain point that could be addressed.

@ghenry
Copy link

ghenry commented Apr 25, 2023

Hi all,

I've just hit this migrating a test domain to a prod one. The Management API and UX allow me to create as many clients/m2m clients etc. as I want with the same name. Obviously the client_id is the unique element.

At the creation stage these unique naming elements should be enforced.

I don't understand why this fails and why an export and import aren't EXACTLY the same. The export doesn't contain any secrets or client_ids. Why was that decision made as the domain is unique etc.

Thanks.

@ghenry
Copy link

ghenry commented Apr 25, 2023

Nevermind, I've enabled the export of these fields using INCLUDED_PROPS

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants