mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 08:41:36 +00:00
Added enterprise key prefix to SecretId for better distinction
This commit is contained in:
parent
c985858894
commit
cb6ab7a116
@ -43,7 +43,7 @@ public sealed record EmbeddingProvider(
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
public string SecretId => this.Id;
|
||||
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.UsedLLMProvider.ToName()}" : this.UsedLLMProvider.ToName();
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
@ -124,7 +124,7 @@ public sealed record EmbeddingProvider(
|
||||
{
|
||||
// Queue the API key for storage in the OS keyring:
|
||||
PendingEnterpriseApiKeys.Add(new(
|
||||
id.ToString(),
|
||||
$"{ISecretId.ENTERPRISE_KEY_PREFIX}::{usedLLMProvider.ToName()}",
|
||||
name,
|
||||
decryptedApiKey,
|
||||
SecretStoreType.EMBEDDING_PROVIDER));
|
||||
|
||||
@ -71,7 +71,7 @@ public sealed record Provider(
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
public string SecretId => this.Id;
|
||||
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.UsedLLMProvider.ToName()}" : this.UsedLLMProvider.ToName();
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
@ -181,7 +181,7 @@ public sealed record Provider(
|
||||
{
|
||||
// Queue the API key for storage in the OS keyring:
|
||||
PendingEnterpriseApiKeys.Add(new(
|
||||
id.ToString(),
|
||||
$"{ISecretId.ENTERPRISE_KEY_PREFIX}::{usedLLMProvider.ToName()}",
|
||||
instanceName,
|
||||
decryptedApiKey,
|
||||
SecretStoreType.LLM_PROVIDER));
|
||||
|
||||
@ -43,7 +43,7 @@ public sealed record TranscriptionProvider(
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
public string SecretId => this.Id;
|
||||
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.UsedLLMProvider.ToName()}" : this.UsedLLMProvider.ToName();
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
@ -124,7 +124,7 @@ public sealed record TranscriptionProvider(
|
||||
{
|
||||
// Queue the API key for storage in the OS keyring:
|
||||
PendingEnterpriseApiKeys.Add(new(
|
||||
id.ToString(),
|
||||
$"{ISecretId.ENTERPRISE_KEY_PREFIX}::{usedLLMProvider.ToName()}",
|
||||
name,
|
||||
decryptedApiKey,
|
||||
SecretStoreType.TRANSCRIPTION_PROVIDER));
|
||||
|
||||
@ -5,6 +5,13 @@ namespace AIStudio.Tools;
|
||||
/// </summary>
|
||||
public interface ISecretId
|
||||
{
|
||||
/// <summary>
|
||||
/// Prefix used for secrets imported from enterprise configuration plugins.
|
||||
/// This helps distinguish enterprise-managed keys from user-added keys
|
||||
/// in the OS keyring.
|
||||
/// </summary>
|
||||
public const string ENTERPRISE_KEY_PREFIX = "config-plugin";
|
||||
|
||||
/// <summary>
|
||||
/// The unique ID of the secret.
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user