onaio/onadata

Endpoints that query the user model should not be case sensitive

Open

#2,803 opened on Apr 23, 2025

View on GitHub
 (5 comments) (0 reactions) (0 assignees)Python (143 forks)auto 404
ErrorGood First Issue

Repository metrics

Stars
 (187 stars)
PR merge metrics
 (PR metrics pending)

Description

Environmental Information

  • Onadata version: 5.0.3

Problem description

Endpoints that query the user model using the username are currently case sensitive. Examples are as follows:

  • /api/v1/profiles
  • /api/v1/projects/10574/share

Expected behavior

We should be able to query for usernames in a case-insensitive manner

Steps to reproduce the behavior

The following commands should yield the same result:

➜  curl 'scheme://api-domain/api/v1/profiles.json?users=fapiyo' \
  -H 'accept: application/json' \
  -H 'authorization: TempToken <Your temp token>'
➜  curl 'scheme://api-domain/api/v1/profiles.json?users=FApiyo' \
  -H 'accept: application/json' \
  -H 'authorization: TempToken <Your temp token>'
➜  curl 'scheme://api-domain/api/v1/projects/<project-id>/share' \
  -X 'PUT' \
  -H 'accept: application/json' \
  -H 'authorization: TempToken <Your temp token>' \
  --data-raw 'username=fapiyo&role=readonly'
➜  curl 'scheme://api-domain/api/v1/projects/<project-id>/share' \
  -X 'PUT' \
  -H 'accept: application/json' \
  -H 'authorization: TempToken <Your temp token>' \
  --data-raw 'username=FApiyo&role=readonly'

Contributor guide