Ozzzkar
Ozzzkar•3mo ago

Can't use pkg/grpc/user/v2 from Response manipulation example

Hi, I'm following your response manipulation example for Golang here: https://zitadel.com/docs/guides/integrate/actions/testing-response-manipulation In the top of the file there's an import for "github.com/zitadel/zitadel/pkg/grpc/user/v2" but when I run go get github.com/zitadel/zitadel/pkg/grpc/user/v2 I get this back:
go: module github.com/zitadel/zitadel@upgrade found (v1.87.5), but does not contain package github.com/zitadel/zitadel/pkg/grpc/user/v2
go: module github.com/zitadel/zitadel@upgrade found (v1.87.5), but does not contain package github.com/zitadel/zitadel/pkg/grpc/user/v2
13 Replies
Ozzzkar
OzzzkarOP•3mo ago
I think I found the solution The file is here https://github.com/zitadel/zitadel-go/blob/main/pkg/client/user/v2/client.go So the documentation should be updated to import "github.com/zitadel/zitadel-go/v3/pkg/client/zitadel/user/v2" instead for signature checking, i couldn't find "github.com/zitadel/zitadel/pkg/actions" though and it seems that there is no "github.com/zitadel/zitadel-go/v3/pkg/client/zitadel/actions/v2" https://zitadel.com/docs/guides/integrate/actions/testing-request-signature Also tried "github.com/zitadel/zitadel-go/v3/pkg/client/zitadel/action/v2beta" but the ValidatePayload function doesn't exist
Rajat
Rajat•3mo ago
hey @Ozzzkar what version of zitadel are you on and are you self hosted
Ozzzkar
OzzzkarOP•3mo ago
4.0.1 self-hosted but this is about coding so the version of Zitadel doesn't matter. I'm trying to use Actions v2 and that's why I'm trying to follow that example
Rajat
Rajat•3mo ago
hey @Ozzzkar I am a bit confused here, you said responses maniluation doesnt work which was here https://zitadel.com/docs/guides/integrate/actions/testing-response-manipulation but then you mention ValidatePayload from request signature, so I am a bit lost here. What doesnt work for you?. I just tested response manipulation and it doesnt sends me any respone when using an IDP , is that is what your core issue is?. Or is it other things too that you mentioned, sorry for the confusion but I cannot make a conclusion here, you raised valid points and I will update the doc(you can also raise a PR!) but tbh I did not understand if this thread if for request manipulation or response or any internal methods that are failing on the go code, because you mentioned lots of things 😅
ZITADEL Docs
This guide shows you how to leverage the ZITADEL actions feature to manipulate API responses in your ZITADEL instance.
Ozzzkar
OzzzkarOP•3mo ago
I got the response manipulation to work and I can open a PR for that fix, it's just an example code /documentation issue But I couldn't get your example code for signature verification to work I'm trying to write a handler for actions V2 that I will then configure Zitadel to use A "target" But the problem seems to be that the Go package I need isn't exposed correctly. I thought that was the same case with the response manipulation but it turns out that it was just the documentation that wasn't updated. But for the signature verification I'm not sure, because I can't find the method that is referenced in your example I think I need to use this one: https://github.com/zitadel/zitadel/blob/main/pkg/actions/signing.go But it's not exposed publicly in the right way, as far as I understand. I think this should also be copied over to the zitadel-go repository
Ozzzkar
OzzzkarOP•3mo ago
I opened an issue for this, I may open a PR too https://github.com/zitadel/zitadel/issues/10502
GitHub
Incorrect imports in Golang examples for response manipulation and ...
Preflight Checklist I could not find a solution in the existing issues, docs, nor discussions I have joined the ZITADEL chat Describe the docs your are missing or that are wrong I was following the...
Rajat
Rajat•3mo ago
hey @Ozzzkar yes you were right, I lost your message in tons of other threads but I did tested it and you are correct, please open a PR, looking forward to it 🙂
Ozzzkar
OzzzkarOP•7d ago
I was still not able to set metadata by following the response manipulation example https://zitadel.com/docs/guides/integrate/actions/testing-response-manipulation But as a coincidence, after I started marking the email as verified, Zitadel suddenly started picking up my metadata setting too resp.AddHumanUser.Email.Verification = &zuser.SetHumanEmail_IsVerified{IsVerified: true} if I remove that line, Zitadel doesn't set the user metadata that I return back from the action okay, now it seems to work even without that line.. not sure what changed.. maybe some race condition
Gigi the Giraffe (Zitadel)
🎉 Looks like you just helped out another community member! Thanks for being so helpful <@158253511513997312>! You're now one step closer to leveling up—keep up the amazing peer support! 🚀
Ozzzkar
OzzzkarOP•6d ago
@Rajat the second issue in this issue (lol) is still not resolved, should I create a new issue or can someone reopen the issue?
Rajat
Rajat•6d ago
I just read that it couldve been a race condition, is thats the one you meant?. Or you still cant use the /pkg/grpc/v2?
Ozzzkar
OzzzkarOP•6d ago
i'm referring to the go import not working in this example code: https://zitadel.com/docs/guides/integrate/actions/testing-request-signature
Ozzzkar
OzzzkarOP•5d ago
GitHub
Request signature validation not working · Issue #523 · zitadel/z...
Original issue: zitadel/zitadel#10502 (the first issue was solved but not the second) I followed the signature checking example, but I couldn&#39;t find &quot;github.com/zitadel/zitadel/pkg/actions...

Did you find this page helpful?