dmr.js

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

dmr.js

Heiko Braun


If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:

https://github.com/hal/dmr.js


Regards, Heiko
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Heiko Braun
Here's a code sample:


<script>
// access EC2 demo instance
http = new XMLHttpRequest();
http.withCredentials = true;
http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);

// async response handler
http.onreadystatechange =function()
{
    if (http.readyState==4 && http.status==200)
    {
        // decode response
        response = dmr.ModelNode.fromBase64(http.responseText);
        alert(response.get("result").asString());
    }
}

// content type headers for DMR API
http.setRequestHeader("Content-type","application/dmr-encoded");
http.setRequestHeader("Accept","application/dmr-encoded");

// create an operation
op = new dmr.ModelNode();
op.get("operation").set("read-attribute");
op.get("address").setEmptyList();
op.get("name").set("release-version");

// send as base64 encoded
http.send(op.toBase64String());

</script>


On Apr 8, 2013, at 1:20 PM, Heiko Braun <[hidden email]> wrote:



If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:

https://github.com/hal/dmr.js


Regards, Heiko
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev


_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Max Rydahl Andersen-2
This is cool - how does the authentication work/not work ?

Found this on github:
"It requires a patched AS7 instance if not running on the same host.
Some browsers require extra steps to get the authentication working, but Firefox should work out of the box."

http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html explains it a bit but
what is the patch needed for AS7 and with all these quirks do you think we can make it portable/usable for
writing a webapp that connects remotely ?

/max

On Tue, Apr 09, 2013 at 08:11:59AM +0200, Heiko Braun wrote:

>Here's a code sample:
>
>
><script>
>// access EC2 demo instance
>http = new XMLHttpRequest();
>http.withCredentials = true;
>http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);
>
>// async response handler
>http.onreadystatechange =function()
>{
>    if (http.readyState==4 && http.status==200)
>    {
>        // decode response
>        response = dmr.ModelNode.fromBase64(http.responseText);
>        alert(response.get("result").asString());
>    }
>}
>
>// content type headers for DMR API
>http.setRequestHeader("Content-type","application/dmr-encoded");
>http.setRequestHeader("Accept","application/dmr-encoded");
>
>// create an operation
>op = new dmr.ModelNode();
>op.get("operation").set("read-attribute");
>op.get("address").setEmptyList();
>op.get("name").set("release-version");
>
>// send as base64 encoded
>http.send(op.toBase64String());
>
></script>
>
>
>On Apr 8, 2013, at 1:20 PM, Heiko Braun <[hidden email]> wrote:
>
>>
>>
>> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
>>
>> https://github.com/hal/dmr.js
>>
>>
>> Regards, Heiko
>> _______________________________________________
>> jboss-as7-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>

>_______________________________________________
>jboss-as7-dev mailing list
>[hidden email]
>https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Tomaž Cerar-2


On Tue, Apr 9, 2013 at 1:01 PM, Max Rydahl Andersen <[hidden email]> wrote:
This is cool - how does the authentication work/not work ?

Found this on github:
"It requires a patched AS7 instance if not running on the same host.
Some browsers require extra steps to get the authentication working, but Firefox should work out of the box."

http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html explains it a bit but
what is the patch needed for AS7 and with all these quirks do you think we can make it portable/usable for
writing a webapp that connects remotely ?

/max

On Tue, Apr 09, 2013 at 08:11:59AM +0200, Heiko Braun wrote:
>Here's a code sample:
>
>
><script>
>// access EC2 demo instance
>http = new XMLHttpRequest();
>http.withCredentials = true;
>http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);
>
>// async response handler
>http.onreadystatechange =function()
>{
>    if (http.readyState==4 && http.status==200)
>    {
>        // decode response
>        response = dmr.ModelNode.fromBase64(http.responseText);
>        alert(response.get("result").asString());
>    }
>}
>
>// content type headers for DMR API
>http.setRequestHeader("Content-type","application/dmr-encoded");
>http.setRequestHeader("Accept","application/dmr-encoded");
>
>// create an operation
>op = new dmr.ModelNode();
>op.get("operation").set("read-attribute");
>op.get("address").setEmptyList();
>op.get("name").set("release-version");
>
>// send as base64 encoded
>http.send(op.toBase64String());
>
></script>
>
>
>On Apr 8, 2013, at 1:20 PM, Heiko Braun <[hidden email]> wrote:
>
>>
>>
>> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
>>
>> https://github.com/hal/dmr.js
>>
>>
>> Regards, Heiko
>> _______________________________________________
>> jboss-as7-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>

