airavata-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hasini Gunasinghe <hasi7...@gmail.com>
Subject Re: How to run airavata with new APIToken changes
Date Wed, 03 Jun 2015 04:23:56 GMT
Hi Chathuri,

Yes, you are correct, we need to pass *new AuthzToken(""). *I have tested
the passing of null only at compile time. Passing null gives errors in run
time.
I updated the docs at [1] accordingly.

[1]
https://cwiki.apache.org/confluence/display/AIRAVATA/Developer+Documentation+for+Securing+Airavata+API

Thanks,
Hasini.

On Tue, Jun 2, 2015 at 10:52 PM, Chathuri Wimalasena <kamalasini@gmail.com>
wrote:

> Hi Hasini,
>
> Thanks for the information. I think we can't pass null for the AuthzToken
> since it is a required parameter in thrift API definition. As Supun
> mentioned, I created an AuthzToken object with some dummy string and pass
> it to get the API version.
>
> Thanks..
> Chathuri
>
> On Tue, Jun 2, 2015 at 10:36 PM, Hasini Gunasinghe <hasi7786@gmail.com>
> wrote:
>
>> Hi Chathuri, Supun,
>>
>> Yes, you can disable securing the API when writing integration tests
>> which run without IS. You can pass null value to the AuthzToken parameter
>> in such cases.
>>
>> I actually have listed the steps to follow when adding a new method to
>> the API with the secured API at
>> https://cwiki.apache.org/confluence/display/AIRAVATA/Developer+Documentation+for+Securing+Airavata+API
>> and linked from the jira issue
>> https://issues.apache.org/jira/browse/AIRAVATA-1624 when sending the
>> pull request.
>>
>> Please note that in this initial version, I have changed only the
>> getAPIVersion method and updated only the java stubs by running the script
>> with 'update java stubs' options. I will change all the other API methods
>> and to update other language client stubs in the same way, after the
>> feedback - if there is no any objections for that approach.
>>
>> Thanks & Best Regards,
>> Hasini.
>>
>>
>> On Tue, Jun 2, 2015 at 4:55 PM, Chathuri Wimalasena <kamalasini@gmail.com
>> > wrote:
>>
>>> Thanks Supun. I did the same in the CreateLaunchExperiment class. It
>>> fixed the issue.
>>>
>>> On Tue, Jun 2, 2015 at 4:47 PM, Supun Nakandala <
>>> supun.nakandala@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I had the same issue. There is a property in the
>>>> airavata-server.properties to disable security API changes(in the bottom
of
>>>> the file). Even if you disable that when invoking getAPIVersion method you
>>>> still have to send a  authzToken with some token value. I had to do
>>>> the below changes in PHP
>>>>
>>>>  $authzToken = new Airavata\Model\Security\AuthzToken();
>>>>  $authzToken->accessToken = "emptyToken";
>>>>  $apiVersion = Airavata::getAPIVersion($authzToken);
>>>>
>>>> I am not sure I am doing things correctly. But this fixed my issue.
>>>>
>>>>
>>>>
>>>> On Wed, Jun 3, 2015 at 2:09 AM, Chathuri Wimalasena <
>>>> kamalasini@gmail.com> wrote:
>>>>
>>>>> Hi Hasini,
>>>>>
>>>>> What are the steps to run airavata server with new APIToken changes.
>>>>> Is there a way we can disable the token for simple test cases ?
>>>>>
>>>>> When I try registerApplications from CreateLaunchExperiment class, I'm
>>>>> getting following error.
>>>>>
>>>>> Exception in thread "main"
>>>>> org.apache.thrift.protocol.TProtocolException: Required field 'authzToken'
>>>>> was not present! Struct: getAPIVersion_args(authzToken:null)
>>>>> at
>>>>> org.apache.airavata.api.Airavata$getAPIVersion_args.validate(Airavata.java:23451)
>>>>> at
>>>>> org.apache.airavata.api.Airavata$getAPIVersion_args$getAPIVersion_argsStandardScheme.write(Airavata.java:23514)
>>>>> at
>>>>> org.apache.airavata.api.Airavata$getAPIVersion_args$getAPIVersion_argsStandardScheme.write(Airavata.java:23481)
>>>>> at
>>>>> org.apache.airavata.api.Airavata$getAPIVersion_args.write(Airavata.java:23429)
>>>>> at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:63)
>>>>> at
>>>>> org.apache.airavata.api.Airavata$Client.send_getAPIVersion(Airavata.java:2106)
>>>>> at
>>>>> org.apache.airavata.api.Airavata$Client.getAPIVersion(Airavata.java:2098)
>>>>> at
>>>>> org.apache.airavata.client.samples.CreateLaunchExperiment.main(CreateLaunchExperiment.java:83)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>> at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>> at java.lang.reflect.Method.invoke(Method.java:483)
>>>>> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
>>>>>
>>>>> Thanks..
>>>>> Chathuri
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thank you
>>>> Supun Nakandala
>>>> Dept. Computer Science and Engineering
>>>> University of Moratuwa
>>>>
>>>
>>>
>>
>

Mime
View raw message