Joey
06/17/2022, 6:58 PMyetitwo
06/17/2022, 7:02 PMyetitwo
06/17/2022, 7:02 PMJoey
06/17/2022, 7:16 PMJoey
06/17/2022, 7:17 PMdefinition user {
relation this: user
relation persona: persona
permission user_or_persona = this + persona
}
definition persona {}
definition thing {
relation reader: user#user_or_persona | persona
}
Joey
06/17/2022, 7:17 PMuser_or_persona
Joey
06/17/2022, 7:17 PMJoey
06/17/2022, 7:17 PMJoey
06/17/2022, 7:17 PMthis
, but that only needs to be done onceyetitwo
06/17/2022, 8:36 PMpebbleacro
06/18/2022, 7:39 AMmckenzig
06/18/2022, 8:35 AMJoey
06/18/2022, 3:49 PMJoey
06/18/2022, 3:50 PMmckenzig
06/18/2022, 10:18 PMJoey
06/18/2022, 10:18 PMJoey
06/18/2022, 10:19 PMprasanna
06/20/2022, 7:33 AMprasanna
06/20/2022, 7:34 AMvroldanbet
06/20/2022, 8:11 AMHOPE
06/20/2022, 8:32 AMmutation func()
in go. after executing the mutation it will write a (resource, subject, permission)
tuple to authzed.
I'd like to test after i executed func(), does subject
have permission
to resource
.
I am aware of the serve-testing. But I'm wondering how I can put it into my go unittest code.
I'm trying this example https://github.com/authzed/spicedb/blob/main/cmd/spicedb/servetesting_integration_test.go
But it requires building a docker image. And when I removed first two lines
//go:build docker
// +build docker
and run go test
, it pops up error saying
go/pkg/mod/github.com/authzed/spicedb@v1.8.0/pkg/proto/core/v1/util.go:17:47: undefined: v0.RelationTupleTreeNode
vroldanbet
06/20/2022, 9:38 AMDefinitelyNotSam
06/20/2022, 11:27 AMcalle-ibx
06/20/2022, 2:29 PMvroldanbet
06/20/2022, 2:34 PMRocio
06/20/2022, 3:41 PMuser:1#access@object:1
, and team:1#access@object:1
are created)
2. User:1 is added to Team:1 (user:1#member@team:1)
3. User:1's access is removed from the object - but they still have access because they are part of the team. (the relationship user:1#access@object:1
is removed)
Is there a way to make a change "temporairly", and then test what would be the consequences? In this case, for example, remove the user:1#access@object:1
relationship and then return what are all the users that have access to object:1
? To make sure that user:1
still has access to the object.
If not, how would you do something like this? Keep track of the relationships on the service side?Joey
06/20/2022, 3:43 PMJoey
06/20/2022, 3:44 PMdefinition user {}
definition organization {
relation member: user
permission view = member
}
definition resource {
relation viewer: user
relation org: organization
permission view_local = viewer
permission view = view_local + org->view
}
Rocio
06/20/2022, 3:46 PMRocio
06/20/2022, 3:53 PM