-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
/api/auth/rules endpoint implementation improvements #5190
Conversation
/check |
❌ Some checks failed |
/check |
🚫 Workflows has been canceled |
cvat/apps/iam/apps.py
Outdated
|
||
class IAMConfig(AppConfig): | ||
name = 'cvat.apps.iam' | ||
|
||
def ready(self): | ||
from .signals import register_signals | ||
register_signals(self) | ||
|
||
if strtobool(os.environ.get("IAM_BUNDLE_RULES", '0')): | ||
bundle_path = Path(settings.IAM_RULE_BUNDLE_PATH) |
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.
Please use the same pattern for names. For now we have IAM_RULE_BUNDLE, IAM_BUNDLE_RULES.
I will recommend something like IAM_OPA_BUNDLE
.github/workflows/full.yml
Outdated
max_tries=12 | ||
while [[ $(curl -s -o /dev/null -w "%{http_code}" localhost:8181/health) != "200" && max_tries -gt 0 ]]; do (( max_tries-- )); sleep 5; done | ||
while [[ $(curl -s -o /dev/null -w "%{http_code}" localhost:8181/health?bundle=true) != "200" && max_tries -gt 0 ]]; do (( max_tries-- )); sleep 5; done |
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.
bundles
- Boolean parameter to account for bundle activation status in response. This includes any discovery bundles or bundles defined in the loaded discovery configuration.
.github/workflows/main.yml
Outdated
|
||
max_tries=12 | ||
while [[ $(curl -s -o /dev/null -w "%{http_code}" localhost:8181/health) != "200" && max_tries -gt 0 ]]; do (( max_tries-- )); sleep 5; done | ||
while [[ $(curl -s -o /dev/null -w "%{http_code}" localhost:8181/health?bundle=true) != "200" && max_tries -gt 0 ]]; do (( max_tries-- )); sleep 5; done |
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.
bundles - Boolean parameter to account for bundle activation status in response. This includes any discovery bundles or bundles defined in the loaded discovery configuration.
.github/workflows/schedule.yml
Outdated
max_tries=12 | ||
while [[ $(curl -s -o /dev/null -w "%{http_code}" localhost:8181/health) != "200" && max_tries -gt 0 ]]; do (( max_tries-- )); sleep 5; done | ||
while [[ $(curl -s -o /dev/null -w "%{http_code}" localhost:8181/health?bundle=true) != "200" && max_tries -gt 0 ]]; do (( max_tries-- )); sleep 5; done |
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.
bundles - Boolean parameter to account for bundle activation status in response. This includes any discovery bundles or bundles defined in the loaded discovery configuration.
.vscode/launch.json
Outdated
"CVAT_SERVERLESS": "1" | ||
"CVAT_SERVERLESS": "1", | ||
"ALLOWED_HOSTS": "*", | ||
"IAM_BUNDLE_RULES": "1" |
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.
Let's use IAM_OPA_BUNDLE here
cvat/apps/iam/apps.py
Outdated
|
||
class IAMConfig(AppConfig): | ||
name = 'cvat.apps.iam' | ||
|
||
def ready(self): | ||
from .signals import register_signals | ||
register_signals(self) | ||
|
||
if strtobool(os.environ.get("IAM_BUNDLE_RULES", '0')): |
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.
Let's create a separate function create_opa_bundle
cvat/settings/base.py
Outdated
@@ -390,6 +390,9 @@ def add_ssh_keys(): | |||
TMP_FILES_ROOT = os.path.join(DATA_ROOT, 'tmp') | |||
os.makedirs(TMP_FILES_ROOT, exist_ok=True) | |||
|
|||
IAM_RULE_BUNDLE_PATH = os.path.join(STATIC_ROOT, 'opa', 'bundle.tar.gz') |
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.
IAM_OPA_BUNDLE_PATH
Motivation and context
How has this been tested?
Checklist
develop
branchcvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.