Skip to content

Endpoints that query the user model should not be case sensitive #2803

@FrankApiyo

Description

@FrankApiyo

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'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions