stac-utils / stac-utils/pgstac

`pgstac_ingest` role does not allow access to the `POST /collections` API endpoint

Open
#147 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PLpgSQL
Stars
223
Forks
57
PR merge metrics
No merged PRs in 30d

Description

According to https://stac-utils.github.io/pgstac/pgstac/#pgstac-users:

The pgstac_ingest role has read/write priviliges on all tables and should be used for data ingest or if using the transactions extension with stac-fastapi-pgstac.

However, when running the STAC API with the Transactions extension enabled, connecting to the database as the pgstac_ingest role, an attempt to create a collection via the POST /collections endpoint fails with:

asyncpg.exceptions.InsufficientPrivilegeError: must be owner of table partitions

The owner of the partitions table is pgstac_admin, as expected. So it would appear that the pgstac_ingest role does not actually allow access to all of the Transactions endpoints?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the POST /collections request with the Transactions extension enabled while connected as pgstac_ingest, then inspect the role privileges and ownership of the partitions table. Done means pgstac_ingest can create a collection through that endpoint without the InsufficientPrivilegeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
api, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.