Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First draft of AS filters #1300

Closed
wants to merge 2 commits into from

Conversation

Half-Shot
Copy link
Contributor

@Half-Shot Half-Shot commented Jun 13, 2018

I consider this change small and niche enough that it probably doesn't warrant a gdoc, but happy to create if needed.

Fixes matrix-org/matrix-spec#301

-- Proposal created as #3806 --

.. NOTE::
Please note the filter options in the registration object above. Homeservers
should exclude traffic based on the filters. Filters are always off by default
so do not exclude traffic unless the option is explicitly set.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Filters should be disabled by default." is good enough here I think.

exclude_virtual_users: <bool> # This will exclude traffic from virtual users being
# recieved on the AS.
exclude_as_user: <bool> # This will exclude traffic from the AS user
# being recieved on the AS.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:^)

@@ -104,6 +104,11 @@ traffic to the AS is:
- ...
aliases: [] # Namespaces of room aliases which should be delegated to the AS
rooms: [] # Namespaces of room ids which should be delegated to the AS
filter:
exclude_virtual_users: <bool> # This will exclude traffic from virtual users being
# recieved on the AS.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

received*

@@ -143,6 +148,15 @@ be made without blocking other aspects of the homeserver. Homeservers MUST NOT
alter (e.g. add more) events they were going to send within that transaction ID
on retries, as the AS may have already processed the events.

.. NOTE::
Please note the filter options in the registration object above. Homeservers
should exclude traffic based on the filters. Filters are always off by default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Homeservers should exclude traffic to each application service based on the filters they have set." to explicitly say it's on a per-appservice basis?

should exclude traffic based on the filters. Filters are always off by default
so do not exclude traffic unless the option is explicitly set.

Additionally the filters are within the context of the transaction API, the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the transaction API. The"

so do not exclude traffic unless the option is explicitly set.

Additionally the filters are within the context of the transaction API, the
Client Server API must continue to show events that may be excluded by the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Client Server API must continue to show events that would otherwise be excluded by the filter."

Also do we always do "MUST" instead of "must" or?

@@ -104,6 +104,11 @@ traffic to the AS is:
- ...
aliases: [] # Namespaces of room aliases which should be delegated to the AS
rooms: [] # Namespaces of room ids which should be delegated to the AS
filter:
exclude_virtual_users: <bool> # This will exclude traffic from virtual users being
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the first introduction (that I can see while skimming) for 'virtual'. As a suggestion, maybe have this be moved under the individual user namespaces as an echo flag or similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like namespaces was literally intended for namespacing regexes rather than filtering and would confuse things more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as naming goes, unsure :s

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use case for putting it under namespaces: disabling echo for one namespace, but not another. I'm not sure why you'd do this, but it feels wrong to exclude the option.

filter:
exclude_virtual_users: <bool> # This will exclude traffic from virtual users being
# recieved on the AS.
exclude_as_user: <bool> # This will exclude traffic from the AS user
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend making this include_as_user given the default is false (and to avoid double negatives). Also, the comment should explain that this is the sender_localpart given this is the first introduction of an "AS user".

@Half-Shot
Copy link
Contributor Author

Because Github has hidden it, I'm still unsure what would make a good substitute for virtual users? Or I could just describe them.

@maxidorius
Copy link
Contributor

This is purely synapse's implementation stuff - why is it even in here?

@jcgruenhage
Copy link
Contributor

@maxidor While the registration file is currently an example only, I think there definitely is worth in speccing it as a proper thing,so that registration files can be used cross HS. A lot of ASs generate registration files for you, and it would be a shame if those generated files wouldn't work on MXHSD or Dendrite (or whatever new HS), right?

@turt2live
Copy link
Member

Or I could just describe them.

@Half-Shot this option is my preference, although the existing spec uses the term "masqueraded user", so maybe continue using that somehow?

@Half-Shot
Copy link
Contributor Author

FYI, #3806 includes the proposal.

@turt2live
Copy link
Member

I'm going to close this while we're waiting for the MSC to go through.

@turt2live turt2live closed this Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AppServices: Registration option for disallowing AS user events being sent back to the AS
5 participants