From c203d8e25a13ea3916f19ec6ca5d5ed7798b9a14 Mon Sep 17 00:00:00 2001 From: autom8ter Date: Mon, 21 Dec 2020 06:52:02 -0700 Subject: [PATCH] fix dockerfile --- .bumpversion.cfg | 2 +- Makefile | 2 +- README.md | 4 ++-- database/db.go | 12 +++++++++--- docker-compose.yml | 2 +- gql/helpers.go | 6 +++--- version/version.go | 2 +- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 399942a..071d629 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.10.0 +current_version = 0.10.1 commit = False tag = False diff --git a/Makefile b/Makefile index a387c07..6436ba5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -version := "0.10.0" +version := "0.10.1" .DEFAULT_GOAL := help diff --git a/README.md b/README.md index c86303d..fbf0022 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ git clone git@github.com:graphikDB/graphik.git -` docker pull graphikdb/graphik:v0.10.0` +` docker pull graphikdb/graphik:v0.10.1` Graphik is a Backend as a Service implemented as an identity-aware, permissioned, persistant document/graph database & pubsub server written in Go. @@ -775,7 +775,7 @@ add this docker-compose.yml to ${pwd}: version: '3.7' services: graphik: - image: graphikdb/graphik:v0.10.0 + image: graphikdb/graphik:v0.10.1 env_file: - .env ports: diff --git a/database/db.go b/database/db.go index 92df292..48ae5f8 100644 --- a/database/db.go +++ b/database/db.go @@ -61,6 +61,9 @@ func (g *Graph) cacheConnectionRefs() error { func (g *Graph) cacheIndexes() error { return g.db.View(func(tx *bbolt.Tx) error { return tx.Bucket(dbIndexes).ForEach(func(k, v []byte) error { + if k == nil || v == nil { + return nil + } var i apipb.Index var program cel.Program var err error @@ -103,7 +106,7 @@ func (g *Graph) rangeTypeValidators(fn func(a *typeValidator) bool) { func (g *Graph) cacheAuthorizers() error { return g.db.View(func(tx *bbolt.Tx) error { return tx.Bucket(dbAuthorizers).ForEach(func(k, v []byte) error { - if v == nil { + if k == nil || v == nil { return nil } var i apipb.Authorizer @@ -111,9 +114,12 @@ func (g *Graph) cacheAuthorizers() error { if err := proto.Unmarshal(v, &i); err != nil { return err } + if i.GetExpression() == "" { + return nil + } program, err := g.vm.Auth().Program(i.Expression) if err != nil { - return err + return errors.Wrapf(err, "failed to cache auth expression: %s", i.GetName()) } g.authorizers.Set(i.GetName(), &authorizer{ authorizer: &i, @@ -127,7 +133,7 @@ func (g *Graph) cacheAuthorizers() error { func (g *Graph) cacheTypeValidators() error { return g.db.View(func(tx *bbolt.Tx) error { return tx.Bucket(dbTypeValidators).ForEach(func(k, v []byte) error { - if v == nil { + if k == nil || v == nil { return nil } var i apipb.TypeValidator diff --git a/docker-compose.yml b/docker-compose.yml index 2f9c637..98d7761 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.7' services: graphik: - image: graphikdb/graphik:v0.10.0 + image: graphikdb/graphik:v0.10.1 env_file: - .env ports: diff --git a/gql/helpers.go b/gql/helpers.go index 546a6e3..686c733 100644 --- a/gql/helpers.go +++ b/gql/helpers.go @@ -222,9 +222,9 @@ func gqlTypeValidator(val *apipb.TypeValidator) *model.TypeValidator { func gqlIndex(val *apipb.Index) *model.Index { return &model.Index{ - Name: val.GetName(), - Gtype: val.GetGtype(), - Expression: val.GetExpression(), + Name: val.GetName(), + Gtype: val.GetGtype(), + Expression: val.GetExpression(), TargetConnections: val.GetConnections(), TargetDocs: val.GetDocs(), } diff --git a/version/version.go b/version/version.go index 30e0f05..6f16020 100644 --- a/version/version.go +++ b/version/version.go @@ -1,3 +1,3 @@ package version -const Version = "0.10.0" +const Version = "0.10.1"