@acarmisc/backstage-plugin-litellm-backend 0.17.4 → 0.17.6

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.
@@ -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
- res.json({ user_id: user.user_id, teams: user.teams ?? [] });
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: teamIds, team_metadata: teamMetadata });
136
153
  }
137
154
  catch (error) {
138
155
  handleBridgeError(error, res);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acarmisc/backstage-plugin-litellm-backend",
3
- "version": "0.17.4",
3
+ "version": "0.17.6",
4
4
  "description": "The Backstage backend plugin for LiteLLM governance",
5
5
  "backstage": {
6
6
  "role": "backend-plugin",