>_______________________________________________
>jboss-as7-dev mailing list
>[hidden email]
>https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev


_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Heiko Braun
In reply to this post by Max Rydahl Andersen-2


This problem basically breaks down into two pieces:

- support for CORS [1]: i.e. connect from host A to an EAP instance on host B
- a top of CORS: properly support the current HTTP authentication mechanism

The patch that Harald did submit, deals with CORS support in general, but leaves us with the authentication problem. Some browsers do not reveal this problem (like FF), because they don't correctly implement the CORS spec and allow for credentials to be submitted as part of the preflight requests. Others like recent Chrome browsers correctly implement it and thus do not work.

In order to solve the authentication problem, we need to revisit the overall HTTP authentication for the management layer. But speaking to Darran I can say that this is planned and I hope that we can positively influence the discussion to make these use cases work.


Regards, Heiko

[1] http://www.w3.org/TR/cors/




On Apr 9, 2013, at 1:01 PM, Max Rydahl Andersen <[hidden email]> wrote:

> This is cool - how does the authentication work/not work ?
>
> Found this on github:
> "It requires a patched AS7 instance if not running on the same host.
> Some browsers require extra steps to get the authentication working, but Firefox should work out of the box."
>
> http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html explains it a bit but
> what is the patch needed for AS7 and with all these quirks do you think we can make it portable/usable for writing a webapp that connects remotely ?
>
> /max
>
> On Tue, Apr 09, 2013 at 08:11:59AM +0200, Heiko Braun wrote:
>> Here's a code sample:
>>
>>
>> <script>
>> // access EC2 demo instance
>> http = new XMLHttpRequest();
>> http.withCredentials = true;
>> http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);
>>
>> // async response handler
>> http.onreadystatechange =function()
>> {
>>   if (http.readyState==4 && http.status==200)
>>   {
>>       // decode response
>>       response = dmr.ModelNode.fromBase64(http.responseText);
>>       alert(response.get("result").asString());
>>   }
>> }
>>
>> // content type headers for DMR API
>> http.setRequestHeader("Content-type","application/dmr-encoded");
>> http.setRequestHeader("Accept","application/dmr-encoded");
>>
>> // create an operation
>> op = new dmr.ModelNode();
>> op.get("operation").set("read-attribute");
>> op.get("address").setEmptyList();
>> op.get("name").set("release-version");
>>
>> // send as base64 encoded
>> http.send(op.toBase64String());
>>
>> </script>
>>
>>
>> On Apr 8, 2013, at 1:20 PM, Heiko Braun <[hidden email]> wrote:
>>
>>>
>>>
>>> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
>>>
>>> https://github.com/hal/dmr.js
>>>
>>>
>>> Regards, Heiko
>>> _______________________________________________
>>> jboss-as7-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>
>
>> _______________________________________________
>> jboss-as7-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>


_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Darran Lofthouse-2
On 09/04/13 13:19, Heiko Braun wrote:
> But speaking to Darran I can say that this is planned and I hope that we can positively influence the discussion to make these use cases work.

+1 Although we have always had a pending task to add true support for
cross origin requests we never actually had justification that they
would be used or were actually needed.

These changes in distribution and the dmr.js now provide that justification.

>
> Regards, Heiko
>
> [1] http://www.w3.org/TR/cors/
>
>
>
>
> On Apr 9, 2013, at 1:01 PM, Max Rydahl Andersen <[hidden email]> wrote:
>
>> This is cool - how does the authentication work/not work ?
>>
>> Found this on github:
>> "It requires a patched AS7 instance if not running on the same host.
>> Some browsers require extra steps to get the authentication working, but Firefox should work out of the box."
>>
>> http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html explains it a bit but
>> what is the patch needed for AS7 and with all these quirks do you think we can make it portable/usable for writing a webapp that connects remotely ?
>>
>> /max
>>
>> On Tue, Apr 09, 2013 at 08:11:59AM +0200, Heiko Braun wrote:
>>> Here's a code sample:
>>>
>>>
>>> <script>
>>> // access EC2 demo instance
>>> http = new XMLHttpRequest();
>>> http.withCredentials = true;
>>> http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);
>>>
>>> // async response handler
>>> http.onreadystatechange =function()
>>> {
>>>    if (http.readyState==4 && http.status==200)
>>>    {
>>>        // decode response
>>>        response = dmr.ModelNode.fromBase64(http.responseText);
>>>        alert(response.get("result").asString());
>>>    }
>>> }
>>>
>>> // content type headers for DMR API
>>> http.setRequestHeader("Content-type","application/dmr-encoded");
>>> http.setRequestHeader("Accept","application/dmr-encoded");
>>>
>>> // create an operation
>>> op = new dmr.ModelNode();
>>> op.get("operation").set("read-attribute");
>>> op.get("address").setEmptyList();
>>> op.get("name").set("release-version");
>>>
>>> // send as base64 encoded
>>> http.send(op.toBase64String());
>>>
>>> </script>
>>>
>>>
>>> On Apr 8, 2013, at 1:20 PM, Heiko Braun <[hidden email]> wrote:
>>>
>>>>
>>>>
>>>> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
>>>>
>>>> https://github.com/hal/dmr.js
>>>>
>>>>
>>>> Regards, Heiko
>>>> _______________________________________________
>>>> jboss-as7-dev mailing list
>>>> [hidden email]
>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>
>>
>>> _______________________________________________
>>> jboss-as7-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>
>
>
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>

--
Darran Lofthouse - Principal Software Engineer

Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham (USA), Mark Hegarty (Ireland), Matt Parson
(USA), Charlie Peters (USA)
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Heiko Braun
I am glad to hear that. 

With regard to the authentication changes:
Do you have anything particular in mind? We've been looking into OAuth2 [1], which looks like a reasonable replacement at a first glance.




On Apr 9, 2013, at 2:23 PM, Darran Lofthouse <[hidden email]> wrote:

+1 Although we have always had a pending task to add true support for 
cross origin requests we never actually had justification that they 
would be used or were actually needed.

These changes in distribution and the dmr.js now provide that justification.




_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

David Lloyd-2
In reply to this post by Heiko Braun
On 04/08/2013 06:20 AM, Heiko Braun wrote:
>
>
> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
>
> https://github.com/hal/dmr.js

So we'd rather use DMR from JS than JSON?  I think I just stepped into
Bizarro world :)


--
- DML
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Heiko Braun
Not bizarre at all. Have you ever tried to create a DMR operation in JSON? Reading data from the management layer is fine in JSON, but constructing and executing operations in JSON is PITA, if possible at all.

Hence the plain JS port of the lib we use in GWT. The real intention was to provide an integration option for hawt.io.

Does it makes sense?

On Apr 9, 2013, at 2:54 PM, "David M. Lloyd" <[hidden email]> wrote:

So we'd rather use DMR from JS than JSON?  I think I just stepped into 
Bizarro world :)


_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Max Rydahl Andersen-2
In reply to this post by Heiko Braun
I just want to say this all looks very awesome and hope it can
be made to work reliable in browsers.

/max

On Tue, Apr 09, 2013 at 02:29:17PM +0200, Heiko Braun wrote:

>I am glad to hear that.
>
>With regard to the authentication changes:
>Do you have anything particular in mind? We've been looking into OAuth2 [1], which looks like a reasonable replacement at a first glance.
>
>
>[1] http://tools.ietf.org/html/rfc6749
>
>
>On Apr 9, 2013, at 2:23 PM, Darran Lofthouse <[hidden email]> wrote:
>
>> +1 Although we have always had a pending task to add true support for
>> cross origin requests we never actually had justification that they
>> would be used or were actually needed.
>>
>> These changes in distribution and the dmr.js now provide that justification.
>>
>>
>

>_______________________________________________
>jboss-as7-dev mailing list
>[hidden email]
>https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

David Lloyd-2
In reply to this post by Heiko Braun
Are you talking about creating JSON from GWT Java code or from JS
itself?  If the latter, yes I am surprised that creating JSON from JS is
difficult, and even more surprised that using DMR would be simpler.

If operations in JS do not work then we have a bug IMO.

On 04/09/2013 07:58 AM, Heiko Braun wrote:

