SecretService
class SecretService()Project secret namespace.
SecretService.__init__
def __init__(impl: AsyncSecretService, bridge: SyncBridge) -> NoneSecretService.delete
def delete(name: str) -> NoneDelete a secret.
SecretService.get
def get(name: str) -> SecretFetch one secret's metadata (never its value).
SecretService.iter
def iter(*,
cursor: Optional[str] = None,
limit: Optional[int] = None) -> Iterator[Secret]SecretService.list
def list(*,
cursor: Optional[str] = None,
limit: Optional[int] = None) -> ListResult[Secret]List secret metadata.
SecretService.set
def set(name: str,
value: str,
*,
allowed_domains: Sequence[str],
description: Optional[str] = None,
if_not_exists: bool = False) -> SecretCreate or update a write-only secret.
AsyncSecretService
class AsyncSecretService()Project secret namespace.
Project-scoped secrets: named key/value pairs stored
encrypted in the project. Attach one or more to a sandbox at creation via
the secrets create parameter (a list of names). Attached secrets are
available to outbound HTTPS requests to their allowed domains, not plain
HTTP requests. Their values never enter the sandbox and are never returned
by the API (write-only).
AsyncSecretService.__init__
def __init__(transport: AsyncTransport) -> NoneAsyncSecretService.list
async def list(*,
cursor: Optional[str] = None,
limit: Optional[int] = None) -> ListResult[Secret]List secret metadata.
AsyncSecretService.iter
async def iter(*,
cursor: Optional[str] = None,
limit: Optional[int] = None) -> AsyncIterator[Secret]AsyncSecretService.get
async def get(name: str) -> SecretFetch one secret's metadata (never its value).
AsyncSecretService.set
async def set(name: str,
value: str,
*,
allowed_domains: Sequence[str],
description: Optional[str] = None,
if_not_exists: bool = False) -> SecretCreate or update a write-only secret.
allowed_domains: The hosts where this secret's value may be sent
(exact or *. wildcard), or ["*"] for any verified host.
"*" lets the value reach any HTTPS host, including one a
compromised sandbox controls.
AsyncSecretService.delete
async def delete(name: str) -> NoneDelete a secret.
Secret
class Secret(BaseModel)Secret metadata. The value is write-only.
Attributes:
allowed_domainsList[StrictStr] = Field(description='The hosts the secret\'s value may be sent to.["*"]means any host the platform has verified; an empty list means the secret is sent nowhere.')created_atdatetime = Field(description='When the secret was created.')descriptionOptional[StrictStr] = Field(default=None, description='The user-facing description, or null when absent.')nameStrictStr = Field(description='The secret name.')updated_atdatetime = Field(description='When the secret was last updated.')additional_propertiesDict[str, Any] = {}
model_config
model_config = ConfigDict(populate_by_name=True, validate_assignment=True, protected_namespaces=())Secret.to_str
def to_str() -> strReturns the string representation of the model using alias
Secret.to_json
def to_json() -> strReturns the JSON representation of the model using alias
Secret.from_json
@classmethod
def from_json(json_str: str) -> Optional[Self]Create an instance of Secret from a JSON string
Secret.to_dict
def to_dict() -> Dict[str, Any]Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
self.model_dump(by_alias=True):
Noneis only added to the output dict for nullable fields that were set at model initialization. Other fields with valueNoneare ignored.- Fields in
self.additional_propertiesare added to the output dict.
Secret.from_dict
@classmethod
def from_dict(obj: Optional[Dict[str, Any]]) -> Optional[Self]Create an instance of Secret from a dict