From 9bd9956e33731f1619c32e1e6b7c78f42e7c47c3 Mon Sep 17 00:00:00 2001 From: aeneasr Date: Wed, 27 May 2020 16:54:23 +0200 Subject: [PATCH] fix: resolve test issues --- engine/ladon/handler_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/ladon/handler_test.go b/engine/ladon/handler_test.go index 8cdd9e3ab..f85055ac4 100644 --- a/engine/ladon/handler_test.go +++ b/engine/ladon/handler_test.go @@ -125,13 +125,17 @@ func toSwaggerPolicy(p kstorage.Policy) *models.OryAccessControlPolicy { } func fromSwaggerPolicy(p models.OryAccessControlPolicy) kstorage.Policy { + conditions, ok := p.Conditions.(map[string]interface{}) + if !ok { + conditions = nil + } return kstorage.Policy{ Actions: p.Actions, ID: p.ID, Resources: p.Resources, Subjects: p.Subjects, Effect: p.Effect, - Conditions: p.Conditions, + Conditions: conditions, Description: p.Description, } }