> Not bizarre at all. Have you ever tried to create a DMR operation in
> JSON? Reading data from the management layer is fine in JSON, but
> constructing and executing operations in JSON is PITA, if possible at all.
>
> Hence the plain JS port of the lib we use in GWT. The real intention was
> to provide an integration option for hawt.io.
>
> Does it makes sense?
>
> On Apr 9, 2013, at 2:54 PM, "David M. Lloyd" <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>> So we'd rather use DMR from JS than JSON?  I think I just stepped into
>> Bizarro world :)
>


--
- DML
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Jason T. Greene
In reply to this post by Max Rydahl Andersen-2
Just to be extra clear. Transparent / silent local authentication which is handled by the native protocol requires that the client implement the auth protocol. This is not possible from a web browser since JS code is not allowed to read arbitrary files. So for this reason we do not have support for it over http.

On Apr 9, 2013, at 6:03 AM, Max Rydahl Andersen <[hidden email]> wrote:

> This is cool - how does the authentication work/not work ?
>
> Found this on github:
> "It requires a patched AS7 instance if not running on the same host.
> Some browsers require extra steps to get the authentication working, but Firefox should work out of the box."
>
> http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html explains it a bit but
> what is the patch needed for AS7 and with all these quirks do you think we can make it portable/usable for
> writing a webapp that connects remotely ?
>
> /max
>
> On Tue, Apr 09, 2013 at 08:11:59AM +0200, Heiko Braun wrote:
>> Here's a code sample:
>>
>>
>> <script>
>> // access EC2 demo instance
>> http = new XMLHttpRequest();
>> http.withCredentials = true;
>> http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);
>>
>> // async response handler
>> http.onreadystatechange =function()
>> {
>>   if (http.readyState==4 && http.status==200)
>>   {
>>       // decode response
>>       response = dmr.ModelNode.fromBase64(http.responseText);
>>       alert(response.get("result").asString());
>>   }
>> }
>>
>> // content type headers for DMR API
>> http.setRequestHeader("Content-type","application/dmr-encoded");
>> http.setRequestHeader("Accept","application/dmr-encoded");
>>
>> // create an operation
>> op = new dmr.ModelNode();
>> op.get("operation").set("read-attribute");
>> op.get("address").setEmptyList();
>> op.get("name").set("release-version");
>>
>> // send as base64 encoded
>> http.send(op.toBase64String());
>>
>> </script>
>>
>>
>> On Apr 8, 2013, at 1:20 PM, Heiko Braun <[hidden email]> wrote:
>>
>>>
>>>
>>> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
>>>
>>> https://github.com/hal/dmr.js
>>>
>>>
>>> Regards, Heiko
>>> _______________________________________________
>>> jboss-as7-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>
>> _______________________________________________
>> jboss-as7-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Max Rydahl Andersen-2
On Tue, Apr 09, 2013 at 12:01:47PM -0400, Jason Greene wrote:
>Just to be extra clear. Transparent / silent local authentication which is handled by the native protocol requires that the client implement the auth protocol. This is not possible from a web browser since JS code is not allowed to read arbitrary files. So for this reason we do not have support for it over http.

Yes, but a java client could so it would be great for us - would have avoided us from remoting binary bugs in tooling.

This of course assumes there are less compatibility bugs in the autentication layer than in remoting :)

/max

>On Apr 9, 2013, at 6:03 AM, Max Rydahl Andersen <[hidden email]> wrote:
>
>> This is cool - how does the authentication work/not work ?
>>
>> Found this on github:
>> "It requires a patched AS7 instance if not running on the same host.
>> Some browsers require extra steps to get the authentication working, but Firefox should work out of the box."
>>
>> http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html explains it a bit but
>> what is the patch needed for AS7 and with all these quirks do you think we can make it portable/usable for
>> writing a webapp that connects remotely ?
>>
>> /max
>>
>> On Tue, Apr 09, 2013 at 08:11:59AM +0200, Heiko Braun wrote:
>>> Here's a code sample:
>>>
>>>
>>> <script>
>>> // access EC2 demo instance
>>> http = new XMLHttpRequest();
>>> http.withCredentials = true;
>>> http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);
>>>
>>> // async response handler
>>> http.onreadystatechange =function()
>>> {
>>>   if (http.readyState==4 && http.status==200)
>>>   {
>>>       // decode response
>>>       response = dmr.ModelNode.fromBase64(http.responseText);
>>>       alert(response.get("result").asString());
>>>   }
>>> }
>>>
>>> // content type headers for DMR API
>>> http.setRequestHeader("Content-type","application/dmr-encoded");
>>> http.setRequestHeader("Accept","application/dmr-encoded");
>>>
>>> // create an operation
>>> op = new dmr.ModelNode();
>>> op.get("operation").set("read-attribute");
>>> op.get("address").setEmptyList();
>>> op.get("name").set("release-version");
>>>
>>> // send as base64 encoded
>>> http.send(op.toBase64String());
>>>
>>> </script>
>>>
>>>
>>> On Apr 8, 2013, at 1:20 PM, Heiko Braun <[hidden email]> wrote:
>>>
>>>>
>>>>
>>>> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
>>>>
>>>> https://github.com/hal/dmr.js
>>>>
>>>>
>>>> Regards, Heiko
>>>> _______________________________________________
>>>> jboss-as7-dev mailing list
>>>> [hidden email]
>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>
>>> _______________________________________________
>>> jboss-as7-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>
>> _______________________________________________
>> jboss-as7-dev mailing list
>> [hidden email]
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Jason T. Greene
Well last time you didn't like the low level JSON interface (e.g. no deployment API that wraps it, uploads require an http upload and a management op).

You also would have to implement the auth protocol yourself. As to the http server side, we take patches! :)

On Apr 10, 2013, at 7:56 AM, Max Rydahl Andersen <[hidden email]> wrote:

> On Tue, Apr 09, 2013 at 12:01:47PM -0400, Jason Greene wrote:
>> Just to be extra clear. Transparent / silent local authentication which is handled by the native protocol requires that the client implement the auth protocol. This is not possible from a web browser since JS code is not allowed to read arbitrary files. So for this reason we do not have support for it over http.
>
> Yes, but a java client could so it would be great for us - would have avoided us from remoting binary bugs in tooling.
>
> This of course assumes there are less compatibility bugs in the autentication layer than in remoting :)
>
> /max
>
>> On Apr 9, 2013, at 6:03 AM, Max Rydahl Andersen <[hidden email]> wrote:
>>
>>> This is cool - how does the authentication work/not work ?
>>>
>>> Found this on github:
>>> "It requires a patched AS7 instance if not running on the same host.
>>> Some browsers require extra steps to get the authentication working, but Firefox should work out of the box."
>>>
>>> http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html explains it a bit but
>>> what is the patch needed for AS7 and with all these quirks do you think we can make it portable/usable for
>>> writing a webapp that connects remotely ?
>>>
>>> /max
>>>
>>> On Tue, Apr 09, 2013 at 08:11:59AM +0200, Heiko Braun wrote:
>>>> Here's a code sample:
>>>>
>>>>
>>>> <script>
>>>> // access EC2 demo instance
>>>> http = new XMLHttpRequest();
>>>> http.withCredentials = true;
>>>> http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);
>>>>
>>>> // async response handler
>>>> http.onreadystatechange =function()
>>>> {
>>>>  if (http.readyState==4 && http.status==200)
>>>>  {
>>>>      // decode response
>>>>      response = dmr.ModelNode.fromBase64(http.responseText);
>>>>      alert(response.get("result").asString());
>>>>  }
>>>> }
>>>>
>>>> // content type headers for DMR API
>>>> http.setRequestHeader("Content-type","application/dmr-encoded");
>>>> http.setRequestHeader("Accept","application/dmr-encoded");
>>>>
>>>> // create an operation
>>>> op = new dmr.ModelNode();
>>>> op.get("operation").set("read-attribute");
>>>> op.get("address").setEmptyList();
>>>> op.get("name").set("release-version");
>>>>
>>>> // send as base64 encoded
>>>> http.send(op.toBase64String());
>>>>
>>>> </script>
>>>>
>>>>
>>>> On Apr 8, 2013, at 1:20 PM, Heiko Braun <[hidden email]> wrote:
>>>>
>>>>>
>>>>>
>>>>> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
>>>>>
>>>>> https://github.com/hal/dmr.js
>>>>>
>>>>>
>>>>> Regards, Heiko
>>>>> _______________________________________________
>>>>> jboss-as7-dev mailing list
>>>>> [hidden email]
>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>
>>>> _______________________________________________
>>>> jboss-as7-dev mailing list
>>>> [hidden email]
>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>
>>> _______________________________________________
>>> jboss-as7-dev mailing list
>>> [hidden email]
>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Max Rydahl Andersen-2
On Wed, Apr 10, 2013 at 09:44:15AM -0400, Jason Greene wrote:
>Well last time you didn't like the low level JSON interface (e.g. no deployment API that wraps it, uploads require an http upload and a management op).

Yes, I was hoping the management client could wrap it ;)

anyways, I prefer a more manual API if it unties us from having to bundle multiple versions of the client library which was the case a few times now.

All a balancing act.

>You also would have to implement the auth protocol yourself. As to the http server side, we take patches! :)

Got any pointers ? :)

/max

>On Apr 10, 2013, at 7:56 AM, Max Rydahl Andersen <[hidden email]> wrote:
>
>> On Tue, Apr 09, 2013 at 12:01:47PM -0400, Jason Greene wrote:
>>> Just to be extra clear. Transparent / silent local authentication which is handled by the native protocol requires that the client implement the auth protocol. This is not possible from a web browser since JS code is not allowed to read arbitrary files. So for this reason we do not have support for it over http.
>>
>> Yes, but a java client could so it would be great for us - would have avoided us from remoting binary bugs in tooling.
>>
>> This of course assumes there are less compatibility bugs in the autentication layer than in remoting :)
>>
>> /max
>>
>>> On Apr 9, 2013, at 6:03 AM, Max Rydahl Andersen <[hidden email]> wrote:
>>>
>>>> This is cool - how does the authentication work/not work ?
>>>>
>>>> Found this on github:
>>>> "It requires a patched AS7 instance if not running on the same host.
>>>> Some browsers require extra steps to get the authentication working, but Firefox should work out of the box."
>>>>
>>>> http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html explains it a bit but
>>>> what is the patch needed for AS7 and with all these quirks do you think we can make it portable/usable for
>>>> writing a webapp that connects remotely ?
>>>>
>>>> /max
>>>>
>>>> On Tue, Apr 09, 2013 at 08:11:59AM +0200, Heiko Braun wrote:
>>>>> Here's a code sample:
>>>>>
>>>>>
>>>>> <script>
>>>>> // access EC2 demo instance
>>>>> http = new XMLHttpRequest();
>>>>> http.withCredentials = true;
>>>>> http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);
>>>>>
>>>>> // async response handler
>>>>> http.onreadystatechange =function()
>>>>> {
>>>>>  if (http.readyState==4 && http.status==200)
>>>>>  {
>>>>>      // decode response
>>>>>      response = dmr.ModelNode.fromBase64(http.responseText);
>>>>>      alert(response.get("result").asString());
>>>>>  }
>>>>> }
>>>>>
>>>>> // content type headers for DMR API
>>>>> http.setRequestHeader("Content-type","application/dmr-encoded");
>>>>> http.setRequestHeader("Accept","application/dmr-encoded");
>>>>>
>>>>> // create an operation
>>>>> op = new dmr.ModelNode();
>>>>> op.get("operation").set("read-attribute");
>>>>> op.get("address").setEmptyList();
>>>>> op.get("name").set("release-version");
>>>>>
>>>>> // send as base64 encoded
>>>>> http.send(op.toBase64String());
>>>>>
>>>>> </script>
>>>>>
>>>>>
>>>>> On Apr 8, 2013, at 1:20 PM, Heiko Braun <[hidden email]> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
>>>>>>
>>>>>> https://github.com/hal/dmr.js
>>>>>>
>>>>>>
>>>>>> Regards, Heiko
>>>>>> _______________________________________________
>>>>>> jboss-as7-dev mailing list
>>>>>> [hidden email]
>>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>
>>>>> _______________________________________________
>>>>> jboss-as7-dev mailing list
>>>>> [hidden email]
>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>
>>>> _______________________________________________
>>>> jboss-as7-dev mailing list
>>>> [hidden email]
>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Jason T. Greene


Sent from my iPhone

On Apr 22, 2013, at 6:33 AM, Max Rydahl Andersen <[hidden email]> wrote:

> On Wed, Apr 10, 2013 at 09:44:15AM -0400, Jason Greene wrote:
>> Well last time you didn't like the low level JSON interface (e.g. no deployment API that wraps it, uploads require an http upload and a management op).
>
> Yes, I was hoping the management client could wrap it ;)

Doesn't that defeat the purpose of a REStish API?


>
> anyways, I prefer a more manual API if it unties us from having to bundle multiple versions of the client library which was the case a few times now.

