[Backend] Add SECRET credential type for storing generic sensitive values (#4246)

This commit is contained in:
Marc Kelechava
2025-12-09 11:19:57 -08:00
committed by GitHub
parent 71e4614cfe
commit eb50fdef83
7 changed files with 107 additions and 5 deletions

View File

@@ -4573,6 +4573,7 @@ class AgentDB:
card_last4: str | None,
card_brand: str | None,
totp_identifier: str | None = None,
secret_label: str | None = None,
) -> Credential:
async with self.Session() as session:
credential = CredentialModel(
@@ -4586,6 +4587,7 @@ class AgentDB:
totp_identifier=totp_identifier,
card_last4=card_last4,
card_brand=card_brand,
secret_label=secret_label,
)
session.add(credential)
await session.commit()

View File

@@ -901,6 +901,7 @@ class CredentialModel(Base):
totp_identifier = Column(String, nullable=True, default=None)
card_last4 = Column(String, nullable=True)
card_brand = Column(String, nullable=True)
secret_label = Column(String, nullable=True)
created_at = Column(DateTime, default=datetime.datetime.utcnow, nullable=False)
modified_at = Column(DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow, nullable=False)