Skip to content
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

Deprecated method of passing the token to Github #80

Open
svenwanzenried opened this issue Jan 10, 2024 · 1 comment
Open

Deprecated method of passing the token to Github #80

svenwanzenried opened this issue Jan 10, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@svenwanzenried
Copy link

svenwanzenried commented Jan 10, 2024

By end of 2019 Github announced that they would deprecate the possibility to pass an access token as query parameter in the URL.
https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/#authenticating-using-query-parameters
It seems to me (from error messages) that alerthub is trying to do exactly that and is therefore not working.

Please consider changing the mechanism so the token gets passed as HTTP Authorization header: 'token $token'

@Ardakilic
Copy link
Owner

Hello, apologies for the huge late reply.

I've checked this issue specifically, and to utilize this, RSS feed emitter needs to get custom params so I can pass the token through the headers.

https://github.com/filipedeschamps/rss-feed-emitter/blob/6c7f3e40a63f5f02ed698b6778b2de038f2178d6/src/Feed.js#L172-L197

  /**
   * Perform the feed parsing
   * @private
   * @param  {FeedParser} feedparser feedparser instance to use for parsing a retrieved feed
   */
  get(feedparser) {
    request
      .get({
        url: this.url,
        headers: {
          'user-agent': this.userAgent,
          accept: ALLOWED_MIMES.join(','),
        },
      })
      .on('response', (res) => {
        if (res.statusCode !== RESPONSE_CODES.OK) {
          this.handleError(new FeedError(`This URL returned a ${res.statusCode} status code`, 'fetch_url_error', this.url));
        }
      })
      .on('error', () => {
        this.handleError(new FeedError(`Cannot connect to ${this.url}`, 'fetch_url_error', this.url));
      })
      .pipe(feedparser)
      .on('end', () => {});
  }

If you have alternatives to rss-feed-emitter, please feel free to let me know. Personally, just for this I don't want to maintain a fork, since you can get notifications from github directly (which was not the case when this project was born).

@Ardakilic Ardakilic added the help wanted Extra attention is needed label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants