Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions src/vaultwarden/models/bitwarden.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,36 @@ class Config:
type: int


class IdentityData(BitwardenBaseModel):
class Config:
extra = "forbid"

middleName: str | None = None
address1: str | None = None
address2: str | None = None
city: str | None = None
state: str | None = None
postalCode: str | None = None
country: str | None = None
company: str | None = None
email: str | None = None
phone: str | None = None
ssn: str | None = None
nationality: str | None = None
citizenId: str | None = None
licenseNumber: str | None = None
passportNumber: str | None = None


class SshKeyData(BitwardenBaseModel):
class Config:
extra = "forbid"

keyFingerprint: Annotated[str, WrapValidator(decode_string)] | None = None
privateKey: Annotated[str, WrapValidator(decode_string)] | None = None
publicKey: Annotated[str, WrapValidator(decode_string)] | None = None


class Attachment(BitwardenBaseModel):
class Config:
extra = "forbid"
Expand Down Expand Up @@ -220,8 +250,11 @@ class Config:
notes: Annotated[str, WrapValidator(decode_string)] | None = None
reprompt: int
revisionDate: str
sshKey: str | None
sshKey: SshKeyData | None = None
passwordHistory: list[PasswordChange]
bankAccount: dict | None = None
driversLicense: dict | None = None
passport: dict | None = None
object: str | None = None
attachments: list[Attachment] | None = None

Expand Down Expand Up @@ -331,11 +364,22 @@ class Identity(_CipherBase):
card: None = None
identity: None = None

data: IdentityData | None = None


class SshKeyCipher(_CipherBase):
Type: Literal[CipherType.SshKey]

login: None = None
secureNote: None = None
card: None = None
identity: None = None

data: None = None


CipherDetails = Annotated[
Union[Login, SecureNote, Card, Identity], Field(discriminator="Type")
Union[Login, SecureNote, Card, Identity, SshKeyCipher], Field(discriminator="Type")
]


Expand Down
1 change: 1 addition & 0 deletions src/vaultwarden/models/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class CipherType(IntEnum):
SecureNote = 2
Card = 3
Identity = 4
SshKey = 5


class VaultwardenUserStatus(IntEnum):
Expand Down