Giter Site home page Giter Site logo

Comments (6)

aaronrothschild avatar aaronrothschild commented on May 23, 2024 1

Knowing that, what happens is:

  • Github plugin configured with "gabu9" and GabuTest org, but account connected is "hector2": it will check, with hector2 credentials, if hector2 is blocked from "GabuTest" org, getting 404 (Not blocked).
    So I think there is no way of knowing it a priori. We would know if it is blocked after trying to create the issue comment.

Any ideas?

@hector2 Hmmmm. Interesting problem.

I think returning a genericized message may be the best we can do: Sorry, either you don't have access to the repo {REPO_NAME} with the user {GITHUB_AUTHED_USERNAME} or it is no longer available (404) Does that cover the situation appropriately?

cc @hanzei @DHaussermann

from mattermost-plugin-github.

hectorgabucio avatar hectorgabucio commented on May 23, 2024

Hello! Can i work on this issue?

from mattermost-plugin-github.

aaronrothschild avatar aaronrothschild commented on May 23, 2024

@hector2 Absolutely, let me know if you have any questions at all!

Removing "Up for Grabs" label for you.

from mattermost-plugin-github.

hectorgabucio avatar hectorgabucio commented on May 23, 2024

Hello @aaronrothschild !

I managed to check if the issue has locked the conversation. However, there is a problem checking if the user is blocked from the organization.

I created an organization called "GabuTest", and the owner is "gabu9". In this organization, I blocked myself (hector2).

If I check if the user is blocked (using gabu9 credentials):

curl -u "gabu9" -H "Accept: application/vnd.github.giant-sentry-fist-preview+json" https://api.github.com/orgs/GabuTest/blocks/hector2

The response is 204, it means it is blocked.

However, if I do:
curl -u "hector2" -H "Accept: application/vnd.github.giant-sentry-fist-preview+json" https://api.github.com/orgs/GabuTest/blocks/hector2

The response is 404, I guess because the user itself can't see if it is blocked on an organization.

Knowing that, what happens is:

  • Github plugin configured with "gabu9" and GabuTest org, but account connected is "hector2": it will check, with hector2 credentials, if hector2 is blocked from "GabuTest" org, getting 404 (Not blocked).
    So I think there is no way of knowing it a priori. We would know if it is blocked after trying to create the issue comment.

Any ideas?

from mattermost-plugin-github.

hectorgabucio avatar hectorgabucio commented on May 23, 2024

@aaronrothschild I tried creating an issue comment in a blocked org repo, and the response was "403 Forbidden" so we could even identify more accurately the problem and say something like "The issue is locked for comments/You don't have permissions to do that action" if you prefer.

from mattermost-plugin-github.

aaronrothschild avatar aaronrothschild commented on May 23, 2024

@hector2 Excellent. the more explicit the error message, the better IMO. I would prefer that message.

from mattermost-plugin-github.

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.