Skip to content

Prepare for authenticated media freeze #17433

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

Merged
merged 8 commits into from
Jul 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions synapse/config/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
remote_media_lifetime
)

self.authenticate_new_media = config.get("authenticate_new_media", False)
self.enforce_authenticated_media = config.get(
"enforce_authenticated_media", False
Copy link
Contributor Author

@H-Shay H-Shay Jul 11, 2024

Choose a reason for hiding this comment

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

Two questions:

  1. Should this be one config option? Something like enable_authenticated_media?
  2. Should this option be documented in the config manual, since we are going to switch it on default and strongly encourage it's use - perhaps documenting it will make it seem more optional than we'd like?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think documenting any config option (except experimental ones) is worth doing, even if you discourage changing it and outline the plans for the default value of the option. May also be worth saying when the option is expected to be removed (which I imagine we will do?)

Copy link
Member

Choose a reason for hiding this comment

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

Yup, agreed. I'm sure there will be some people that will need to fiddle with the config options (e.g. those using custom clients), so having them documented would be good.

Copy link
Member

Choose a reason for hiding this comment

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

  1. Should this be one config option? Something like enable_authenticated_media?

I'm in two minds a bit here. Having two gives us more flexibility, but not actually sure of the use case. The only thing that comes to mind is if we change the defaults at different times, but then I think we wouldn't want to do that at all.

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 also went back and forth about making it one config option, and I think in the end it makes slightly more sense to make it one, essentially for the reasons you listed - I couldn't really think of a case where the two would be set independently of each other. I am going to switch it to one - this will also make documentation clearer. If anyone comes up with a reason to switch it back let me know...

)

def generate_config_section(self, data_dir_path: str, **kwargs: Any) -> str:
assert data_dir_path is not None
media_store = os.path.join(data_dir_path, "media_store")
Expand Down