Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

feat(auth): add cua-desktop public device-flow client for Cua Spaces app (#7361)

ddupont27146761d4ec
diff --git a/libs/fleet/backend/auth/authz.rego b/libs/fleet/backend/auth/authz.rego
index a533466759..2d20d39927 100644
--- a/libs/fleet/backend/auth/authz.rego
+++ b/libs/fleet/backend/auth/authz.rego
@@ -71,6 +71,10 @@ is_interactive_client {
input.user.azp == "cua-cli"
}
+is_interactive_client {
+ input.user.azp == "cua-desktop"
+}
+
# Per-key clients are Keycloak service accounts bound to one namespace by a
# hardcoded `namespace` claim. Their sub owns nothing on its own, so every
# surface that accepts them checks that claim against the route's parameters.
diff --git a/libs/fleet/backend/auth/authz_test.rego b/libs/fleet/backend/auth/authz_test.rego
index 11fd66bb33..440ca19a26 100644
--- a/libs/fleet/backend/auth/authz_test.rego
+++ b/libs/fleet/backend/auth/authz_test.rego
@@ -32,9 +32,10 @@ test_is_admin_false_no_flags if {
# once. That is the point of the shared vocabulary, and the reason it is worth
# testing directly rather than only through the surfaces that happen to use it.
-test_interactive_clients_are_exactly_two if {
+test_interactive_clients_are_exactly_three if {
authz.is_interactive_client with input as {"user": {"azp": "cyclops-cs-spa"}}
authz.is_interactive_client with input as {"user": {"azp": "cua-cli"}}
+ authz.is_interactive_client with input as {"user": {"azp": "cua-desktop"}}
not authz.is_interactive_client with input as {"user": {"azp": "kubernetes"}}
not authz.is_interactive_client with input as {"user": {"azp": ""}}
}