Skip to content

Commit

Permalink
chore: fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Sep 2, 2022
1 parent 1d87908 commit e235520
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/client/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (

EnvReadRemote = "KETO_READ_REMOTE"
EnvWriteRemote = "KETO_WRITE_REMOTE"
EnvAuthToken = "KETO_BEARER_TOKEN"
EnvAuthToken = "KETO_BEARER_TOKEN" // nosec G101 -- just the key, not the value

ContextKeyTimeout contextKeys = "timeout"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func TestMigrations(t *testing.T) {
var oldRTs []*tuplesBeforeUUID
require.NoError(t, p.Connection(ctx).
Select("subject_id", "object").
// lint:ignore SA1019
Where("namespace_id = ?", namespaces[1].ID).
All(&oldRTs))
assert.Equalf(t, "user", oldRTs[0].SubjectID.String, "%+v", oldRTs[0])
Expand All @@ -176,7 +177,8 @@ func TestMigrations(t *testing.T) {
expected := make([]*ketoapi.RelationTuple, len(oldRTs))
for i := 0; i < len(oldRTs); i++ {
oldRTs[i] = tuplesBeforeUUID{
NetworkID: p.NetworkID(ctx),
NetworkID: p.NetworkID(ctx),
// lint:ignore SA1019
NamespaceID: namespaces[1].ID,
Object: "object-" + strconv.Itoa(i),
Relation: "pagination-works",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
"github.com/ory/keto/internal/namespace"
)

// lint:file-ignore SA1019 as we migrate legacy stuff

// We copy the definitions of OldRelationTuple and UUIDMapping here so that the
// migration will always work on the same definitions.
type (
Expand Down
8 changes: 4 additions & 4 deletions internal/persistence/sql/relationtuples.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ func (r *RelationTuple) insertSubject(_ context.Context, s relationtuple.Subject
r.SubjectSetRelation = sql.NullString{}
case *relationtuple.SubjectSet:
r.SubjectID = uuid.NullUUID{}
r.SubjectSetNamespace.Scan(st.Namespace)
r.SubjectSetObject.Scan(st.Object)
r.SubjectSetRelation.Scan(st.Relation)
_ = r.SubjectSetNamespace.Scan(st.Namespace)
_ = r.SubjectSetObject.Scan(st.Object)
_ = r.SubjectSetRelation.Scan(st.Relation)
}
return nil
}
Expand Down Expand Up @@ -223,7 +223,7 @@ func (p *Persister) GetRelationTuples(ctx context.Context, query *relationtuple.
return nil, "", sqlcon.HandleError(err)
}
if len(res) == 0 {
return make([]*relationtuple.RelationTuple, 0, 0), "", nil
return make([]*relationtuple.RelationTuple, 0), "", nil
}

var nextPageToken string
Expand Down

0 comments on commit e235520

Please sign in to comment.