openid / sharedsignals

OpenID Shared Signals Working Group Repository
45 stars 11 forks source link

How should overlapping subjects be handled? #64

Closed FragLegs closed 11 months ago

FragLegs commented 1 year ago

When a Receiver adds a subject to a stream, it means that events that match that subject should get delivered on the stream. For most SimpleSubjects, this is an unambiguous mapping. But for Aliases and ComplexSubjects, things are a little less clear. What should happen if the values in the Aliases simple subject or in the ComplexSubject overlap? Here are some examples:

example 1 - overlapping Aliases

  1. Receiver adds:
    {
    "format": "aliases",
    "identifiers": {
    {
      "format": "email",
      "email": "user@example.com"
    },
    {
      "format": "phone_number",
      "phone_number": "+12065550100"
    }
    }
  2. Receiver adds
    {
    "format": "aliases",
    "identifiers": {
    {
      "format": "email",
      "email": "user@example.com"
    },
    {
      "format": "opaque",
      "id": "12345"
    }
    }

    When the Transmitter wants to broadcast an event whose subject is

    {
    "format": "email",
    "email": "user@example.com"
    }

    should it be sent to the Receiver twice?

example 2 - overlapping ComplexSubjects

  1. Receiver adds:
    {
    "user": {
      "format": "email",
      "email": "user@example.com"
    },
    "device": {
      "format": "opaque",
      "id": "12345"
    }
    }
  2. Receiver adds
    {
    "user": {
      "format": "email",
      "email": "user@example.com"
    },
    }

    When the Transmitter wants to broadcast an event whose subject is

    {
    "format": "email",
    "email": "user@example.com"
    }

    should it be sent to the Receiver twice?

tulshi commented 1 year ago

I remember discussing this issue, but I don't remember the outcome. I can't find anything in the notes either. @FragLegs can you please update the issue if you remember any previous discussion?

FragLegs commented 1 year ago

We talked about the issue of incomplete Complex Subjects, which has been addressed in PR #57 . I don't think we've talked about the issue of overlapping subjects yet though.

tulshi commented 11 months ago

I'm closing this issue based on your comment. If you think it still needs work, please reopen.