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

Add Helix Extension endpoints that require a JWT #291

Closed
8 tasks done
d-fischer opened this issue Sep 5, 2021 · 1 comment
Closed
8 tasks done

Add Helix Extension endpoints that require a JWT #291

d-fischer opened this issue Sep 5, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@d-fischer
Copy link
Member

d-fischer commented Sep 5, 2021

Feature Request

As a followup to #164, there should be a way to use Helix endpoints that require JWTs in a Twitch Extension backend service (EBS).

Features:

  • Get Extension
  • Create Extension Secret
  • Get Extension Secret
  • Set Extension Required Configuration
  • Set Extension Configuration Segment
  • Get Extension Configuration Segment
  • Send Extension PubSub Message
  • Send Extension Chat Message

This would probably require the introduction of a new AuthProvider that handles "external" JWTs transparently.
Additionally, the PubSub Message endpoint supports sending with a user JWT directly.

@d-fischer
Copy link
Member Author

Quoting myself from Discord:

I feel like this is a thing that completely differs from the use case of the ApiClient. The authentication isn't something that requires to be "managed" in an AuthProvider. These APIs can not be called using a normal OAuth token, and no other APIs can be called with JWTs. I could generate and sign a new short-lived JWT every single time the user wants to call one of these endpoints, really.

My idea on this is: rather than creating new methods on the ApiClient or creating a new class, there could be a new package basically just featuring a few free-standing functions (kinda like the @twurple/auth helpers functions). They would only depend on @twurple/api-call (the more bare-bones version of ApiClient) and some JWT library. Each function (in addition to its required endpoint parameters) would take an object that includes all required info to create the JWT (secret, owner ID, optionally JWT expiry, defaulting to 60 seconds or something like that). We can then easily throw our requests with a JWT to the Helix API. (Bikeshedding proposal: @twurple/ebs-helper)

I'm not sure whether people would still expect these things to be on ApiClient, but I feel like they might be better off outside of it.

This feature will be implemented close to this "spec".

@d-fischer d-fischer self-assigned this Mar 6, 2022
@d-fischer d-fischer added this to the 5.1 milestone Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant