[MGRTENANT-10] Allow underscore in tenant names Created: 01/Feb/24  Updated: 06/Feb/24

Status: In Review
Project: mgr-tenants
Components: None
Affects versions: None
Fix versions: None

Type: Story Priority: P1
Reporter: Craig McNally Assignee: Pavel Filippov
Resolution: Unresolved Votes: 0
Labels: back-end, epam-eureka, eureka-phase4
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: File MGRTENANT-10_evrk.mp4    
Issue links:
Defines
defines UXPROD-4633 Manager Usability Improvements In Progress
Sprint: Eureka Sprint 45
Story Points: 1
Development Team: Eureka
RCA Group: TBD

 Description   

Overview

Presently, tenant names are restricted to the following pattern: {{[a-z][a-z0-9]

{0,30}}}.  This is too restrictive for naming conventions used by FSE.  

There are naming restrictions in Keycloak and Postgres.  The restriction in the manager components need to take both of these into consideration

* Keycloak:  The Realm name must not contain spaces, or any special character other than "_" or "-".
* Postgres:   _ is allowed, - and spaces are not.  Length must be < 64 bytes

h2. Approach

Adjust the naming convention to allow underscores in tenant names, as these are allowed in both Keycloak and Postresql.  With this, FSE can continue to use existing naming conventions.

* Old Pattern:  {{[a-z][a-z0-9]{0,30}

}}

  • New Pattern:  {{[a-z][a-z0-9_] {0,29}

    [a-z0-9]}}

Acceptance Criteria

  • mgr-tenants allows tenant names adhering to the new pattern above
  • tests have been updated
  • a demonstration has been given to the team

Additional Info/Links

See https://folio-org.atlassian.net/wiki/display/TC/DR-000002+-+Tenant+Id+and+Module+Name+Restrictions.  In pages linked from here, a potential name clash is described, but it seems highly unlikely to happen unless tenants use suffixes like _mod or _edge and modules which don't use the standard mod- or edge- name prefix.  If needed, we can consider adding checks for these to mgr-tenants to prevent this from happening.



 Comments   
Comment by Yauhen Viazau [ 05/Feb/24 ]

Tested on “evrk“ environment - works as expected

A tenant with one or multiple “_“ in the name can be successfully created. See screencast with an example:

Note: tenant names with an underscore at the beginning or an end of a name are not allowed, as per pattern in ticket description

Generated at Thu Feb 08 22:31:23 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.