add InstanceUpdate model to support optional secret updates

This commit is contained in:
CPTN Cosmo 2026-04-18 17:20:35 +02:00
parent 2e160cdd14
commit d018a497aa

View file

@ -232,6 +232,12 @@ class InstanceCreate(BaseModel):
port: int = 4646 port: int = 4646
secret: str secret: str
class InstanceUpdate(BaseModel):
name: str
ip: str
port: int = 4646
secret: Optional[str] = None
def clean_secret(secret_input): def clean_secret(secret_input):
secret_clean = secret_input.strip() secret_clean = secret_input.strip()
if secret_clean.lower().startswith('otpauth://'): if secret_clean.lower().startswith('otpauth://'):