apigee / istio-mixer-adapter

Apigee's Istio Mixer Adapter
Apache License 2.0
52 stars 21 forks source link

The behaviour seems to be different to the apigee docs #267

Closed dschniepp closed 5 years ago

dschniepp commented 5 years ago

The behaviour of the plugin https://github.com/apigee/istio-mixer-adapter/blob/860febb62f80bf740fdc225909306c7e746299e3/adapter/product/manager.go#L325 compared to the logic described here https://docs.apigee.com/developer-services/content/create-api-products#resourcebehavior seems to be different.

I guess, the testcase of https://github.com/apigee/istio-mixer-adapter/blob/3d62678ea5111b751a42c02871764f7ee24d7cbd/adapter/product/products_test.go#L177 should look like, as we omit the basepath:

    {"", []bool{true, false, false, false}},
    {"/", []bool{true, false, false, false}},
    {"/1", []bool{true, true, true, false}},
    {"/1/", []bool{true, true, true, false}},
    {"/1/2", []bool{true, false, true, false}},
    {"/1/2/", []bool{true, false, true, true}},
    {"/1/2/3/", []bool{true, false, true, true}},
    {"/1/a/2/3/", []bool{true, false, true, false}},

and this test case fails with the current implementation.

theganyo commented 5 years ago

Thanks for the report. The adapter has a slightly different pattern matching behavior. It’s documented here: https://docs.apigee.com/api-platform/istio-adapter/operation.

dschniepp commented 5 years ago

Thank you for the feedback, I am still confused because the test references https://docs.apigee.com/developer-services/content/create-api-products#resourcebehavior. But anyway thank you for clarification.

theganyo commented 5 years ago

Good point. I'll update the comment.