Repository navigation
Description
Problem
With the auth profile, POST /ga4gh/tes/v1/tasks answers 500 for a member of a team group whose name isn't a valid Kubernetes label value. Seen in a test install with LS Login, for a member of the team group BioHackCloud%20Admins (a direct subgroup of the environment group, so a team by the documented model; LS Login percent-encodes the space):
ConfigMap "task-352dd20b" is invalid: metadata.labels: Invalid value: "BioHackCloud%20Admins": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character
TESK API writes the team name as is into the label creator-group-name of the taskmaster job and its ConfigMap (from tags['GROUP_NAME'] or a team of the user), and into the label selector for listing (creator-group-name in (...)). Label values are limited to 63 characters from [A-Za-z0-9._-], starting and ending with an alphanumeric character; team names are any text without : (spaces, %, Unicode, long names). Listing tasks breaks for the same users, and characters such as ) or ! can change the selector.
The user ID already has this solved (#119: hash label plus annotation).
Proposal
Same approach as for the creator:
- label
creator-group-name: the team name if it is a valid label value (as now, so existing tasks keep working), otherwise a fixed-length hash of it; - annotation
creator-group-name: the full team name; the team of a task is the annotation if the label matches it, otherwise the label (tasks created before the annotation); - the list selector uses the same label values; the list filter checks the team as getting a task does.
Regression tests with several awkward team names (spaces, %, Unicode, over 63 characters, selector characters) and an odd sub; docs in docs/access-control.md.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
build: set the 2.1.0 date and complete the notes