@@ -316,9 +316,10 @@ func TestAuthPipelineGetAuthorizationJSON(t *testing.T) {
316316 }, & requestMock )
317317
318318 requestJSON , _ := gojson .Marshal (requestMock .GetAttributes ())
319- expectedWellKnownAttributes := `"request":{"host":"my-api","method":"GET","path":"/operation","url_path":"/operation","headers":{"authorization":"Bearer n3ex87bye9238ry8"}},"source":{"address":"\u003cnil\u003e" },"destination":{"address":"\u003cnil\u003e" },"auth":{}`
319+ expectedWellKnownAttributes := `"request":{"host":"my-api","method":"GET","path":"/operation","url_path":"/operation","headers":{"authorization":"Bearer n3ex87bye9238ry8"}},"source":{},"destination":{},"auth":{}`
320320 expectedJSON := fmt .Sprintf (`{"context":%s,%s}` , requestJSON , expectedWellKnownAttributes )
321- assert .Equal (t , pipeline .GetAuthorizationJSON (), expectedJSON )
321+
322+ assert .Equal (t , expectedJSON , pipeline .GetAuthorizationJSON ())
322323}
323324
324325func TestEvaluateWithCustomDenyOptions (t * testing.T ) {
@@ -588,7 +589,7 @@ func TestNewAuthorizationJSON(t *testing.T) {
588589 "credential" : "multipass" ,
589590 },
590591 }
591- expectedAuthJSON := `{"context":{"request":{"http":{"method":"GET","headers":{"authorization":"Bearer n3ex87bye9238ry8"},"path":"/operation","host":"my-api"}}},"request":{"host":"my-api","method":"GET","path":"/operation","url_path":"/operation","headers":{"authorization":"Bearer n3ex87bye9238ry8"}},"source":{"address":"\u003cnil\u003e" },"destination":{"address":"\u003cnil\u003e" },"auth":{"identity":"leeloo","authorization":{"credential":"multipass"}}}`
592+ expectedAuthJSON := `{"context":{"request":{"http":{"method":"GET","headers":{"authorization":"Bearer n3ex87bye9238ry8"},"path":"/operation","host":"my-api"}}},"request":{"host":"my-api","method":"GET","path":"/operation","url_path":"/operation","headers":{"authorization":"Bearer n3ex87bye9238ry8"}},"source":{},"destination":{},"auth":{"identity":"leeloo","authorization":{"credential":"multipass"}}}`
592593
593594 assert .Equal (t , expectedAuthJSON , NewAuthorizationJSON (request , authPipeline ))
594595}
0 commit comments