Change information
Commit message:
internal/api, etc.: paginate GetImportedBy
Paginate the GetImportedBy query on the database.
- Add keyset-based start path and limit parameter constraints
toDataSource.GetImportedBy.
'from_path >= $3' makes use of the existing composite primary key
index (to_path, from_path, from_module_path) on imports_unique.
- Restrict the API limit to a maximum of 1000 to protect database
resources.
- Since the tokens can now be arbitrarily long strings, use a
more general encryption technique supporting multiple blocks
to obfuscate them.
One consequence of this work: because a filter may eliminate every
item on a page, we might serve pages with zero items. This is
documented, and it is a feature (for us) because it lets us bound the
work on each query.
Change-Id: Ie9bf8ecfa395a003417d64028d5d0c311dbef561
Files:
- M internal/api/api.go
- M internal/api/openapi.yaml
- M internal/api/token.go
- M internal/api/token_test.go
- M internal/datasource.go
- M internal/fetchdatasource/fetchdatasource.go
- M internal/frontend/imports.go
- M internal/interfaces.go
- M internal/postgres/details.go
- M internal/postgres/details_test.go
- M internal/testing/fakedatasource/fakedatasource.go
Change size: L
Delta: 11 files changed, 305 insertions(+), 35 deletions(-)
Branch: refs/heads/master