Giter Club home page Giter Club logo

Comments (4)

Abhishek-AC avatar Abhishek-AC commented on June 11, 2024

GitHub Developer Documentation link updated in the issue's resources.

from cti-website-frontend.

Abhishek-AC avatar Abhishek-AC commented on June 11, 2024

I can use my personal-access-token to hit the replace all repository tags API endpoint https://developer.github.com/v3/repos/#replace-all-repository-topics
But when I use the access-token generated by GitHub App(steps in StackOverflow question) I get the following:

{
    "message": "Resource not accessible by integration",
    "documentation_url": "https://developer.github.com/v3/repos#replace-all-topics-for-a-repository"
}

To describe my issue, refer the question on StackOverflow(the question talks about consuming issues GitHub API but the scenario is entirely the same with the API that I am trying to consume) https://stackoverflow.com/questions/51336005/github-api-what-permission-should-a-github-app-get-when-create-an-issue

Resolution
Trying to find a solution/workaround

from cti-website-frontend.

Abhishek-AC avatar Abhishek-AC commented on June 11, 2024

Functionality achieved

OAuth Application created for Civic Tech Index Organization.

Steps to replicate the demo:

  1. In a browser window, open the link
  2. Authorize the OAuth Application
  3. Grab only the query parameter code from the URL
  4. Using Postman, consume the following POST API endpoint:
https://github.com/login/oauth/access_token?client_id=8ce9dc8a15484de9060d&client_secret=4cec9b74ff3e912c354e8437dfb45303d2bb79a5&code=9496c118aec0f37d831b&redirect_uri=https://cti-dev.herokuapp.com/&state=j16nz4wntk
  1. From the API response grab the access token
  2. Consume the GitHub API - PUT Replace all repository topics
  3. Use the access token as a Request Header for the above PUT API endpoint,
Key: Authorization, Value: Bearer <access-token obtained>
  1. In the Body, switch to raw - JSON format and add the following:
{
  "names": [
	"civictechindex"
  ]
}
  1. Hit Send Button
  2. On a successful replace all repository tags functionality, the API should return status code 200 with response same as the body in step 8

Security concerns:

  1. Client ID and Client Secret are exposed in PUT API call (step 4)
  2. All of this needs to achieved using an interface/website -> initiation from Checkout out our automated process [Referring the Figma file]

from cti-website-frontend.

Abhishek-AC avatar Abhishek-AC commented on June 11, 2024

This issue can be closed as the GitHub Oauth App for civictechindex is configured and steps to replicate the automation of repository tags explained in the above comment

from cti-website-frontend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.