Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
G
gracedb
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 99
    • Issues 99
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1
    • Merge Requests 1
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • lscsoft
  • gracedb
  • Issues
  • #195

Closed
Open
Opened Feb 27, 2020 by Leo Pound Singer@leo-singerContributor

Normalization of decimal GPS times is not applied to form-encoded requests to API endpoints

When making requests to API endpoints that expect decimal GPS times (for instance, when creating a superevent), normalization of GPS time inputs is done differently depending on whether the payload is JSON or form-encoded.

With form-encoded payloads, arguments with too many decimal points cause an error when they fail to validate against the format expected by Django:

$ curl -E /tmp/x509up_u$UID -d preferred_event=T63895 -d t_start=1000000000.1234568 -d t_0=1000000000.1234568 -d t_end=1000000000.1234568 -d category=T https://gracedb-test.ligo.org/api/superevents/
["Ensure that there are no more than 16 digits in total.","Ensure that there are no more than 16 digits in total.","Ensure that there are no more than 16 digits in total."]

If one makes the same request with a JSON payload, it succeeds because the GPS time fields get rounded and truncated to the appropriate number of digits:

$ curl -E /tmp/x509up_u$UID -H 'Content-Type: application/json' -d '{"preferred_event": "T63895", "t_start": 1000000000.1234568, "t_0": 1000000000.1234568, "t_end": 1000000000.1234568, "category": "T"}' https://gracedb-test.ligo.org/api/superevents/

This inconsistency is because the CustomDecimalField normalization is applied for JSON payloads but not form-encoded payloads. The normalization should be applied to all payloads, regardless of encoding.

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: lscsoft/gracedb#195