@acarmisc/backstage-plugin-litellm-backend 0.17.4 → 0.17.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +16 -1
- package/dist/index.cjs.js.map +2 -2
- package/dist/routes/bridge.js +18 -1
- package/package.json +1 -1
package/dist/routes/bridge.js
CHANGED
|
@@ -132,7 +132,24 @@ function registerBridgeRoutes(router, ctx, bridgeOpts) {
|
|
|
132
132
|
try {
|
|
133
133
|
const claims = await requireClaims(req);
|
|
134
134
|
const user = await (0, bridge_1.getOrProvisionUserFromClaims)(client, claims, provisioningEnabled, provisioningDefaults, logger, bridgeIdentity);
|
|
135
|
-
|
|
135
|
+
// Enrich team list with metadata (display names, etc.)
|
|
136
|
+
const teamIds = user.teams ?? [];
|
|
137
|
+
const teamMetadata = [];
|
|
138
|
+
for (const teamId of teamIds) {
|
|
139
|
+
try {
|
|
140
|
+
const teamInfo = await client.getTeamInfo(teamId);
|
|
141
|
+
teamMetadata.push({
|
|
142
|
+
id: teamId,
|
|
143
|
+
name: teamInfo.team_alias || teamId, // Use alias as display name, fallback to ID
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
// If we can't fetch team info, just use the ID
|
|
148
|
+
logger.debug(`Could not fetch team info for ${teamId}: ${e.message}`);
|
|
149
|
+
teamMetadata.push({ id: teamId });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
res.json({ user_id: user.user_id, teams: teamMetadata });
|
|
136
153
|
}
|
|
137
154
|
catch (error) {
|
|
138
155
|
handleBridgeError(error, res);
|