Skip to content

Use the token provided in the settings for frontend issued requests #155

@jtpio

Description

@jtpio

Problem

Currently, if the frontend part of the jupyterlab-github extension is used only (like in JupyterLite), the token provided via the settings does not seem to be taken into account.

This is likely because the token is appended to the URL only if the proxy (server extension) is used, and the real GitHub request made from the server extension:

if (result === true) {
requestUrl = URLExt.join(this._serverSettings.baseUrl, 'github');
// add the access token if defined
if (this.accessToken) {
params['access_token'] = this.accessToken;
}
} else {
requestUrl = DEFAULT_GITHUB_API_URL;
}

In the following screencast we see there is no information about the provided token in the requests to the GitHub API:

jupyterlab-github-request-notoken.webm

Proposed Solution

It would be useful to allow for using the token also for requests made from the JupyterLab UI directly, in scenarios where the server extension is not installed.

Additional context

This can be tested using a JupyterLite deployment with jupyterlab-github installed, for example: https://jupyterlite.readthedocs.io/en/stable/_static/lab/index.html

cc @rpwagner since we were looking into this in-person yesterday at the Jupyter Open Studio Day in NYC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions