Ths usecase behind this is,

we have scopes defined in apim product REST APIs for each resource path as
below.

/apis/{apiId}:

#-----------------------------------------------------

# Retrieve the details of an API definition

#-----------------------------------------------------

  get:

    x-scope: apim:api_view

    x-wso2-curl: "curl -k -H \"Authorization: Bearer
ae4eae22-3f65-387b-a171-d37eaa366fa8\"
https://127.0.0.1:9443/api/am/publisher/v1.0/apis/7a2298c4-c905-403f-8fac-38c73301631f
"

......


We are keeping track of these resource to scope mapping and at the time of
a new request, we need to validate the scope.

But, the request coming with a value(206e1b0b-a48e-47c9-95d0-3eb85544cf2e)
for the variable(apiId), hence unable to find the resource template to
match unless we do a string manipulation(we are maintaining a map for the
resource to scope mapping).


We better avoid string manipulations as much as possible because this will
take place in gateway.


Therefore need to check the possibility of supporting this from MSF4J level
so that we can get template info from the Request object itself.




Thanks & Regards,
Ishara Cooray
Senior Software Engineer
Mobile : +9477 262 9512
WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

On Mon, May 29, 2017 at 12:40 PM, Ishara Cooray <isha...@wso2.com> wrote:

> Hi,
>
> We have a requirement to identify the request template for a given http
> request.
>
> For example,
> *Req: *
> /api/am/publisher/v1.0/apis/206e1b0b-a48e-47c9-95d0-3eb85544cf2e
>
> *Req path:*
> /apis/206e1b0b-a48e-47c9-95d0-3eb85544cf2e
>
> *Need *to identify corresponding *template as *
> apis/{apiId}
>
> Is there a way to get this info from the MSF4J level?
>
>
> Thanks & Regards,
> Ishara Cooray
> Senior Software Engineer
> Mobile : +9477 262 9512 <+94%2077%20262%209512>
> WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to