Skip to content

feat: updated identity login endpoints suborganization paramater to organizationSlug#5281

Merged
akhilmhdh merged 3 commits intomainfrom
feat/sub-org-login-change
Jan 28, 2026
Merged

feat: updated identity login endpoints suborganization paramater to organizationSlug#5281
akhilmhdh merged 3 commits intomainfrom
feat/sub-org-login-change

Conversation

@akhilmhdh
Copy link
Member

Context

This PR is to make the sub-organisation for public use. Before we go public, we’ve decided to use ‘organisationSlug’ instead of ‘subOrganisationName’ for identity login.

This is a breaking change, but it won’t affect anyone because sub-organisation access is still closed.

Screenshots

  1. Create a machine identity in root organization
  2. Enable sub-org in license and create a sub-organization
sub-org create button Screenshot 2026-01-27 at 7 14 44 PM
  1. Assing the root level machine to sub-org by linking
  2. Login with the respective auth method and provide organizationName parameter

Steps to verify the change

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)
  • Read the contributing guide

@akhilmhdh akhilmhdh requested a review from varonix0 January 27, 2026 13:46
@maidul98
Copy link
Collaborator

maidul98 commented Jan 27, 2026

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

Status Scanner 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.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Greptile Overview

Greptile Summary

This PR renames the API parameter subOrganizationName to organizationSlug across all identity login endpoints (Universal Auth, LDAP, JWT, OIDC, AWS IAM, Azure, GCP, Kubernetes, Alicloud, OCI, TLS Cert, and Token Auth). This is a breaking API change.

Key Changes:

  • Renamed parameter from subOrganizationName to organizationSlug in 13 authentication router endpoints
  • Updated corresponding TypeScript type definitions across all identity auth services
  • Modified business logic in service layers to use the new parameter name
  • Updated error messages to reference "slug" instead of "name" (e.g., "Sub organization with slug X not found")
  • Enhanced API documentation description to be more descriptive about parameter behavior
  • The underlying database query logic remains unchanged (still queries by slug field)

Breaking Change Impact:

  • Any API clients using subOrganizationName parameter will receive validation errors
  • According to the PR description, this won't affect existing users since sub-organization access is currently restricted
  • The change affects all 13 identity authentication methods consistently

Confidence Score: 5/5

  • This PR is safe to merge - it's a straightforward parameter rename with consistent changes across all authentication methods
  • The changes are mechanical and consistent across 37 files. The refactor only renames a parameter without changing any business logic, validation, or database queries. The parameter was already being used to query the slug field in the database, so the rename improves API naming clarity. Error messages were appropriately updated to reflect the new terminology.
  • No files require special attention - all changes follow the same straightforward pattern

Important Files Changed

Filename Overview
backend/src/lib/api-docs/constants.ts Updated API documentation constants to rename subOrganizationName to organizationSlug across all identity login endpoints, with improved description text
backend/src/server/routes/v1/identity-universal-auth-router.ts Changed login endpoint parameter from subOrganizationName to organizationSlug in request schema
backend/src/services/identity-ua/identity-ua-service.ts Renamed parameter from subOrganizationName to organizationSlug throughout login logic, including error messages that now say "slug" instead of "name"
backend/src/services/identity-jwt-auth/identity-jwt-auth-service.ts Renamed parameter from subOrganizationName to organizationSlug in login method, updated error messages and comments
backend/src/services/identity-ldap-auth/identity-ldap-auth-service.ts Renamed parameter from subOrganizationName to organizationSlug in login logic and error messages

varonix0
varonix0 previously approved these changes Jan 27, 2026
@akhilmhdh akhilmhdh merged commit 7e72295 into main Jan 28, 2026
9 of 11 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