Skip to content
Snippets Groups Projects
  1. Feb 23, 2023
  2. Feb 17, 2023
  3. Oct 27, 2022
  4. May 25, 2022
  5. Apr 11, 2022
    • Antoine Lambert's avatar
      api/private/deposit_list: Add new endpoint to be used with datatables · e3a31ba7
      Antoine Lambert authored
      Add new private API endpoint /1/private/deposits/datatables/ to list and
      filter deposits whose responses are intended to be consumed by datatables
      javascript framework used in deposits admin Web UI.
      
      Originally that view was implemented in swh-web but for performance reasons
      it has been decided to move it in swh-deposit, swh-web will then simply
      forward the HTTP request to swh-deposit.
      
      Related to T3128
      e3a31ba7
  6. Apr 08, 2022
  7. Apr 07, 2022
  8. Apr 06, 2022
  9. Mar 28, 2022
  10. Mar 21, 2022
  11. Mar 16, 2022
  12. Mar 08, 2022
  13. Mar 04, 2022
  14. Mar 02, 2022
  15. Feb 28, 2022
  16. Feb 24, 2022
  17. Feb 23, 2022
  18. Feb 22, 2022
    • vlorentz's avatar
      server: Use xml.etree.ElementTree instead of nested dicts internally · 55ae87b1
      vlorentz authored
      This commit does not touch the external API though; ie. `metadata_dict`
      is still present in the JSON API, and the equivalent `jsonb` field remains
      in the database. They will probably be removed in a future commit
      because they are not very useful, though.
      
      Rationale:
      
      I find xmltodict's approach of translating XML tree to native structures
      to be intrinsically flawed for non-trivial handling of XML, because the
      data structure is:
      
      * implementation-defined (by xmltodict, which is python-only) and it may
        change across versions
      * does not intrinsically store namespaces, and relies on an internal
        prefix map  (though it isn't much of an issue right now, as we do not need
        composability and all the changed APIs are private)
      * not stable; for example, `<a><b>foo</b></a>` and `<a><b>foo</b><b>bar</b></a>`
        are encoded completely differently (the former is a `Dict[str, str]`,
        the latter is `Dict[str, list]`.
      
      And every operation manipulating this data structure needs to check
      presence, number *and* type on every access. Consider this part of this
      commit for example:
      
      ```
      -    swh_deposit = metadata.get("swh:deposit")
      -    if not swh_deposit:
      -        return None
      -
      -    swh_reference = swh_deposit.get("swh:reference")
      -    if not swh_reference:
      -        return None
      -
      -    swh_origin = swh_reference.get("swh:origin")
      -    if swh_origin:
      -        url = swh_origin.get("@url")
      -        if url:
      -            return url
      +    ref_origin = metadata.find(
      +        "swh:deposit/swh:reference/swh:origin[@url]", namespaces=NAMESPACES
      +    )
      +    if ref_origin is not None:
      +        return ref_origin.attrib["url"]
      ```
      
      the use of XPath makes it considerably shorter; and the original version
      did not even check number/type (ie. it would crash if an element was
      duplicated).
      55ae87b1
    • vlorentz's avatar
      Remove metadata merging; use only the latest document · 7727a9c0
      vlorentz authored
      We don't use that feature at all as far as I am aware.
      
      I also find that it complicates any metadata handling (especially the validation
      I would like to add in the near future), and probably does not match semantics
      intended by SWORD (merging occurs on PUT requests, as we don't implement PATCH)
      7727a9c0
  19. Feb 21, 2022
  20. Jan 18, 2022
  21. Jan 10, 2022
  22. Nov 05, 2021
  23. Oct 21, 2021
  24. Oct 19, 2021
  25. Oct 06, 2021
  26. Aug 12, 2021
  27. May 25, 2021
  28. May 21, 2021
    • Antoine R. Dumont's avatar
      Open a paginated list user deposits endpoint · c28bb486
      Antoine R. Dumont authored
      This adds a paginated listing endpoint so authenticated user can retrieve their deposit
      information in batch. This touches another part of an equivalent private listing api to
      allow paginated code reuse.
      
      That new endpoint is not a sword endpoint but it lists deposits in xml relatively sword
      like nonetheless.
      
      Related to T2996
      Verified
      c28bb486
Loading