fabric-testbed / fabric-core-api

Python (Flask) based ReSTful API for FABRIC Core User Services
MIT License
0 stars 0 forks source link

Sanitize name received from CI Logon #4

Closed ibaldin closed 1 year ago

ibaldin commented 2 years ago

For one of the users we received as a name that looked like John Doe::${displayName} which is likely an artifact of a misconfigured IdP. However this had a knock on effect of breaking the bastion client - it's useradd ansible task uses name as part of GECOS field and this was not acceptable probably due to $ and maybe {} characters, so user's bastion key was not installed.

We should sanitize name down to alphanumeric characters and whitespaces when we insert it into CoreAPI database. Maybe warn about it if unusual characters are found.