pglombardo / PasswordPusher

πŸ” Securely share sensitive information with automatic expiration & deletion after a set number of views or duration. Track who, what and when with full audit logs.
https://docs.pwpush.com
Apache License 2.0
2.02k stars 343 forks source link

API Pagination #1661

Open liquid-metal opened 10 months ago

liquid-metal commented 10 months ago

πŸš€ Feature Request

API endpoints for active and expired (and possibly audit log as well) should return pagination information.

πŸ”ˆ Motivation

In order to work reliably with the api, at the moment it is cumbersome to work on all items of a list, most notably expiring all passwords that are active at the moment, and also reporting purposes that require full listing of entries in a custom format. Currently the workflow is like

  1. get all items (e.g. GET /p/active.json)
  2. for each item, perform the action (e.g. DELETE /p/item.json)
  3. repeat until 1. does not return any data If the API directly exposed pagination information, this process could be better streamlined, and less error cases need to be handled in client code. In addition, pagination metadata can be used for efficient parallel client code, e.g. fetching and working on multiple pages in parallel. The information must be present, because it is available in the web UI as well, and the API clearly only returns the first 30 items.

πŸ›° Alternatives

Current workaround is described above. Not a dealbreaker, but annoying at times.

pglombardo commented 10 months ago

Same here - this would be a great addition. Thanks for pointing it out!