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

feat(hackathon): Zenhog #22318

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

feat(hackathon): Zenhog #22318

wants to merge 19 commits into from

Conversation

neilkakkar
Copy link
Collaborator

Problem

Changes

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

How did you test this code?

"https://posthoghelp.zendesk.com/api/v2/organizations/search",
data="",
headers=headers,
params={"external_id": organization_id},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will this work for any random team trying to use their zendesk as an integration, will it? For example for your personal site, with your own zendesk setup, you maybe wouldn't have external_id = org_id (posthog-internal detail). Shouldn't we instead be using the user param from the request?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this work:

  1. key is in posthog settings (like zendesk key) - we'd have "external_id"
  2. we pass the value (organization_id for us) and secure that with the secret_token we have <- we can secure that the same way we would have secured user email? i.e. hogflix api will pass value and value_hash to posthog-js, which then passes both of these to posthog-api

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm super unclear about the zendesk API, but i'm assuming that it's not sufficient to just target by user, and we need this extra param?

If yes, then what you say is reasonable, we even don't need to secure it with the token, because securing one thing (user email) is sufficient for security, and also hashing this just creates annoyances for the user, they can just pass it in plain text ✅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We essentially need to get the Zendesk org ID, in your case, we link it with the PostHog org ID (external ID).

The API key is something different again. But let's worry about productizing this after we get the demo working.

We'll probably need the users to give us a giveZendeskOrgID() function

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes nothing for the demo agreed, so feel free to not read my comment.
There are a few things here:

  1. It would be great if Hogflix developer could choose if they want the search to be by email or by org_id or by something else in Zendesk <- i.e. they control which tickets are visible to who
  2. what they choose in (1) might be guessable, so we can't just verify the user - as I as a@b.c are the owner of that email, but I should not have access to org "Panda", but I can in js console send getTickets(a@b.c, validation_token_for_a@b.c, "Panda") - there's no way for us to verify that a@b.c belongs to whatever "Panda" is in Zendesk, so instead we can do getTickets("Panda", validation_token_for_panda)`

dmarticus and others added 9 commits May 16, 2024 06:28
* initial commit, most things working but still needs chat UX and other things

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* here 'tis

---------

Co-authored-by: Dylan Martin <dylan@postbox.hotspot.internet-for-guests.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* initial commit, most things working but still needs chat UX and other things

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* here 'tis

* save work

* fucked

* interleave data

---------

Co-authored-by: Dylan Martin <dylan@postbox.hotspot.internet-for-guests.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants