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

[Feature request]: Add templating functionality for custom response #1947

Open
qbx2 opened this issue Mar 8, 2024 · 5 comments
Open

[Feature request]: Add templating functionality for custom response #1947

qbx2 opened this issue Mar 8, 2024 · 5 comments

Comments

@qbx2
Copy link

qbx2 commented Mar 8, 2024

First of all, thank you for effort to build this great product.

Is your feature request related to a problem? Please describe.

I want to solve okta's one-time verification request (https://developer.okta.com/docs/concepts/event-hooks/#one-time-verification-request) using convoy, but the challenge requires to respond with header value (x-okta-verification-challenge).

Describe the solution you'd like

Add templating functionality just like helm does. It's known to be using golang's template package (https://pkg.go.dev/text/template). It is likely to be easy to integrate and could be familiar to users.

Describe alternatives you've considered

There is a lot of template engines such as mustache, and I think it has simpler grammar.

Additional context

Okta requests with GET method for that challenge. Is it possible to support GET methods too?

Copy link

linear bot commented Mar 8, 2024

@jirevwe
Copy link
Collaborator

jirevwe commented Mar 9, 2024

Hey @qbx2,

This is an interesting problem. We do something like this when specifying idempotency for incoming projects.
Screenshot 2024-03-09 at 15 07 16

Is this what you had in mind? Something like this?

{{ req.body.name}}, {{ req.header.x-convoy-version}}
var buf bytes.Buffer
tpl, err := template.New("file").Parse(templateFile)
if err != nil {
    return err
}

err = tpl.Execute(&buf, request)
if err != nil {
    return err
}

This change would require frontend changes, hmm. I think that's all


Also, would you be willing to open a PR for this?

@qbx2
Copy link
Author

qbx2 commented Mar 12, 2024

@jirevwe Yes, that's correct. I'm sorry, but I'm busy with other work, so it won't be possible to submit a PR for the time being.

@jirevwe
Copy link
Collaborator

jirevwe commented Mar 12, 2024

That's fine. We'd open a PR and link it to this issue.

@qbx2
Copy link
Author

qbx2 commented Mar 13, 2024

Wow, that's so fast!! I just want to double-check that you didn't forget to support GET method to solve Okta's challenge.

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

No branches or pull requests

2 participants