Page MenuHomePhabricator

Define schema for a User-block event
Closed, ResolvedPublic

Description

In the spirit of the revision visibility set event, I propose the following strawman schema for generating events pertaining to user blocks:

title: MediaWiki User Block
description: Represents a MW User Block event
$schema: http://json-schema.org/draft-04/schema#
type: object
  # standard meta sub-object elided
  meta:
    type: object
    properties: ...
  # event specific fields
  user_blocked:
    type: string
    description: the user name or IP address being blocked
  # not required; results in an indefinite block if omitted
  expiry:
    type: string
    description: the timestamp the block expires
  blocks:
    type: object
    properties:
      name:
        type: boolean
        description: whether the name or IP should be suppressed (hidden)
      email:
        type: boolean
        description: whether email sending should be blocked
      user_talk:
        type: boolean
        description: whether the user should be prevented from editing their own talk page
      account_create:
        type: boolean
        description: whether to block account creation from the user or IP
  reason:
    type: string
    description: the reason for creating the block
  user_id:
    type: integer
    description: the user that performed the block
  user_text:
    type: string
    description: the text representation of the user performing the block
required:
  - user_blocked
  - blocks

This event would be sent for newly added blocks, updates to existing blocks, and block removals; Similar to the the revision visibility set event, the boolean attributes of blocks would describe the desired total block state at the time of the event.

Commence bikeshedding!

See:

Event Timeline

Eevans created this task.Dec 21 2015, 8:48 PM
Eevans raised the priority of this task from to Normal.
Eevans updated the task description. (Show Details)
Eevans added subscribers: Aklapper, Eevans, StudiesWorld.
Eevans renamed this task from Define schema for a 'user block' event to Define schema for a User-block event.Dec 21 2015, 8:52 PM
Eevans set Security to None.

LGTM +1. Let's go ahead and implement this schema.

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptApr 19 2016, 4:44 PM
mobrovac raised the priority of this task from Normal to High.Apr 19 2016, 4:44 PM

Change 284234 had a related patch set uploaded (by Ppchelko):
Define schema for user_block event.

https://gerrit.wikimedia.org/r/284234

Is this the only user-related action that is sent through the eventbus? If so, you could reduce the scope to only what affects content-- only send these when the user is blocked with username suppression.

But I defer to you on services for what is best-- I haven't kept up with the long term plans for the event bus.

@csteipp Right now it is an only user-related action, but we'd better send a full event. By design of the EventBus+Change-Propagation, matching the predicates like 'only when the username was suppressed' is the job for change propagation, not the MW extension.

Change 284234 merged by Mobrovac:
Define schema for user_block event.

https://gerrit.wikimedia.org/r/284234

The schema was merged, but I'm not sure how's topic creation handled nowadays. @Ottomata do we need to do any extra steps so that the new topic config is picked up by eventlogging-service and vagrant?

Is this the only user-related action that is sent through the eventbus? If so, you could reduce the scope to only what affects content-- only send these when the user is blocked with username suppression.

Indeed, but my hope is that T84962: Authn and authz as a service will see the light of day at some point, and having complete information about the block can reduce the overall complexity of the dependent services.

Change 284377 had a related patch set uploaded (by Mobrovac):
Update the schemas to include the user_block schema as well

https://gerrit.wikimedia.org/r/284377

The schema was merged, but I'm not sure how's topic creation handled nowadays. @Ottomata do we need to do any extra steps so that the new topic config is picked up by eventlogging-service and vagrant?

After PS 284377 is merged, a deploy of the HTTP proxy service will be needed, so assigning to @Ottomata. For MediaWiki-Vagrant, a vagrant git-update will be needed.

Change 284377 merged by Ottomata:
Update the schemas to include the user_block and retry schemas as well

https://gerrit.wikimedia.org/r/284377

mobrovac removed a subscriber: gerritbot.

@Ottomata don't forget to deploy the code before resolving this :P

Pchelolo closed this task as Resolved.Apr 26 2016, 11:09 PM

user_block event is life, resolving.