Build and Push / build (release) Successful in 1m28s
- Dashboard domain with Quick Links CRUD + reorder endpoints - Dashboard widgets management endpoints - Database migrations for quick_links and dashboard_widgets tables - Static file controller for Organizr widgets - Default local user when OIDC is disabled - Domain-based architecture refactor (src/domains/, src/shared/) - Test suite updated for new structure (285 tests passing) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
95 lines
2.1 KiB
Python
95 lines
2.1 KiB
Python
"""
|
|
Pydantic schemas for DNS lookup module
|
|
"""
|
|
from pydantic import Field
|
|
from typing import Optional, List
|
|
from datetime import datetime
|
|
from src.shared.base import BaseSchema
|
|
|
|
|
|
class DNSLookupRequest(BaseSchema):
|
|
"""Request model for DNS lookup"""
|
|
|
|
domain: str = Field(
|
|
...,
|
|
description="The domain name to lookup",
|
|
examples=["example.com", "google.com"],
|
|
min_length=1,
|
|
max_length=255
|
|
)
|
|
|
|
record_type: str = Field(
|
|
default="A",
|
|
description="DNS record type to query (A, AAAA, MX, TXT, CNAME, NS, SOA, PTR, CAA)",
|
|
examples=["A", "AAAA", "MX", "TXT", "CNAME"]
|
|
)
|
|
|
|
nameserver: Optional[str] = Field(
|
|
default=None,
|
|
description="Optional nameserver to use for the query (e.g., 8.8.8.8, 1.1.1.1)",
|
|
examples=["8.8.8.8", "1.1.1.1", "9.9.9.9"]
|
|
)
|
|
|
|
|
|
class DNSRecord(BaseSchema):
|
|
"""Single DNS record result"""
|
|
|
|
value: str = Field(
|
|
...,
|
|
description="The DNS record value"
|
|
)
|
|
|
|
ttl: Optional[int] = Field(
|
|
default=None,
|
|
description="Time to live in seconds"
|
|
)
|
|
|
|
priority: Optional[int] = Field(
|
|
default=None,
|
|
description="Priority (for MX records)"
|
|
)
|
|
|
|
|
|
class DNSLookupResponse(BaseSchema):
|
|
"""Response model for DNS lookup"""
|
|
|
|
domain: str = Field(
|
|
...,
|
|
description="The queried domain name"
|
|
)
|
|
|
|
record_type: str = Field(
|
|
...,
|
|
description="DNS record type queried"
|
|
)
|
|
|
|
records: List[DNSRecord] = Field(
|
|
...,
|
|
description="List of DNS records found"
|
|
)
|
|
|
|
nameserver_used: Optional[str] = Field(
|
|
default=None,
|
|
description="Nameserver used for the query"
|
|
)
|
|
|
|
query_time_ms: float = Field(
|
|
...,
|
|
description="Query execution time in milliseconds"
|
|
)
|
|
|
|
queried_at: datetime = Field(
|
|
...,
|
|
description="UTC timestamp when query was executed"
|
|
)
|
|
|
|
success: bool = Field(
|
|
...,
|
|
description="Whether the query was successful"
|
|
)
|
|
|
|
error_message: Optional[str] = Field(
|
|
default=None,
|
|
description="Error message if query failed"
|
|
)
|