AmpersandTarski / RAP

RAP is a tool that lets you analyse Ampersand models, generate functional specifications and make prototypes of information systems. It is the primary tool for students of the Open University of the Netherlands in the course Rule Based Design.
5 stars 3 forks source link

Limit allowed chars in username or do not use username in code #338

Closed KlaasDijkstraOrdina closed 10 months ago

KlaasDijkstraOrdina commented 10 months ago

De situatie

I used klaas.dijkstra@ordina.nl as username and got an error when generating the Prototype.

Wat er gebeurde er en wat had je verwacht?

Error on Prototype generatie (uses username in domainname, i guess) Deployment.apps "klaas.dijkstra@ordina.nl" is invalid: [metadata.name: Invalid value: "klaas.dijkstra@ordina.nl": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is 'a-z0-9?(.a-z0-9?)*'), metadata.labels: Invalid value: "klaas.dijkstra@ordina.nl": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.'...

If you solve by choosing not to use the username you might generate a random string instead, but I would advise to solve by limiting allowed chars to domain name RFC + Check code for possible more uses of the username (other limitations).

Screenshot / Video

Context / Source van ampersand script

hanjoosten commented 10 months ago

Hi @FranSlot , This is a similar bug as the one last week. There should be a mapping from the name to the subdomain. For instance, apply a function that removes all characters that are not allowed, or (even better?) substitute them with an allowed character.