teleport/tool
Zac Bergquist 20c04df369
Clean up system role parsing (#9756)
* Add tests for ParseTeleportRoles

Updates #9752

* Be more tolerant when parsing system roles.

Our original attempt at canonicalizing roles didn't work for system
roles using camelcase, resulting in an awkward user experience.

Here we maintain a mapping of allowed inputs to their corresponding
system roles, and perform a case-insensitive lookup. This allows us
to support camelcase roles, and has the advantage of permitting
_ word separators as well.

Fixes #9752

* Refactor *SystemRole.Check()

Rather than having to list each role here, we rely on the new
roleMappings set to validate the role.

Additionally, remove the LegacyClusterTokenType role. This change
is guaranteed to be backwards compatible because we check for
RoleTrustedCluster everywhere we were checking for
LegacyClusterTokenType, and our roleMappings will convert the old
string that represented LegacyClusterTokenType to RoleTrustedCluster.
2022-01-14 00:13:59 +00:00
..
tctl Clean up system role parsing (#9756) 2022-01-14 00:13:59 +00:00
teleport Add teleport_build_info Prometheus metric to Teleport (#9595) 2022-01-05 21:17:54 +00:00
tsh Add support for MariaDB (#9409) 2022-01-10 20:12:31 -05:00