Skip to content

opa plugin add extraCredentails #25513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

beiliubei
Copy link

Description

The identity supports receiving the extraCredentials parameter.

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Apr 7, 2025
@beiliubei beiliubei force-pushed the opa-extraCredential branch from 354618d to 0d07284 Compare April 7, 2025 05:06
@wendigo
Copy link
Contributor

wendigo commented Apr 7, 2025

What's the use case for this? I don't think that we want the extra credentials to leak to a OPA

@beiliubei
Copy link
Author

from the opa plugin we want more informations, like project name.

@wendigo
Copy link
Contributor

wendigo commented Apr 7, 2025

I don't understand how extraCredentials relate to project name

@beiliubei
Copy link
Author

beiliubei commented Apr 8, 2025

{"connect_args":{"http_headers":{"X-Trino-Extra-Credential":"project=project1"}}}

We are using superset with Trino and with these engine parameters in the superset.
Meanwhile, we will define different policies for the project in the OPA(rego).

projects := yaml.unmarshal(`
projects:
  - name: "project1"
    databases:
          - name: "db1"
            tables:
              - name: "tb1"
                 expression: "app_id in ('a1')"
  - name: "project2"
    databases:
          - name: "db1"
            tables:
              - name: "tb1"
                 expression: "app_id in ('b1')"
`)
input.context.identity.extraCredentials["project"]

with this config, and then receiving the extra credential from the Trino query, we will append the where cause app_id in ('a1')

some same request issue.
#25415
#24493

@beiliubei beiliubei self-assigned this Apr 10, 2025
@beiliubei beiliubei requested review from losipiuk and vagaerg April 10, 2025 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants