Skip to content

Allowed characters: User IDs and namespaces #478

@m-mohr

Description

@m-mohr

Currently, the following is allowed in the API:

  • process namespaces (in process graphs) are not restricted wrt characters
  • user IDs are allowed to be: ^[\w\-\.~]+$

In #348 it became obvious that the user ID is likely to be used in process namespaces, but with #348 they are also meant to be part of the URI path. While you can use URI encoding, it's not ideal to allow all characters in the path segment, especially / is an issue here (e.g. due to OAI/OpenAPI-Specification#892).

Some things we've seen in implementations:

  • in the VITO implementation an "e-mail address" like construct (the EGI id) is used as namespace and user ID(?), which would not be valid right now.
  • In JS we do parsing of formulas, which includes processes and their namespaces. Thus symbols from math are problematic in namespaces (and we already run into inconsistencies with the -). The format is usually process@namespace.

I think the user ID and process namespace should cover the same range of allowed characters. While we can probably extend the allowed user IDs without issues in the API, but it might lead to issues when you store files under a folder with the user ID. We should probably restrict the namespace, but we can't enforce it directly in the process graphs in 1.x. Thus we could implicitly do so through #348 (and then it only applies if you implement the endpoints) and only later also apply it to the process graph.

The following set of characters could be allowed for both: ^[\w\-\.~\@]+$ (the : is not allowed in Windows filenames)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions