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

pass full request path to the post auth webhook, maybe fix #8771 #10049

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

axe-me
Copy link

@axe-me axe-me commented Dec 8, 2023

Description

Pass the full request path to the auth webhook in the AHPost handler

Changelog

Component : server

Type: enhancement

Product: community-edition

Short Changelog

Pass the full request path to the auth webhook in the AHPost handler

Long Changelog

Related Issues

#8771

Solution and Design

TBH I'm not sure if my solution works, I simply create a new data type and create a variable with the full request path which is the path + query params, and then pass the variable to the getInfo function, don't know if this gonna break the type checking in haskell.
I only learned a bit haskell today and put up the PR with chatgpt. Please let me know if this totally wont work and how can I make it work. Really appreciated it, my company needs to use this feature to do some callback webhook secret from query params validation.

Steps to test and verify

Send a api/rest request to the engine, then full path should be included in the request body of the request sending to auth hook.

Limitations, known bugs & workarounds

n/a

Server checklist

Catalog upgrade

Does this PR change Hasura Catalog version?

  • No
  • Yes
    • Updated docs with SQL for downgrading the catalog

Metadata

Does this PR add a new Metadata feature?

  • No
  • Yes
    • Does run_sql auto manages the new metadata through schema diffing?
      • Yes
      • Not required
    • Does run_sql auto manages the definitions of metadata on renaming?
      • Yes
      • Not required
    • Does export_metadata/replace_metadata supports the new metadata added?
      • Yes
      • Not required

GraphQL

  • No new GraphQL schema is generated
  • New GraphQL schema is being generated:
    • New types and typenames are correlated

Breaking changes

  • No Breaking changes

  • There are breaking changes:

    1. Metadata API

      Existing query types:

      • Modify args payload which is not backward compatible
      • Behavioural change of the API
      • Change in response JSON schema
      • Change in error code
    2. GraphQL API

      Schema Generation:

      • Change in any NamedType
      • Change in table field names

      Schema Resolve:-

      • Change in treatment of null value for any input fields
    3. Logging

      • Log JSON schema has changed
      • Log type names have changed

@axe-me axe-me requested a review from a team as a code owner December 8, 2023 05:56
@hasura-bot
Copy link
Contributor

Beep boop! 🤖

Hey @axe-me, thanks for your PR!

One of my human friends will review this PR and get back to you as soon as possible.

Stay awesome! 😎

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@danieljharvey
Copy link
Contributor

Hello! Thanks for your contribution!

It sounds like you haven't managed to build graphql-engine with your changes yet. There is a guide on everything you should need here: https://github.com/hasura/graphql-engine/blob/master/server/CONTRIBUTING.md

Once it's set up you should be able to run a local HGE instance using make run-oss-server in the root of the repository and test your changes.

Let me know if you have any trouble getting everything working.

@axe-me
Copy link
Author

axe-me commented Dec 17, 2023

Hi @danieljharvey , thanks for check this. I just spent a few hours setting up the local dev, but none of the approaches works for me on my MacBook, the nix approach runs for few hours but still not finished (even with the caches), hopefully the new vite based setup could improve the DX a bit.
I guess I have to give up on this PR. I will try use some other method to do restful endpoints auth for now until it's officially implemented by hasura team..

@danieljharvey
Copy link
Contributor

Hey! Sorry to hear that - there are some more specific MacOS instructions here that might be helpful?

https://github.com/hasura/graphql-engine/blob/master/server/COMPILING-ON-MACOS.md

@axe-me
Copy link
Author

axe-me commented Dec 18, 2023

I read this doc and followed the instructions, it works and compiles, just extremely slow.

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.

5 participants