-
Notifications
You must be signed in to change notification settings - Fork 89
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 Twitch Extension endpoints in Helix #114
Conversation
43e48e7
to
aff0e4c
Compare
Pull Request Test Coverage Report for Build 1185154481
💛 - Coveralls |
extension_jwt.go
Outdated
"fmt" | ||
"time" | ||
|
||
"github.com/dgrijalva/jwt-go" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the Go standard library have equivalent support for this package? This package hasn't been updated in years and is no longer maintained.
Additionally, I was hoping that we would not have to use any external packages in this project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of the box it appears it does not... I see that the repo has instead be re-located to https://github.com/golang-jwt/jwt, which is maintained.
I think it'll be mega overkill to re-invent the wheel in all honesty... is this something you'll eventually budge on @nicklaw5?
I think utilizing other go modules is something you should really consider in the future of this
repo, as I separately raised the issue it would be ideal to implement OIDC AUTH with something that already exists.
Dependabot for GitHub is fantastic at pushing PRs to update go modules for you see my post on reddit here
Another noteworthy look to assure your nuances is this https://github.blog/2021-07-22-github-supply-chain-security-features-go-community/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to budge. Give me a few days to review. It's a busy time for me atm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @nicklaw5 i understand entirely!
This PR is still a [W]ork [I]n [P]rogress, but I will continue to add on to it over the next week or so
098f71a
to
c6e74d3
Compare
@jackmcguire1 Is this ready to be reviewed? Or are you still making changes? |
@nicklaw5 maybe have a skim through if you have a chance and see what I’m trying to achieve. it’s a still not complete, sorry I’ve had covid and bad food poisoning recently and not had the energy to pick this up. |
- JWT signing - extension configuration segments endpoints - extension secrets endpoints - UPDATE extension docs Update Docs - remove role parameter when creating claim Updates to extension endpoints PR - update go mod to use https://github.com/golang-jwt/jwt - gofmt on project - validation check error on extension options owner id HOTFIX: json unmarshalling - adapt secrets structs to properly handle api response - add missing json tag for many extension segment configurations HOTFIX: broadcaster ID in extension configuration requests The Twitch docs are not really clear on some parts of the requests getExtensionConfiguration: - broadcasterID is an optional query parameter setExtensionConfiguration: - broadcasterId is an optional body parameter - validate the segment type if broadcasterID is provided MISC: - update 'GetExtensionSecret' -> 'GetExtensionSecrets' HOTFIX: pubsub requests - fix pubsub requests to be an array Extension Configuration - refactor setExtension params - refactor Extension Configuration Segment consts - add validation to get extension configuration if broadcaster Id provided - add unit test for getExtensionConfigurationSegment - add unit test for. setExtensionConfigurationSegment Remove unnecessary options - remove options from the extension options config, as these can just be provided in parameters Extension Tests Add unit tests - JWT tests - pubsub - extension required - extension send chat message Verify JWT Params test - add test to verify params
885b190
to
5459ac2
Compare
@nicklaw5 hi nick, i have squashed the commits and pushed some more tests, i believe this is in a state for review now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. I've added some comments in regards to minor formatting changes I'd prefer.
Can you also update the "Contributions" section in the README.md
and remove the following sentences?
All new features should rely solely on the Go standard library. No external dependencies should be included in your solutions.
pushed changes @nicklaw5 |
- address comments by nicklaw5 - create Extension Claimsfunc to accept struct as parameter - improve JWT unit tests - refactor 'SendExtensionPubSubMessage' structs to be prefixed by 'Extension'
754614f
to
79c49b9
Compare
Appreciate you making those adjustments 👍 |
Twitch are deprecating the Extension endpoints and migrated them to helix
This work is based off of my go module go-twitch-ext and for simplicity
I would like to migrate to Helix
FEATURES:
JWT:
Endpoints:
Things to note:
TODO: