forked from CausalInferenceLab/Lang2SQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecrets.py
More file actions
24 lines (17 loc) · 747 Bytes
/
Copy pathsecrets.py
File metadata and controls
24 lines (17 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Secrets port — per-scope encrypted credential storage.
Holds DB connection strings / API keys a guild registers via ``/connect``. V1
backs it with an encrypted SQLite store; the boundary lets a KMS-backed impl
drop in later without touching callers.
"""
from __future__ import annotations
from typing import Protocol, runtime_checkable
@runtime_checkable
class SecretsPort(Protocol):
async def get(self, scope: str, key: str) -> str | None:
"""Decrypt and return one secret, or ``None`` if unset."""
...
async def set(self, scope: str, key: str, value: str) -> None:
"""Encrypt and persist one secret under ``scope``."""
...
async def delete(self, scope: str, key: str) -> None:
...