Allow underscore in tenant names

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

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.

Environment

None

Potential Workaround

None

Attachments

1

Checklist

hide

TestRail: Results

Activity

Show:

Yauhen Viazau February 5, 2024 at 5:09 PM
Edited

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

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Eureka

Fix versions

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created February 1, 2024 at 5:20 PM
Updated March 29, 2024 at 6:20 PM
Resolved February 22, 2024 at 1:47 PM
TestRail: Cases
TestRail: Runs