Skip to content

Don't pass access_token as query parameter #11

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

Closed
4 tasks done
Totktonada opened this issue Nov 8, 2021 · 2 comments · Fixed by #12
Closed
4 tasks done

Don't pass access_token as query parameter #11

Totktonada opened this issue Nov 8, 2021 · 2 comments · Fixed by #12
Assignees
Labels
bug Something isn't working

Comments

@Totktonada
Copy link
Member

Totktonada commented Nov 8, 2021

https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/

  • Use the Authorization header instead (@Totktonada).
  • Deploy the update (@artembo).
  • Create a list of commits that were not processed (tarantool and vshard) (@Totktonada).
  • Redeliver corresponding payloads or create issues manually (@Totktonada).
@Totktonada Totktonada added the bug Something isn't working label Nov 8, 2021
Totktonada added a commit that referenced this issue Nov 8, 2021
This way we'll see a problem in GitHub's UI, where delivered and failed
webhook payloads are shown. Before this change the payload was marked as
successfully delivered and only message like 'Created issue: 400' is
shown in logs on Heroku.

Part of #11
Totktonada added a commit that referenced this issue Nov 8, 2021
Totktonada added a commit that referenced this issue Nov 8, 2021
This way we'll see a problem in GitHub's UI, where delivered and failed
webhook payloads are shown. Before this change the payload was marked as
successfully delivered and only message like 'Created issue: 400' is
shown in logs on Heroku.

Part of #11
Totktonada added a commit that referenced this issue Nov 8, 2021
@Totktonada
Copy link
Member Author

Totktonada commented Nov 8, 2021

I found two commits without tarantool/doc issues, found corresponding webhook payload and redelivered it. Got the new tarantool/doc issues:

So the fix works.

I want to re-check that all commits has tarantool/doc issues.

Some weird scripting

Change directory to tarantool source repository, checkout latest master branch.

Collect existing doc issues:

$ export GITHUB_TOKEN=$(pass show name_of_the_token)
$ cat fetch-doc-issues.sh
#!/bin/sh

set -eux

issues_url='https://github.com/api/repos/tarantool/doc/issues?state=all&per_page=100'
page_count=$(curl -fsSI -H "Authorization: token ${GITHUB_TOKEN}" "${issues_url}" | grep '^link:' | sed -e 's/^.*&page=\([0-9]\+\)>; rel="last".*$/\1/')

for i in $(seq 1 ${page_count}); do
    curl -fsS -H "Authorization: token ${GITHUB_TOKEN}" "${issues_url}&page=${i}" > issues-${i}.json
done
$ ./fetch-doc-issues.sh

Extract titles:

$ for i in $(seq 1 1000); do if [ ! -f issues-$i.json ]; then continue; fi; jq -rM '.[] | select(.pull_request == null) | .title' < issues-$i.json; done | sed -e 's/^\[[^]]\+\] //' -e 's/^ \+//' > present-doc-issue-titles.txt

Extract titles from commit messages:

$ git log | grep '^    Title:' | sed 's/^    Title: //' > expected-doc-issue-titles.txt

For each expected title show whether we have corresponding doc issue:

$ while read line; do m="$(fgrep "$line" present-doc-issue-titles.txt | head -n 1)"; if [ "$m" = "$line" ]; then echo "EXACT: $line"; elif [ -n "$m" ]; then echo "FUZZY MATCH: $line | $m"; else echo "NO MATCH: $line"; fi ; done < expected-doc-issue-titles.txt >expected-doc-issue-titles-marked.txt

Now the list is the following (if we'll skip found issues):

$ grep -v ^EXACT: expected-doc-issue-titles-marked.txt

The rough list is the following:

@Totktonada
Copy link
Member Author

Processed all missed documentation requests that I found in commit messages.

@Totktonada Totktonada changed the title Don't pass access_token as GET parameter Don't pass access_token as query parameter Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants