Skip to content

Document connected account permissions #6172

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 2 commits into from
Sep 26, 2019
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
63 changes: 62 additions & 1 deletion docs/connected-accounts.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Connecting Your Account
-----------------------
=======================

If you are going to import repositories from GitHub, Bitbucket, or GitLab,
you should connect your Read the Docs account to your repository host first.
Expand All @@ -18,3 +18,64 @@ and select `Connected Services <https://readthedocs.org/accounts/social/connecti
From here, you'll be able to connect to your GitHub, Bitbucket or GitLab
account. This process will ask you to authorize a connection to Read the Docs,
that allows us to read information about and clone your repositories.


Permissions for connected accounts
----------------------------------

Read the Docs does **not** ask for write permission to your repositories' code
and since we only connect to public repositories we don't need special permissions to read them.
However, we do need permissions for authorizing your account
so that you can login to Read the Docs with your connected account credentials
and to setup :doc:`webhooks`
which allow us to build your documentation on every change to your repository.
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, the commercial side does ask for admin (and therefore write) permissions, as this is the lowest granularity that GitHub has/had in order to add private ssh keys. Moving to a GitHub App instead does probably give us finer permission control, if i remember correctly.



GitHub
~~~~~~

Read the Docs requests the following permissions (more precisely, `OAuth scopes`_)
when connecting your Read the Docs account to GitHub.

.. _OAuth scopes: https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/

Read access to your email address (``user:email``)
We ask for this so you can create a Read the Docs account and login with your GitHub credentials.

Administering webhooks (``admin:repo_hook``)
We ask for this so we can create webhooks on your repositories when you import them into Read the Docs.
This allows us to build the docs when you push new commits.

Read access to your organizations (``read:org``)
We ask for this so we know which organizations you have access to.
This allows you to filter repositories by organization when importing repositories.

Repository status (``repo:status``)
Repository statuses allow Read the Docs to report the status
(eg. passed, failed, pending) of pull requests to GitHub.
This is used for a feature currently in beta testing
that builds documentation on each pull request similar to a continuous integration service.

.. note::

:doc:`Read the Docs for Business </commercial/index>`
asks for one additional permission (``repo``) to allow access to private repositories
and to allow us to setup SSH keys to clone your private repositories.

Bitbucket
~~~~~~~~~

For similar reasons to those above for GitHub, we request permissions for:

* Reading your account information including your email address
* Read access to your team memberships
* Read access to your repositories
* Read and write access to webhooks

GitLab
~~~~~~

Like the others, we request permissions for:

* Reading your account information (``read_user``)
* API access (``api``) which is needed to create webhooks in GitLab