question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RGH handles only one API Token

See original GitHub issue

Currently if you use RGH on a different domain and GitHub, as soon as you provide a token, the other site no longer works (as expected).

features.js:79 RefinedGitHubAPIError: The token seems to be incorrect or expired. Update it in the options.
    at call (chrome-extension://mnoacfgkaplmhhcgdnekddifjfcllloj/content.js:2481:11)
    at <anonymous>

We need to add the option to specify what URL the token is for and only use it for that domain. This becomes more important if #1713 is merged.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
fregantecommented, Jun 12, 2019

An alternative solution would be to extend webext-options-sync to have per-domain storage and we’d have automatic per-domain tabs (created by Refined GitHub) in the options.

This is actually kind of possible since webext-options-sync lets you change the storage key (currently stored as options in chrome.storage.sync), we just need to ensure that:

  • supported domains are automatically added to the options page
  • the form updates correctly when the domain tab is changed (perhaps by cloning the form and replacing it)
  • that migrations, defaults and any listeners work correctly and don’t just pile up when switching domain.

https://github.com/sindresorhus/refined-github/pull/2111 contains code useful to generate those tabs (i.e. “what additional domains do we have permission to?”)

2reactions
fregantecommented, May 18, 2019

The further we go, the more I think this extension needs to be installed once per domain:

  1. works with any number of Enterprise installations
  2. it can be updated when GHE updates, rather than trying to keep RGH working with all versions: https://github.com/sindresorhus/refined-github/issues?q=label%3Aenterprise+label%3Abug

Given that GHE gets features later than regular GitHub, I expect most new features to cause errors so it’s always best to wait.

Rather than adding a field, I’d rather see documentation explaining how to:

  • clone and build the extension locally, on a 1 month delay (e.g. HEAD@{ISO date 1 month ago})
  • change the URLs in manifest.json so it applies to your GHE URLs instead of github.com
  • merge in new changes from origin when the user wants to

Even better would be a cli tool that does this automatically, for any extension, like:

npx web-ext-custom-domain sindresorhus/refined-github github.com:github.mycompany.com --delay 30d

# roughly equivalent to
git clone https://github.com/"$1".git .
git checkout HEAD@"$delay"
npm install
npm run build
sed s/"$from_domain"/"$to_domain" distribution/manifest.json
dot-json distribution/manifest.json name "$name ($to_domain)"
Read more comments on GitHub >

github_iconTop Results From Across the Web

RGH handles only one API Token · Issue #1714 - GitHub
Currently if you use RGH on a different domain and GitHub, as soon as you provide a token, the other site no longer...
Read more >
Generating a new API token - Zendesk help
To generate an API token. In Admin Center, click Apps and integrations in the sidebar, then select APIs > Zendesk APIs. Click the...
Read more >
Set up API keys using the API Gateway console
To set up API keys, do the following: Configure API methods to require an API key. Create or import an API key for...
Read more >
Wolfgang Puck
Official site provides news, recipes, catering details, information on cookbooks, and links to the fine dining restaurants sponsored by Wolfgang Puck.
Read more >
rgh my care
Rgh My CareIn 1928, a group of physicians purchased the hospital and ... is here to help you access My Care Account Rochester...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found