Azure ClientSecretCredential support (#3456)

Co-authored-by: Suchintan <suchintan@users.noreply.github.com>
Co-authored-by: Shuchang Zheng <wintonzheng0325@gmail.com>
This commit is contained in:
stenn930
2025-09-23 10:16:48 -06:00
committed by GitHub
parent 10fac9bad0
commit a29a2bc49b
12 changed files with 592 additions and 71 deletions

View File

@@ -21,16 +21,31 @@ class Organization(BaseModel):
modified_at: datetime
class OrganizationAuthToken(BaseModel):
class OrganizationAuthTokenBase(BaseModel):
id: str
organization_id: str
token_type: OrganizationAuthTokenType
token: str
valid: bool
created_at: datetime
modified_at: datetime
class OrganizationAuthToken(OrganizationAuthTokenBase):
token: str
class AzureClientSecretCredential(BaseModel):
tenant_id: str
client_id: str
client_secret: str
class AzureOrganizationAuthToken(OrganizationAuthTokenBase):
"""Represents OrganizationAuthToken for Azure; defined by 3 fields: tenant_id, client_id, and client_secret"""
credential: AzureClientSecretCredential
class CreateOnePasswordTokenRequest(BaseModel):
"""Request model for creating or updating a 1Password service account token."""
@@ -50,6 +65,21 @@ class CreateOnePasswordTokenResponse(BaseModel):
)
class AzureClientSecretCredentialResponse(BaseModel):
"""Response model for Azure ClientSecretCredential operations."""
token: AzureOrganizationAuthToken = Field(
...,
description="The created or updated Azure ClientSecretCredential",
)
class CreateAzureClientSecretCredentialRequest(BaseModel):
"""Request model for creating or updating an Azure ClientSecretCredential."""
credential: AzureClientSecretCredential
class GetOrganizationsResponse(BaseModel):
organizations: list[Organization]