{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Authorization for an aggregator to post to a community with specific configuration. Published in the community's repository by moderators. The record key MUST be the authorized aggregator's DID, guaranteeing at most one authorization per (community, aggregator) pair. Similar to social.coves.actor.subscription.",
      "key": "any",
      "record": {
        "properties": {
          "aggregatorDid": {
            "description": "DID of the authorized aggregator",
            "format": "did",
            "type": "string"
          },
          "communityDid": {
            "description": "DID of the community granting access (must match repo DID)",
            "format": "did",
            "type": "string"
          },
          "config": {
            "description": "Aggregator-specific configuration. Must conform to the aggregator's configSchema.",
            "type": "unknown"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "createdBy": {
            "description": "DID of moderator who authorized this aggregator",
            "format": "did",
            "type": "string"
          },
          "disabledAt": {
            "description": "When this authorization was disabled (if enabled=false)",
            "format": "datetime",
            "type": "string"
          },
          "disabledBy": {
            "description": "DID of moderator who disabled this aggregator",
            "format": "did",
            "type": "string"
          },
          "enabled": {
            "description": "Whether this aggregator is currently active. Can be toggled without deleting the record.",
            "type": "boolean"
          }
        },
        "required": [
          "aggregatorDid",
          "communityDid",
          "enabled",
          "createdAt",
          "createdBy"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "social.coves.aggregator.authorization",
  "lexicon": 1
}
