|
55 | 55 | description: Processing queue status and monitoring |
56 | 56 | - name: Admin |
57 | 57 | description: Administrative endpoints (requires bearer token authentication) |
| 58 | + - name: Denylist |
| 59 | + description: Denylist management endpoints — block specific entity IDs from being served |
58 | 60 | paths: |
59 | 61 | /status: |
60 | 62 | get: |
@@ -374,6 +376,129 @@ paths: |
374 | 376 | application/json: |
375 | 377 | schema: |
376 | 378 | $ref: '#/components/schemas/Error' |
| 379 | + /denylist: |
| 380 | + get: |
| 381 | + tags: |
| 382 | + - Denylist |
| 383 | + summary: Get all denylist entries |
| 384 | + description: | |
| 385 | + Returns all entity IDs currently in the denylist. This endpoint is public and requires no authentication. |
| 386 | + operationId: getDenylist |
| 387 | + security: [] |
| 388 | + responses: |
| 389 | + '200': |
| 390 | + description: List of denylist entries |
| 391 | + content: |
| 392 | + application/json: |
| 393 | + schema: |
| 394 | + type: array |
| 395 | + items: |
| 396 | + $ref: '#/components/schemas/DenylistEntry' |
| 397 | + /denylist/{entityId}: |
| 398 | + post: |
| 399 | + tags: |
| 400 | + - Denylist |
| 401 | + summary: Add or update a denylist entry |
| 402 | + description: | |
| 403 | + Adds an entity ID to the denylist or updates an existing entry. Requires a valid signed fetch |
| 404 | + from an address listed in the `dapps-platform_user_moderators` feature flag. |
| 405 | +
|
| 406 | + If the entity is already in the denylist, its `reason` and `updated_at` fields are updated |
| 407 | + but `created_by` is preserved from the original entry. |
| 408 | + operationId: addDenylistEntry |
| 409 | + security: |
| 410 | + - SignedFetch: [] |
| 411 | + parameters: |
| 412 | + - name: entityId |
| 413 | + in: path |
| 414 | + required: true |
| 415 | + schema: |
| 416 | + type: string |
| 417 | + description: Entity ID (e.g. a Catalyst CID) to add to the denylist |
| 418 | + requestBody: |
| 419 | + required: false |
| 420 | + content: |
| 421 | + application/json: |
| 422 | + schema: |
| 423 | + type: object |
| 424 | + properties: |
| 425 | + reason: |
| 426 | + type: string |
| 427 | + nullable: true |
| 428 | + description: Optional human-readable reason for denylisting this entity |
| 429 | + responses: |
| 430 | + '201': |
| 431 | + description: Entry created or updated |
| 432 | + content: |
| 433 | + application/json: |
| 434 | + schema: |
| 435 | + $ref: '#/components/schemas/DenylistEntry' |
| 436 | + '400': |
| 437 | + description: Bad request — entity ID is missing |
| 438 | + content: |
| 439 | + application/json: |
| 440 | + schema: |
| 441 | + $ref: '#/components/schemas/OperationResult' |
| 442 | + '401': |
| 443 | + description: Unauthorized — invalid or missing signed fetch |
| 444 | + content: |
| 445 | + application/json: |
| 446 | + schema: |
| 447 | + $ref: '#/components/schemas/Error' |
| 448 | + '403': |
| 449 | + description: Forbidden — signer is not an authorized moderator |
| 450 | + content: |
| 451 | + application/json: |
| 452 | + schema: |
| 453 | + $ref: '#/components/schemas/OperationResult' |
| 454 | + delete: |
| 455 | + tags: |
| 456 | + - Denylist |
| 457 | + summary: Remove a denylist entry |
| 458 | + description: | |
| 459 | + Removes an entity ID from the denylist. Requires a valid signed fetch from an address |
| 460 | + listed in the `dapps-platform_user_moderators` feature flag. |
| 461 | + operationId: removeDenylistEntry |
| 462 | + security: |
| 463 | + - SignedFetch: [] |
| 464 | + parameters: |
| 465 | + - name: entityId |
| 466 | + in: path |
| 467 | + required: true |
| 468 | + schema: |
| 469 | + type: string |
| 470 | + description: Entity ID to remove from the denylist |
| 471 | + responses: |
| 472 | + '200': |
| 473 | + description: Entry successfully removed |
| 474 | + content: |
| 475 | + application/json: |
| 476 | + schema: |
| 477 | + $ref: '#/components/schemas/OperationResult' |
| 478 | + '400': |
| 479 | + description: Bad request — entity ID is missing |
| 480 | + content: |
| 481 | + application/json: |
| 482 | + schema: |
| 483 | + $ref: '#/components/schemas/OperationResult' |
| 484 | + '401': |
| 485 | + description: Unauthorized — invalid or missing signed fetch |
| 486 | + content: |
| 487 | + application/json: |
| 488 | + schema: |
| 489 | + $ref: '#/components/schemas/Error' |
| 490 | + '403': |
| 491 | + description: Forbidden — signer is not an authorized moderator |
| 492 | + content: |
| 493 | + application/json: |
| 494 | + schema: |
| 495 | + $ref: '#/components/schemas/OperationResult' |
| 496 | + '404': |
| 497 | + description: Entity ID not found in the denylist |
| 498 | + content: |
| 499 | + application/json: |
| 500 | + schema: |
| 501 | + $ref: '#/components/schemas/OperationResult' |
377 | 502 | /flush-cache: |
378 | 503 | delete: |
379 | 504 | tags: |
@@ -796,6 +921,43 @@ components: |
796 | 921 | required: |
797 | 922 | - ok |
798 | 923 | - message |
| 924 | + DenylistEntry: |
| 925 | + type: object |
| 926 | + description: A single entry in the denylist, representing a blocked entity |
| 927 | + properties: |
| 928 | + entity_id: |
| 929 | + type: string |
| 930 | + description: Lowercase entity ID (Catalyst CID) that is blocked |
| 931 | + reason: |
| 932 | + type: string |
| 933 | + nullable: true |
| 934 | + description: Optional human-readable reason why this entity was denylisted |
| 935 | + created_by: |
| 936 | + type: string |
| 937 | + description: Lowercase Ethereum address of the moderator who first added the entry |
| 938 | + created_at: |
| 939 | + type: number |
| 940 | + description: Unix timestamp in milliseconds when the entry was created |
| 941 | + updated_at: |
| 942 | + type: number |
| 943 | + description: Unix timestamp in milliseconds when the entry was last updated |
| 944 | + required: |
| 945 | + - entity_id |
| 946 | + - created_by |
| 947 | + - created_at |
| 948 | + - updated_at |
| 949 | + OperationResult: |
| 950 | + type: object |
| 951 | + description: Generic result for mutating operations |
| 952 | + properties: |
| 953 | + ok: |
| 954 | + type: boolean |
| 955 | + description: Whether the operation succeeded |
| 956 | + message: |
| 957 | + type: string |
| 958 | + description: Optional human-readable message |
| 959 | + required: |
| 960 | + - ok |
799 | 961 | Error: |
800 | 962 | type: object |
801 | 963 | properties: |
|
0 commit comments