8000 [OPA] Use opa-client package by TomerShor · Pull Request #3692 · nuclio/nuclio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[OPA] Use opa-client package #3692

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 5 commits into
base: development
Choose a base branch
from

Conversation

TomerShor
Copy link
Contributor
@TomerShor TomerShor commented Jul 4, 2025

Use the new https://github.com/nuclio/opa-client package as the HTTP OPA client.
This package was extracted from the nuclio/nuclio repo so it can be used by other projects as well, so it basically has the same implementation.

The only difference is that now both Query functions (Filter single & multiple resources) get a ctx argument.

The internal opa package is left to handle constants and helper functions that Nuclio uses, but are not specific to the client's implementation.

A new Mode was added to the OPA section in the platform config, as a prep for working with Iguazio V4.
In V4, the resources are namespaced under either /resources or /mgmt, so this prefix is added according to this mode.
This is backwards compatible, as if no mode is provided - no prefix is added.

https://iguazio.atlassian.net/browse/NUC-507

Copy link
Contributor
@rokatyy rokatyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just 2 questions and also short tests are failing

Action string `json:"action,omitempty"`
Ids []string `json:"ids,omitempty"`
}
OverrideHeader = "x-projects-role"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not in headers.go?

Comment on lines +35 to +37
OPAModeIguazio OPAMode = "iguazio"
OPAModeIguazioV4 OPAMode = "iguazio-v4"
OPAModeNop OPAMode = "nop"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be that auth mode is old igz and opa mode is igz4 or same constants can be reused?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0