Skip to content

Fix Zitadel generated password complexity requirements - #1589

Open
afscrome wants to merge 2 commits into
CommunityToolkit:mainfrom
afscrome:codex/fix-zitadel-password-complexity
Open

Fix Zitadel generated password complexity requirements#1589
afscrome wants to merge 2 commits into
CommunityToolkit:mainfrom
afscrome:codex/fix-zitadel-password-complexity

Conversation

@afscrome

@afscrome afscrome commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Zitadel can fail during initial setup when its generated admin password contains no digits. Require at least one lowercase letter, uppercase letter, digit, and special character when generating the default password.

Aspire defaults minLower, minUpper, and minNumeric to zero; enabling those character classes does not guarantee their presence. The integration previously specified only minSpecial: 1.

Failure evidence

The failed GitHub Actions job in run 34691146787, observed on #1588, reported 7 failed tests out of 31. Zitadel v4.15.0 logged:

2026-09-12T11:31:14.927Z level=ERROR msg="migration failed" ... name=03_default_instance ... err.message=Errors.User.PasswordComplexityPolicy.HasNumber
2026-09-12T11:31:14.929Z level=ERROR+6 msg="setup failed, skipping cleanup" ... err.message=Errors.User.PasswordComplexityPolicy.HasNumber

The tests then failed with:

Aspire.Hosting.DistributedApplicationException : Stopped waiting for resource 'zitadel' to become healthy because it failed to start.

The log excerpts above omit unrelated fields with .... The existing database dependency already calls .WaitFor(database), and the failing tests already wait for Zitadel to become healthy. The setup failure requires a password-generation fix.

Validation

  • Passed all 15 ZitadelHostingExtensionsTests (including the new password regression test) with dotnet run --project tests/CommunityToolkit.Aspire.Hosting.Zitadel.Tests --configuration Release -- --filter-class '*ZitadelHostingExtensionsTests'.
  • Attempted the seven affected C# integration tests; local fixture startup is blocked because the Docker daemon is unavailable (Container runtime 'docker' was found but appears to be unhealthy). Container validation remains for CI.
  • git diff --check passed.

PR Checklist

  • Created a feature branch in a fork
  • Based off latest main branch of toolkit at creation
  • PR does not include merge commits
  • Contains no breaking API changes
  • Code follows existing style conventions

The regression test inspects all four generation minima and validates a freshly generated password. It fails against the original minSpecial-only settings and passes with the fix. Publish mode exposes the generator directly without persisted user secrets.

Copilot AI lite review requested due to automatic review settings September 12, 2026 12:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Add a deterministic test verifying all four required character classes.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates Zitadel’s generated admin password to require lowercase, uppercase, numeric, and special characters.

Changes:

  • Strengthens default password generation requirements.
File summaries
File Summary
src/CommunityToolkit.Aspire.Hosting.Zitadel/ZitadelHostingExtensions.cs Applies complete password complexity constraints.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


var usernameParameter = username?.Resource ?? new ParameterResource($"{name}-username", _ => "admin", false);
var passwordParameter = password?.Resource ?? ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder, $"{name}-password", minSpecial: 1);
var passwordParameter = password?.Resource ?? ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder, $"{name}-password", minLower: 1, minUpper: 1, minNumeric: 1, minSpecial: 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants