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: add support for disabling signature verification #350

Merged
merged 3 commits into from
Oct 12, 2022

Conversation

zBNF
Copy link
Contributor

@zBNF zBNF commented Oct 11, 2022

During local development it doesn't make a lot of sense to require signature verification.

Here's a proposed change that allows library users to disable verification. I'm open to alternative approaches in order to avoid introducing any breaking changes if there are concerns around that.

@diamondburned
Copy link
Owner

Discord won't allow using a new endpoint without having the valid signature in the first place.

I'm not sure what you're actually trying to accomplish by having this PR. I personally develop my bot just fine with this. Are you trying to mock test the bot? Why not just call the handler function directly?

@diamondburned
Copy link
Owner

diamondburned commented Oct 11, 2022

A non-breaking way to introduce this would be to not do verification if pubkey == "". This way, you can empty out the environment variable for the pubkey within development. No new parameters need to be introduced.

@zBNF
Copy link
Contributor Author

zBNF commented Oct 11, 2022

I think this works.

Are you trying to mock test the bot?

Basically, I'm looking to run black box tests using mocks on my binary.

api/webhook/interactionserver.go Show resolved Hide resolved
api/webhook/interactionserver.go Show resolved Hide resolved
@diamondburned diamondburned merged commit e058e7c into diamondburned:v3 Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants