Skip to content

fix(api): marketplace listing should reject expired RIs and return 4xx (not 500) for bad timestamps/terms #449

Closed

Description

@cristim

Follow-ups from the review of #448 (closes #98):

  • internal/api/handler_marketplace.go ~455-458 and ~625: a fully expired RI still lists at 1 month of residual value (the floor-at-1 guard). AWS rejects retired RIs anyway; reject expired RIs up front with a 4xx.
  • ~150-153: zero-timestamp and invalid-term errors are plain fmt.Errorf values, so the client gets a generic 500. Wrap them as NewClientError(422, ...) so the user sees why. It fails closed today (no listing row and no EC2 call happen).
  • Nit: the invalid-term message changed wording in fix(api): refuse marketplace pricing for an RI with no purchase timestamp #448; consider restoring 'expected 1 or 3 years'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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