Hi Janak,

Claim dialect list should include the local dialect as well and doing an
internal redirection to a different endpoint is not a proper approach IMO.
Therefore +1 for the 2nd option as it will be a much cleaner approach.

Thanks,
Ashen

On Mon, Aug 5, 2019 at 11:23 PM Malithi Edirisinghe <malit...@wso2.com>
wrote:

> Hi Janak,
>
> I would opt for option 2.
> So that, from the claim management REST API perspective, the api
> definition would be same and local dialect will only have a reserved id
> which is 'local' and an extended schema from other dialects.
>
> Thanks,
> Malithi
>
>
> On Mon, Aug 5, 2019 at 5:22 PM Janak Amarasena <ja...@wso2.com> wrote:
>
>> Hi all,
>>
>> When listing all the claim dialects using the Claim Management REST API
>> the local claim dialect is also listed.
>>
>> [
>>     {
>>         "id": "aHR0cDovL3dzbzIub3JnL2NsYWltcw",
>>         "dialectURI": "http://wso2.org/claims";,
>>         "link": {
>>             "href": "
>> https://localhost:9443/t/carbon.super/api/server/v1/claim-dialects/aHR0cDovL3dzbzIub3JnL2NsYWltcw/claims
>> ",
>>             "rel": "claims"
>>         }
>>     },
>>     {
>>         "id":
>> "aHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eQ",
>>         "dialectURI": "http://schemas.xmlsoap.org/ws/2005/05/identity";,
>>         "link": {
>>             "href": "
>> https://localhost:9443/t/carbon.super/api/server/v1/claim-dialects/aHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eQ/claims
>> ",
>>             "rel": "claims"
>>         }
>>     },
>> ...
>>
>> Using the provided link in *href *it is possible to retrieve the set of
>> claims for each dialect except for the *href *for the local claim
>> dialect. A separate endpoint is defined in the swagger[1] for getting
>> claims from the local dialect as the schema returned is significantly
>> different than when calling using another claim dialect.
>>
>> Response when using the local claim dialect when getting claims;
>> [
>>     {
>>         "id": "aHR0cDovL3dzbzIub3JnL2NsYWltcy9sb2NhbA",
>>         "claimURI": "http://wso2.org/claims/local";,
>>         "dialectURI": "http://wso2.org/claims";,
>>         "description": "Local",
>>         "displayOrder": 0,
>>         "displayName": "Local",
>>         "readOnly": false,
>>         "regEx": null,
>>         "required": false,
>>         "supportedByDefault": false,
>>         "attributeMapping": [
>>             {
>>                 "mappedAttribute": "local",
>>                 "userstore": "PRIMARY"
>>             }
>>         ],
>>         "properties": []
>>     },
>> ...
>>
>> Response when using any other dialect when getting claims;
>> [
>>     {
>>         "id":
>> "dXJuOnNjaW06c2NoZW1hczpjb3JlOjEuMDphZGRyZXNzZXMuZm9ybWF0dGVk",
>>         "claimURI": "urn:scim:schemas:core:1.0:addresses.formatted",
>>         "claimDialectURI": "urn:scim:schemas:core:1.0",
>>         "mappedLocalClaimURI": "
>> http://wso2.org/claims/addresses.formatted";
>>     },
>> ...
>>
>> Currently, if the *href* shown for the local claim dialect is used to
>> retrieve the local claims a bad request response is thrown as retrieving
>> local claims has a separate endpoint defined.
>>
>>
>> There are three possible approaches;
>>
>>    1. Remove the local claim dialect from listing - There can be
>>    drawbacks when implementing UIs as the local claim dialect will have to be
>>    separately listed.
>>    2. Change the *id* and the *href *to match the endpoint defined in
>>    the swagger - The schema returned for the local cliam dialect will still 
>> be
>>    significantly different from other dialects but a developer will see a
>>    difference in the *href* and the *id. *The *id* = "local" *href *= "
>>    
>> https://localhost:9443/t/carbon.super/api/server/v1/claim-dialects/local/claims
>>    ".
>>    3. Internally wire the endpoint to be directed to the endpoint
>>    defined in the swagger to get local claims - At development time the
>>    developer will not see a difference and might use the endpoint 
>> incorrectly.
>>
>>
>> [1] -
>> https://app.swaggerhub.com/apis/janakamarasena/IS-ADMIN-CLAIMS/1.0.0
>>
>> Your thoughts are much appreciated in this regards,
>>
>> Thank you,
>> Janak
>>
>> --
>> *Janak Amarasena* | Software Engineer | WSO2 Inc.
>> (m) +94777764144 | (w) +94112145345 | (e) ja...@wso2.com
>>
>>
>> <https://wso2.com/signature>
>>
>
>
> --
> *Malithi Edirisinghe* | Technical Lead | WSO2 Inc.
> (m) +94 718176807 | (w) +94 11 214 5345 | (e) malit...@wso2.com
> GET INTEGRATION AGILE
> Integration Agility for Digitally Driven Business
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
Ashen Weerathunga | Senior Software Engineer | WSO2 Inc.
(m) +94716042995 | (w) +94112145345 | Email: as...@wso2.com
<http://wso2.com/signature>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to