Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Embed APIv3: initial implementation #8319
Embed APIv3: initial implementation #8319
Changes from 10 commits
61554ac
311ada4
76d0bf5
e841b98
78f6656
fe3a507
28e4e83
71b9e2d
1aa70e3
5bab780
59fe0f1
517d3e8
562c260
73e2ee3
854a44b
49e02d5
be32bd3
cc2227c
1a72c07
7b6b493
418d9ac
8a77043
d9ca50e
3be9b8e
a27122a
84c3d18
7adccb2
a1cf45a
ec2fd5f
f05da3f
7f3e3a9
bcfba37
905cbcf
b0dc81f
9810f89
05936d3
333c892
c4751c7
7dd4b4f
d134ab9
4b5f2d6
0056e90
cf3da8a
aeaad76
ef5a14c
160e51b
cc76893
5e25c47
7edb272
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this is reimplementing
readthedocs.org/readthedocs/search/parsers.py
Line 64 in b3baa7a
I'd like to find a way to have both of these codebases using similar abstractions, instead of reinventing the same logic over again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I mainly copied&pasted this from there. We can probably move this to a utils function somewhere and use the same in both places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we not doing any auth here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for now. Do we need auth at all? We are giving users to access only public internal projects (from inside
_get_page_content_from_storage
method) or public webpages on the internet.I remember thinking about this and not finding a good and safe way to support private projects with session auth. Do we want other type of auth for this? If this is the case, we will need to consider auth only for internal projects.
I thought it was safer, for now, to start only with public documents and grow from there if we require auth/private documents in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we need to support this on .com, so we definitely need to figure out auth I think. I'd imagine it would be with session auth for the same domain, and explicit API key auth cross-domain, as we discussed previously?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be implemented in corporate repository by overriding the class and the
permission_classes
field with a custom class that make these checks. Makes sense to you?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, seems reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird logic. It seems to depend on an implicit
request.GET
? I feel like we should make this a direct function call, or something else more explicit.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this is weird. It does not depend on an implicit
request.GET
attribute, tho. It's using a "hidden feature" of theunresolver
:readthedocs.org/readthedocs/core/unresolver.py
Lines 56 to 57 in c098df8
that returns
None
when there is no project found in our database with that domain.