mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
refactor(backend): add description field support for secrets (v1 conversations) (#12080)
This commit is contained in:
@@ -579,6 +579,7 @@ class LiveStatusAppConversationService(AppConversationServiceBase):
|
||||
continue
|
||||
|
||||
secret_name = f'{provider_type.name}_TOKEN'
|
||||
description = f'{provider_type.name} authentication token'
|
||||
|
||||
if self.web_url:
|
||||
# Create an access token for web-based authentication
|
||||
@@ -598,12 +599,15 @@ class LiveStatusAppConversationService(AppConversationServiceBase):
|
||||
secrets[secret_name] = LookupSecret(
|
||||
url=self.web_url + '/api/v1/webhooks/secrets',
|
||||
headers=headers,
|
||||
description=description,
|
||||
)
|
||||
else:
|
||||
# Use static token for environments without web URL access
|
||||
static_token = await self.user_context.get_latest_token(provider_type)
|
||||
if static_token:
|
||||
secrets[secret_name] = StaticSecret(value=static_token)
|
||||
secrets[secret_name] = StaticSecret(
|
||||
value=static_token, description=description
|
||||
)
|
||||
|
||||
return secrets
|
||||
|
||||
|
||||
@@ -81,7 +81,12 @@ class AuthUserContext(UserContext):
|
||||
secrets = await self.user_auth.get_secrets()
|
||||
if secrets:
|
||||
for name, custom_secret in secrets.custom_secrets.items():
|
||||
results[name] = StaticSecret(value=custom_secret.secret)
|
||||
results[name] = StaticSecret(
|
||||
value=custom_secret.secret,
|
||||
description=custom_secret.description
|
||||
if custom_secret.description
|
||||
else None,
|
||||
)
|
||||
|
||||
return results
|
||||
|
||||
|
||||
Reference in New Issue
Block a user