opencode-codebuddy-external-auth
Advanced tools
+12
-0
@@ -85,2 +85,12 @@ "use strict"; | ||
| } | ||
| function extractEnterpriseIdFromRoles(roles) { | ||
| if (!roles || roles.length === 0) | ||
| return ""; | ||
| for (const role of roles) { | ||
| const match = role.match(/group-admin:([A-Za-z0-9-]+)/); | ||
| if (match?.[1]) | ||
| return match[1]; | ||
| } | ||
| return ""; | ||
| } | ||
| function resolveEnterpriseId(accessToken) { | ||
@@ -90,2 +100,3 @@ if (CONFIG.enterpriseId) | ||
| const payload = decodeJwtPayload(accessToken); | ||
| const roles = payload?.realm_access?.roles || payload?.resource_access?.account?.roles; | ||
| return (payload?.enterprise_id || | ||
@@ -95,2 +106,3 @@ payload?.enterpriseId || | ||
| payload?.entId || | ||
| extractEnterpriseIdFromRoles(roles) || | ||
| ""); | ||
@@ -97,0 +109,0 @@ } |
+1
-1
| { | ||
| "name": "opencode-codebuddy-external-auth", | ||
| "version": "1.0.19", | ||
| "version": "1.0.20", | ||
| "description": "OpenCode plugin for CodeBuddy External (IOA) authentication", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
36482
1.15%833
1.46%