-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Cookies: set samesite: Lax
by default
#8304
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
Changes from 4 commits
693551f
6eb5a8a
b77ca8c
2722fbf
ef72f26
1f3cc26
0de9386
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,14 +72,14 @@ and then click on :guilabel:`Search Analytics`. | |
API | ||
--- | ||
|
||
Search is exposed through our API that's proxied from the domain where your docs are being served. | ||
This is ``https://docs.readthedocs.io/_/api/v2/search`` for the ``docs`` project, for example. | ||
If you are using :doc:`/commercial/index` you will need to replace | ||
https://readthedocs.org/ with https://readthedocs.com/ in all the URLs used in the following examples. | ||
|
||
.. warning:: | ||
|
||
This API isn't stable yet, some small things may change in the future. | ||
|
||
.. http:get:: /_/api/v2/search/ | ||
.. http:get:: /api/v2/search/ | ||
|
||
Return a list of search results for a project, | ||
including results from its :doc:`/subprojects`. | ||
|
@@ -120,12 +120,12 @@ This is ``https://docs.readthedocs.io/_/api/v2/search`` for the ``docs`` project | |
|
||
.. code-tab:: bash | ||
|
||
$ curl "https://docs.readthedocs.io/_/api/v2/search/?project=docs&version=latest&q=server%20side%20search" | ||
$ curl "https://readthedocs.org/api/v2/search/?project=docs&version=latest&q=server%20side%20search" | ||
|
||
.. code-tab:: python | ||
|
||
import requests | ||
URL = 'https://docs.readthedocs.io/_/api/v2/search/' | ||
URL = 'https://readthedocs.org/api/v2/search/' | ||
params = { | ||
'q': 'server side search', | ||
'project': 'docs', | ||
|
@@ -140,7 +140,7 @@ This is ``https://docs.readthedocs.io/_/api/v2/search`` for the ``docs`` project | |
|
||
{ | ||
"count": 41, | ||
"next": "https://docs.readthedocs.io/api/v2/search/?page=2&project=read-the-docs&q=server+side+search&version=latest", | ||
"next": "https://readthedocs.org/api/v2/search/?page=2&project=read-the-docs&q=server+side+search&version=latest", | ||
"previous": null, | ||
"results": [ | ||
{ | ||
|
@@ -194,3 +194,7 @@ If you are using :ref:`private versions <versions:privacy levels>`, | |
users will only be allowed to search projects they have permissions over. | ||
Authentication and authorization is done using the current session, | ||
or any of the valid :doc:`sharing methods </commercial/sharing>`. | ||
|
||
Cookie sessions can be used only from the same domain as the API, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be explained more. What is the takeaway for a user? When should they use this URL instead? Presumably this should use a readthedocs.com example, where it's most necessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is under the "Authentication and authorization" section of this doc, the paragraph above explains this is for private versions. I have changed this paragraph to avoid mentioning cookies. |
||
we proxy the API on the domain where your docs are being served (``<you-docs-domain>/_/api/v2/search``) so you can use it. | ||
This is ``https://docs.readthedocs.io/_/api/v2/search`` for the ``docs`` project, for example. | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
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 should be under it's own section, probably
Read the Docs for Business Users
or similarThere 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 describing the API and examples, not sure if I follow about having another section
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.
Like, we need a section of the docs explaining the 2 different sites and endpoints (and auth, etc.), and then probably link to it from here for more detail.