You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# We force all storage calls to use internal versions
# unless explicitly set to external.
version_type=INTERNAL
This is to prevent serving from external versions on non-external domains and vice versa, but I think this check should be done by the caller, this is using the right manager to search for external or normal versions.
In recent proxito refactors, I added these checks in several places, so setting this attribute manually shouldn't be required
# We force all storage calls to use the external versions storage,
# since we are serving an external version.
# The version that results from the unresolve_path() call already is
# validated to use the correct manager, this is here to add defense in
# depth against serving the wrong version.
ifunresolved_domain.is_from_external_domain:
self.version_type=EXTERNAL
Adding this double layer of protection seems good, but is also kind of easy to miss changing that attribute to external and still ending exposing internal versions from external domains. And it's also kind of confusing when the version doesn't match the self.version_type attribute (usually because we forgot to change the attribute to match the current version being served).
Just a thought, if we are okay with that double check we can close this issue.
The text was updated successfully, but these errors were encountered:
We have a version type attribute that all calls to storage must use.
readthedocs.org/readthedocs/proxito/views/mixins.py
Lines 46 to 48 in 9cfb649
This is to prevent serving from external versions on non-external domains and vice versa, but I think this check should be done by the caller, this is using the right manager to search for external or normal versions.
In recent proxito refactors, I added these checks in several places, so setting this attribute manually shouldn't be required
readthedocs.org/readthedocs/proxito/views/serve.py
Lines 737 to 743 in 9cfb649
Adding this double layer of protection seems good, but is also kind of easy to miss changing that attribute to external and still ending exposing internal versions from external domains. And it's also kind of confusing when the version doesn't match the
self.version_type
attribute (usually because we forgot to change the attribute to match the current version being served).Just a thought, if we are okay with that double check we can close this issue.
The text was updated successfully, but these errors were encountered: