Skip to content

feature(azure-auth): increase azure auth spid max length#5748

Merged
scott-ray-wilson merged 2 commits intomainfrom
increase-azure-auth-spid
Mar 18, 2026
Merged

feature(azure-auth): increase azure auth spid max length#5748
scott-ray-wilson merged 2 commits intomainfrom
increase-azure-auth-spid

Conversation

@scott-ray-wilson
Copy link
Copy Markdown
Contributor

Context

This PR updates the max length of the azure allowedServicePrincipalIds field to accommodate more IDs

Screenshots

N/A

Steps to verify the change

Create an azure auth with more than 255 length allowedServicePrincipalIds field

Type

  • Fix
  • Feature
  • Improvement
  • Breaking
  • Docs
  • Chore

Checklist

  • Title follows the conventional commit format: type(scope): short description (scope is optional, e.g., fix: prevent crash on sync or fix(api): handle null response).
  • Tested locally
  • Updated docs (if needed)
  • Updated CLAUDE.md files (if needed)
  • Read the contributing guide

@maidul98
Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@scott-ray-wilson scott-ray-wilson changed the title backend(azure-auth): increase azure auth spid max length feature(azure-auth): increase azure auth spid max length Mar 18, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 18, 2026

Greptile Summary

This PR adds a database migration to increase the allowedServicePrincipalIds column in the IdentityAzureAuth table from VARCHAR(255) to VARCHAR(2048), allowing users to configure more Azure service principal IDs. The change is straightforward and correctly uses a hasColumn guard to make the up migration idempotent.

Key observations:

  • The migration is idempotent — both up and down use hasColumn checks before altering.
  • The down migration reduces the column back to 255 characters, which will fail in PostgreSQL for any row already storing values longer than 255 chars — exactly the scenario this PR is fixing. The rollback should either be a no-op or include a length check.
  • Using VARCHAR(2048) instead of TEXT may require another migration in the future if the limit is hit again; TEXT would be unlimited.
  • The application-level validator (validateAzureAuthField in identity-azure-auth-validators.ts) has no .max() constraint, so if the new cap of 2048 is intentional, a .max(2048) should be added there to surface a clear API error rather than a DB-level failure.

Confidence Score: 4/5

  • Safe to merge — the migration is additive and idempotent, with only minor rollback and future-proofing concerns.
  • The change is a simple column size increase with an idempotency guard. No logic changes, no security concerns, and no breaking API changes. Minor issues: the down migration is unsafe in practice (would fail/truncate for rows with >255 chars), and using TEXT instead of a fixed VARCHAR(2048) would be more future-proof.
  • No files require special attention; identity-azure-auth-validators.ts may optionally benefit from a .max(2048) guard.

Important Files Changed

Filename Overview
backend/src/db/migrations/20260318200000_increase-azure-spid-field-size.ts Adds a migration to increase allowedServicePrincipalIds column from VARCHAR(255) to VARCHAR(2048) with a hasColumn idempotency guard; the down migration could cause data loss on rollback and text type would be more future-proof.

Last reviewed commit: "fix: specify down le..."

@scott-ray-wilson scott-ray-wilson merged commit e73259a into main Mar 18, 2026
12 of 13 checks passed
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.

3 participants