Skip to content

Collection permissions via HTTP headers #409

Open
@GrzegorzPustulka

Description

@GrzegorzPustulka

Currently all user queries have access to all collections.

I propose a solution that will allow limiting user queries to specific collections. The list of collections will be passed through a proxy, which will pass the collection list via header based on the user's role in KC

Changes on the API side:

  • Handling a new HTTP header containing a list of allowed collections (e.g., X-User-Permissions: ["collection1", "collection2", "collection3"])
  • Implementation of query filtering logic to specific index aliases
  • Adding an environment variable to enable/disable the functionality (e.g. ENABLE_COLLECTION_ACCESS_CONTROL)

System behavior:

  1. When ENABLE_COLLECTION_ACCESS_CONTROL variable is disabled:

    • All queries work as before (full access)
  2. When ENABLE_COLLECTION_ACCESS_CONTROL variable is enabled:

    • Missing header: no access to any collections
    • Empty header: no access to any collections
    • Header with list: access to the listed collections

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions