mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 10:21: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 />
|
/// <inheritdoc />
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string SecretId => this.Id;
|
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.UsedLLMProvider.ToName()}" : this.UsedLLMProvider.ToName();
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
@ -124,7 +124,7 @@ public sealed record EmbeddingProvider(
|
|||||||
{
|
{
|
||||||
// Queue the API key for storage in the OS keyring:
|
// Queue the API key for storage in the OS keyring:
|
||||||
PendingEnterpriseApiKeys.Add(new(
|
PendingEnterpriseApiKeys.Add(new(
|
||||||
id.ToString(),
|
$"{ISecretId.ENTERPRISE_KEY_PREFIX}::{usedLLMProvider.ToName()}",
|
||||||
name,
|
name,
|
||||||
decryptedApiKey,
|
decryptedApiKey,
|
||||||
SecretStoreType.EMBEDDING_PROVIDER));
|
SecretStoreType.EMBEDDING_PROVIDER));
|
||||||
|
|||||||
@ -71,7 +71,7 @@ public sealed record Provider(
|
|||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string SecretId => this.Id;
|
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.UsedLLMProvider.ToName()}" : this.UsedLLMProvider.ToName();
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
@ -181,7 +181,7 @@ public sealed record Provider(
|
|||||||
{
|
{
|
||||||
// Queue the API key for storage in the OS keyring:
|
// Queue the API key for storage in the OS keyring:
|
||||||
PendingEnterpriseApiKeys.Add(new(
|
PendingEnterpriseApiKeys.Add(new(
|
||||||
id.ToString(),
|
$"{ISecretId.ENTERPRISE_KEY_PREFIX}::{usedLLMProvider.ToName()}",
|
||||||
instanceName,
|
instanceName,
|
||||||
decryptedApiKey,
|
decryptedApiKey,
|
||||||
SecretStoreType.LLM_PROVIDER));
|
SecretStoreType.LLM_PROVIDER));
|
||||||
|
|||||||
@ -43,7 +43,7 @@ public sealed record TranscriptionProvider(
|
|||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string SecretId => this.Id;
|
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.UsedLLMProvider.ToName()}" : this.UsedLLMProvider.ToName();
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
@ -124,7 +124,7 @@ public sealed record TranscriptionProvider(
|
|||||||
{
|
{
|
||||||
// Queue the API key for storage in the OS keyring:
|
// Queue the API key for storage in the OS keyring:
|
||||||
PendingEnterpriseApiKeys.Add(new(
|
PendingEnterpriseApiKeys.Add(new(
|
||||||
id.ToString(),
|
$"{ISecretId.ENTERPRISE_KEY_PREFIX}::{usedLLMProvider.ToName()}",
|
||||||
name,
|
name,
|
||||||
decryptedApiKey,
|
decryptedApiKey,
|
||||||
SecretStoreType.TRANSCRIPTION_PROVIDER));
|
SecretStoreType.TRANSCRIPTION_PROVIDER));
|
||||||
|
|||||||
@ -5,6 +5,13 @@ namespace AIStudio.Tools;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ISecretId
|
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>
|
/// <summary>
|
||||||
/// The unique ID of the secret.
|
/// The unique ID of the secret.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user