"""Shared credential schemas for Forgejo nodes."""

from typing import ClassVar

from flowire_sdk import CredentialField
from pydantic import BaseModel


class ForgejoCredentialSchema(BaseModel):
    """Credential schema for Forgejo API authentication.

    Shared across all Forgejo nodes in this package.
    """

    credential_name: ClassVar[str] = "Forgejo"
    credential_description: ClassVar[str] = "Forgejo server URL and API token"
    credential_icon: ClassVar[str | None] = "git-fork"

    server_url: str = CredentialField(
        ...,
        secret=False,
        description="Forgejo server URL (e.g., https://forgejo.example.com)",
    )
    api_token: str = CredentialField(
        ...,
        description="API token (Settings → Applications → Generate New Token)",
    )
