-
Notifications
You must be signed in to change notification settings - Fork 550
[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
base: development
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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" |
There was a problem hiding this comment.
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?
OPAModeIguazio OPAMode = "iguazio" | ||
OPAModeIguazioV4 OPAMode = "iguazio-v4" | ||
OPAModeNop OPAMode = "nop" |
There was a problem hiding this comment.
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?
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