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:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user