hey hey 👋 is there an example anywhere for gettin...
# spicedb
d
hey hey 👋 is there an example anywhere for getting the values out of a response of a LookupSubjects call using the go Client? Looking around i couldn't find any
bit more context: I'd like to show the values, say, in a html page (actually trying to build a rest API wrapper)
think i figured a very naive way out... on the road i learned quite a few things about gRPC and streams, nice 😉 will provide a link shortly.
side question: under what circumstances is CheckPermissionResponse_PERMISSIONSHIP_UNSPECIFIED returned from CheckPermissions?
https://github.com/RedHatInsights/authz-experiments/blob/main/engine_eval/zanzibar/authzed/seatdemo/src/handler/tenantHandler.go#L65-L80 <- ugly but working for now. or perhaps even the right way to do it? i don't know, so have a nice weekend first of all 🙂
oh, and if anyone needs an example for testcontainers usage with spiceDB, look at https://github.com/RedHatInsights/authz-experiments/blob/main/engine_eval/zanzibar/authzed/seatdemo/src/handler/tenantHandler_test.go and https://github.com/RedHatInsights/authz-experiments/blob/main/engine_eval/zanzibar/authzed/seatdemo/src/handler/hellohandler_test.go for initialization. (model.yaml is in testresources folder) - far from perfect, but it works 😉
(disclaimer: I am completely new to go, grpc, echo. But hey, I learned a lot today 😄 )
v
are you familiar with SpiceDB's HTTP Gateway? You don't need to write a Rest API Wrapper If you want examples, here is our Postman Workspace: https://www.postman.com/authzed/workspace/spicedb/api
>side question: under what circumstances is CheckPermissionResponse_PERMISSIONSHIP_UNSPECIFIED returned from CheckPermissions? never. If it does, it's a bug
and it does not look ugly to me. It's a streaming API, elements are consumed that way.
d
> are you familiar with SpiceDB's HTTP Gateway? You don't need to write a Rest API Wrapper Yep. And the
IsFull
check shouldn't be outside of spiceDB, so then i'd agree, remove the wrapping layer. Nevertheless it was a worthwhile exploration for me, mostly with the goal of learning 🙂 > never. If it does, it's a bug thx, good to know!
> here you have an example of how we do integration tests via a docker container: I am a bit biased, knowing the two testcontainer core maintainers/atomicJar founders, give you that. Thanks 😉
17 Views