summaryrefslogtreecommitdiff
path: root/pkg/authz/spice.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-25 15:11:57 -0600
committermo khan <mo@mokhan.ca>2025-07-25 15:11:57 -0600
commit2d7af07415e7b843da03ef572f56057f6d5970ff (patch)
tree7f2be4529c2cd86531d911a598c334b48a0d3428 /pkg/authz/spice.go
parentcc24c8fe6a045ea98ab9b4cd757a531389a50ac5 (diff)
refactor: extract init to load ioc container with dependencies
Diffstat (limited to 'pkg/authz/spice.go')
-rw-r--r--pkg/authz/spice.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/authz/spice.go b/pkg/authz/spice.go
index 97adbd4..e563375 100644
--- a/pkg/authz/spice.go
+++ b/pkg/authz/spice.go
@@ -26,12 +26,13 @@ type CheckPermissionService interface {
CheckPermission(ctx context.Context, in *v1.CheckPermissionRequest, opts ...grpc.CallOption) (*v1.CheckPermissionResponse, error)
}
-func LoadSpiceSchema(ctx context.Context, client *authzed.Client, path string) error {
+func WriteSchema(ctx context.Context, client *authzed.Client, path string) (*v1.WriteSchemaResponse, error) {
content, err := os.ReadFile(path)
- _, err = client.WriteSchema(ctx, &v1.WriteSchemaRequest{Schema: string(content)})
if err != nil {
- return err
+ return nil, err
}
- return nil
+ return client.WriteSchema(ctx, &v1.WriteSchemaRequest{
+ Schema: string(content),
+ })
}