Weren't the issues fixed, on and you can use one client library?


>
> All a balancing act.
>
>> You also would have to implement the auth protocol yourself. As to the http server side, we take patches! :)
>
> Got any pointers ? :)

The source code to jboss SASL.

>
> /max
>
>> On Apr 10, 2013, at 7:56 AM, Max Rydahl Andersen <[hidden email]> wrote:
>>
>>> On Tue, Apr 09, 2013 at 12:01:47PM -0400, Jason Greene wrote:
>>>> Just to be extra clear. Transparent / silent local authentication which is handled by the native protocol requires that the client implement the auth protocol. This is not possible from a web browser since JS code is not allowed to read arbitrary files. So for this reason we do not have support for it over http.
>>>
>>> Yes, but a java client could so it would be great for us - would have avoided us from remoting binary bugs in tooling.
>>>
>>> This of course assumes there are less compatibility bugs in the autentication layer than in remoting :)
>>>
>>> /max
>>>
>>>> On Apr 9, 2013, at 6:03 AM, Max Rydahl Andersen <[hidden email]> wrote:
>>>>
>>>>> This is cool - how does the authentication work/not work ?
>>>>>
>>>>> Found this on github:
>>>>> "It requires a patched AS7 instance if not running on the same host.
>>>>> Some browsers require extra steps to get the authentication working, but Firefox should work out of the box."
>>>>>
>>>>> http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html explains it a bit but
>>>>> what is the patch needed for AS7 and with all these quirks do you think we can make it portable/usable for
>>>>> writing a webapp that connects remotely ?
>>>>>
>>>>> /max
>>>>>
>>>>> On Tue, Apr 09, 2013 at 08:11:59AM +0200, Heiko Braun wrote:
>>>>>> Here's a code sample:
>>>>>>
>>>>>>
>>>>>> <script>
>>>>>> // access EC2 demo instance
>>>>>> http = new XMLHttpRequest();
>>>>>> http.withCredentials = true;
>>>>>> http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);
>>>>>>
>>>>>> // async response handler
>>>>>> http.onreadystatechange =function()
>>>>>> {
>>>>>> if (http.readyState==4 && http.status==200)
>>>>>> {
>>>>>>     // decode response
>>>>>>     response = dmr.ModelNode.fromBase64(http.responseText);
>>>>>>     alert(response.get("result").asString());
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> // content type headers for DMR API
>>>>>> http.setRequestHeader("Content-type","application/dmr-encoded");
>>>>>> http.setRequestHeader("Accept","application/dmr-encoded");
>>>>>>
>>>>>> // create an operation
>>>>>> op = new dmr.ModelNode();
>>>>>> op.get("operation").set("read-attribute");
>>>>>> op.get("address").setEmptyList();
>>>>>> op.get("name").set("release-version");
>>>>>>
>>>>>> // send as base64 encoded
>>>>>> http.send(op.toBase64String());
>>>>>>
>>>>>> </script>
>>>>>>
>>>>>>
>>>>>> On Apr 8, 2013, at 1:20 PM, Heiko Braun <[hidden email]> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
>>>>>>>
>>>>>>> https://github.com/hal/dmr.js
>>>>>>>
>>>>>>>
>>>>>>> Regards, Heiko
>>>>>>> _______________________________________________
>>>>>>> jboss-as7-dev mailing list
>>>>>>> [hidden email]
>>>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>>
>>>>>> _______________________________________________
>>>>>> jboss-as7-dev mailing list
>>>>>> [hidden email]
>>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>>
>>>>> _______________________________________________
>>>>> jboss-as7-dev mailing list
>>>>> [hidden email]
>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: dmr.js

Max Rydahl Andersen-2
On Mon, Apr 22, 2013 at 08:34:55AM -0400, Jason Greene wrote:
>>> Well last time you didn't like the low level JSON interface (e.g. no deployment API that wraps it, uploads require an http upload and a management op).
>>
>> Yes, I was hoping the management client could wrap it ;)
>
>Doesn't that defeat the purpose of a REStish API?

Not really since we call from Java we still need "something" to wrap the url calls - wether that is the management client our our own code does make much sense.

>> anyways, I prefer a more manual API if it unties us from having to bundle multiple versions of the client library which was the case a few times now.
>
>Weren't the issues fixed, on and you can use one client library?

We are down to two I believe - one for 7.0.0 and another one for all others.

Yes it is better and fixed for now.

But once we hit AS8/AS9/EAP7 etc. will that continue ?

And as long as early releases of AS/EAP gets released
at a different schedule than tooling (which is expected) we'll always have this challenge and i'm just trying
to see if we can find an approach where we on the tooling side can handle these small bumps better than having
to rush around trying to add in mixed set of binaries to support an early beta/alpha release.

/max

>
>>
>> All a balancing act.
>>
>>> You also would have to implement the auth protocol yourself. As to the http server side, we take patches! :)
>>
>> Got any pointers ? :)
>
>The source code to jboss SASL.
>
>>
>> /max
>>
>>> On Apr 10, 2013, at 7:56 AM, Max Rydahl Andersen <[hidden email]> wrote:
>>>
>>>> On Tue, Apr 09, 2013 at 12:01:47PM -0400, Jason Greene wrote:
>>>>> Just to be extra clear. Transparent / silent local authentication which is handled by the native protocol requires that the client implement the auth protocol. This is not possible from a web browser since JS code is not allowed to read arbitrary files. So for this reason we do not have support for it over http.
>>>>
>>>> Yes, but a java client could so it would be great for us - would have avoided us from remoting binary bugs in tooling.
>>>>
>>>> This of course assumes there are less compatibility bugs in the autentication layer than in remoting :)
>>>>
>>>> /max
>>>>
>>>>> On Apr 9, 2013, at 6:03 AM, Max Rydahl Andersen <[hidden email]> wrote:
>>>>>
>>>>>> This is cool - how does the authentication work/not work ?
>>>>>>
>>>>>> Found this on github:
>>>>>> "It requires a patched AS7 instance if not running on the same host.
>>>>>> Some browsers require extra steps to get the authentication working, but Firefox should work out of the box."
>>>>>>
>>>>>> http://haraldpehl.blogspot.de/2013/03/independent-jboss-admin-console.html explains it a bit but
>>>>>> what is the patch needed for AS7 and with all these quirks do you think we can make it portable/usable for
>>>>>> writing a webapp that connects remotely ?
>>>>>>
>>>>>> /max
>>>>>>
>>>>>> On Tue, Apr 09, 2013 at 08:11:59AM +0200, Heiko Braun wrote:
>>>>>>> Here's a code sample:
>>>>>>>
>>>>>>>
>>>>>>> <script>
>>>>>>> // access EC2 demo instance
>>>>>>> http = new XMLHttpRequest();
>>>>>>> http.withCredentials = true;
>>>>>>> http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);
>>>>>>>
>>>>>>> // async response handler
>>>>>>> http.onreadystatechange =function()
>>>>>>> {
>>>>>>> if (http.readyState==4 && http.status==200)
>>>>>>> {
>>>>>>>     // decode response
>>>>>>>     response = dmr.ModelNode.fromBase64(http.responseText);
>>>>>>>     alert(response.get("result").asString());
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> // content type headers for DMR API
>>>>>>> http.setRequestHeader("Content-type","application/dmr-encoded");
>>>>>>> http.setRequestHeader("Accept","application/dmr-encoded");
>>>>>>>
>>>>>>> // create an operation
>>>>>>> op = new dmr.ModelNode();
>>>>>>> op.get("operation").set("read-attribute");
>>>>>>> op.get("address").setEmptyList();
>>>>>>> op.get("name").set("release-version");
>>>>>>>
>>>>>>> // send as base64 encoded
>>>>>>> http.send(op.toBase64String());
>>>>>>>
>>>>>>> </script>
>>>>>>>
>>>>>>>
>>>>>>> On Apr 8, 2013, at 1:20 PM, Heiko Braun <[hidden email]> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
>>>>>>>>
>>>>>>>> https://github.com/hal/dmr.js
>>>>>>>>
>>>>>>>>
>>>>>>>> Regards, Heiko
>>>>>>>> _______________________________________________
>>>>>>>> jboss-as7-dev mailing list
>>>>>>>> [hidden email]
>>>>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>>>
>>>>>>> _______________________________________________
>>>>>>> jboss-as7-dev mailing list
>>>>>>> [hidden email]
>>>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>>>>
>>>>>> _______________________________________________
>>>>>> jboss-as7-dev mailing list
>>>>>> [hidden email]
>>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev