You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wave-dev@incubator.apache.org by Evan Hughes <wi...@apache.org> on 2016/12/24 07:52:53 UTC

Api & Client Rewrite

Hello All,

Just wanting to get some feedback from the community as I start rewriting
the client and the api behind it (to replace the Gwt code in the repo and
the current servlets).

http://localhost:9898/api/auth/login?format=json
http://localhost:9898/api/auth/login?format=protobuf
http://localhost:9898/api/auth/login    // defaults to the protobuf

currently using url's like the ones above with a response like:

{
  "email": true
}
which states that email authentication is available (allows us to add
oauth providers latter). The change of URL is due to using client side
frameworks (Angular 2) instead of GWT to achieve the UI which will be
at a non /api/ route. This also lets the server be more easily
configured to be of use to SwellRT and other projects as our client
isn't part of the backend anymore and the server is an abstract
element.Ive also made the source for this endpoint at
/wave/src/main/java/org/apache/wave/server/api/v1/LoginServlet.java so
that we can remove dead code as we transition into one naming scheme
instead of the 3 that exist atm.

~ Evan Hughes

Re: Api & Client Rewrite

Posted by Evan Hughes <eh...@gmail.com>.
1) The Json representation is made from the protobuf using proto3's json
form. So think of the proto files as a specification in essence and they do
reduce the data bandwidth needed and the amount of storage needed.

2) The atmosphere websockets implementation is a bit dated and can be
written using the java core websocket api. With sessions I believe just
checking a session still exists before sending or receiving on a websocket
will remove all the issues and we can close the socket at that time.

On Sat, 24 Dec 2016 at 20:16 Pablo Ojanguren <pa...@gmail.com> wrote:

Hi Evan,

That's cool. Two questions...

- Is there any advantage providing the API's data as protobuf insteand just
JSON? It might be easier just to provide the latest.
- It seems good idea to have a separated URL context for the API

Also, there are some improvements in SwellRT's servlets regarding session
management... that you could take for this effort.
I will be happy to discuss details of API's methods and messages.

Cheers

2016-12-24 8:52 GMT+01:00 Evan Hughes <wi...@apache.org>:

> Hello All,
>
> Just wanting to get some feedback from the community as I start rewriting
> the client and the api behind it (to replace the Gwt code in the repo and
> the current servlets).
>
> http://localhost:9898/api/auth/login?format=json
> http://localhost:9898/api/auth/login?format=protobuf
> http://localhost:9898/api/auth/login    // defaults to the protobuf
>
> currently using url's like the ones above with a response like:
>
> {
>   "email": true
> }
> which states that email authentication is available (allows us to add
> oauth providers latter). The change of URL is due to using client side
> frameworks (Angular 2) instead of GWT to achieve the UI which will be
> at a non /api/ route. This also lets the server be more easily
> configured to be of use to SwellRT and other projects as our client
> isn't part of the backend anymore and the server is an abstract
> element.Ive also made the source for this endpoint at
> /wave/src/main/java/org/apache/wave/server/api/v1/LoginServlet.java so
> that we can remove dead code as we transition into one naming scheme
> instead of the 3 that exist atm.
>
> ~ Evan Hughes
>

Re: Api & Client Rewrite

Posted by Pablo Ojanguren <pa...@gmail.com>.
Hi Evan,

That's cool. Two questions...

- Is there any advantage providing the API's data as protobuf insteand just
JSON? It might be easier just to provide the latest.
- It seems good idea to have a separated URL context for the API

Also, there are some improvements in SwellRT's servlets regarding session
management... that you could take for this effort.
I will be happy to discuss details of API's methods and messages.

Cheers

2016-12-24 8:52 GMT+01:00 Evan Hughes <wi...@apache.org>:

> Hello All,
>
> Just wanting to get some feedback from the community as I start rewriting
> the client and the api behind it (to replace the Gwt code in the repo and
> the current servlets).
>
> http://localhost:9898/api/auth/login?format=json
> http://localhost:9898/api/auth/login?format=protobuf
> http://localhost:9898/api/auth/login    // defaults to the protobuf
>
> currently using url's like the ones above with a response like:
>
> {
>   "email": true
> }
> which states that email authentication is available (allows us to add
> oauth providers latter). The change of URL is due to using client side
> frameworks (Angular 2) instead of GWT to achieve the UI which will be
> at a non /api/ route. This also lets the server be more easily
> configured to be of use to SwellRT and other projects as our client
> isn't part of the backend anymore and the server is an abstract
> element.Ive also made the source for this endpoint at
> /wave/src/main/java/org/apache/wave/server/api/v1/LoginServlet.java so
> that we can remove dead code as we transition into one naming scheme
> instead of the 3 that exist atm.
>
> ~ Evan Hughes
>

Re: Api & Client Rewrite

Posted by Pablo Ojanguren <pa...@gmail.com>.
@evan, of course, using proto format it is perfect.

2016-12-24 15:45 GMT+01:00 Evan Hughes <eh...@gmail.com>:

> @pablo though maybe json should be the standard since through the websocket
> trying every possible message would be a waste. I still think the proto
> format is a good specifier.
>
> On 24/12/2016 10:08 PM, "Evan Hughes" <eh...@gmail.com> wrote:
>
> > I believe it was in the works but cant hurt to add it to the jira as a
> > feature request.
> >
> > On Sat, 24 Dec 2016 at 22:04 Brandon Brinkley <br...@gmail.com>
> > wrote:
> >
> >> This is timely, as I have just recently renewed my interest in Wave with
> >> the idea of potentially bundling it with a few other services that could
> >> be
> >> useful for small teams (e.g. students, auditors, etc.). I haven't had a
> >> chance to look at it much yet, but I would want to either share the
> >> authentication, or at least be able to pass through the credentials.
> Also,
> >> I it would be useful to be authenticate against AD if that isn't already
> >> possible.
> >>
> >> Thanks!
> >> -Brandon
> >>
> >> On Saturday, December 24, 2016, Evan Hughes <wi...@apache.org>
> >> wrote:
> >>
> >> > Hello All,
> >> >
> >> > Just wanting to get some feedback from the community as I start
> >> rewriting
> >> > the client and the api behind it (to replace the Gwt code in the repo
> >> and
> >> > the current servlets).
> >> >
> >> > http://localhost:9898/api/auth/login?format=json
> >> > http://localhost:9898/api/auth/login?format=protobuf
> >> > http://localhost:9898/api/auth/login    // defaults to the protobuf
> >> >
> >> > currently using url's like the ones above with a response like:
> >> >
> >> > {
> >> >   "email": true
> >> > }
> >> > which states that email authentication is available (allows us to add
> >> > oauth providers latter). The change of URL is due to using client side
> >> > frameworks (Angular 2) instead of GWT to achieve the UI which will be
> >> > at a non /api/ route. This also lets the server be more easily
> >> > configured to be of use to SwellRT and other projects as our client
> >> > isn't part of the backend anymore and the server is an abstract
> >> > element.Ive also made the source for this endpoint at
> >> > /wave/src/main/java/org/apache/wave/server/api/v1/LoginServlet.java
> so
> >> > that we can remove dead code as we transition into one naming scheme
> >> > instead of the 3 that exist atm.
> >> >
> >> > ~ Evan Hughes
> >> >
> >>
> >>
> >> --
> >> Thanks!
> >> -Brandon
> >>
> >
>

Re: Api & Client Rewrite

Posted by Evan Hughes <eh...@gmail.com>.
@pablo though maybe json should be the standard since through the websocket
trying every possible message would be a waste. I still think the proto
format is a good specifier.

On 24/12/2016 10:08 PM, "Evan Hughes" <eh...@gmail.com> wrote:

> I believe it was in the works but cant hurt to add it to the jira as a
> feature request.
>
> On Sat, 24 Dec 2016 at 22:04 Brandon Brinkley <br...@gmail.com>
> wrote:
>
>> This is timely, as I have just recently renewed my interest in Wave with
>> the idea of potentially bundling it with a few other services that could
>> be
>> useful for small teams (e.g. students, auditors, etc.). I haven't had a
>> chance to look at it much yet, but I would want to either share the
>> authentication, or at least be able to pass through the credentials. Also,
>> I it would be useful to be authenticate against AD if that isn't already
>> possible.
>>
>> Thanks!
>> -Brandon
>>
>> On Saturday, December 24, 2016, Evan Hughes <wi...@apache.org>
>> wrote:
>>
>> > Hello All,
>> >
>> > Just wanting to get some feedback from the community as I start
>> rewriting
>> > the client and the api behind it (to replace the Gwt code in the repo
>> and
>> > the current servlets).
>> >
>> > http://localhost:9898/api/auth/login?format=json
>> > http://localhost:9898/api/auth/login?format=protobuf
>> > http://localhost:9898/api/auth/login    // defaults to the protobuf
>> >
>> > currently using url's like the ones above with a response like:
>> >
>> > {
>> >   "email": true
>> > }
>> > which states that email authentication is available (allows us to add
>> > oauth providers latter). The change of URL is due to using client side
>> > frameworks (Angular 2) instead of GWT to achieve the UI which will be
>> > at a non /api/ route. This also lets the server be more easily
>> > configured to be of use to SwellRT and other projects as our client
>> > isn't part of the backend anymore and the server is an abstract
>> > element.Ive also made the source for this endpoint at
>> > /wave/src/main/java/org/apache/wave/server/api/v1/LoginServlet.java so
>> > that we can remove dead code as we transition into one naming scheme
>> > instead of the 3 that exist atm.
>> >
>> > ~ Evan Hughes
>> >
>>
>>
>> --
>> Thanks!
>> -Brandon
>>
>

Re: Api & Client Rewrite

Posted by Evan Hughes <eh...@gmail.com>.
I believe it was in the works but cant hurt to add it to the jira as a
feature request.

On Sat, 24 Dec 2016 at 22:04 Brandon Brinkley <br...@gmail.com> wrote:

> This is timely, as I have just recently renewed my interest in Wave with
> the idea of potentially bundling it with a few other services that could be
> useful for small teams (e.g. students, auditors, etc.). I haven't had a
> chance to look at it much yet, but I would want to either share the
> authentication, or at least be able to pass through the credentials. Also,
> I it would be useful to be authenticate against AD if that isn't already
> possible.
>
> Thanks!
> -Brandon
>
> On Saturday, December 24, 2016, Evan Hughes <wi...@apache.org>
> wrote:
>
> > Hello All,
> >
> > Just wanting to get some feedback from the community as I start rewriting
> > the client and the api behind it (to replace the Gwt code in the repo and
> > the current servlets).
> >
> > http://localhost:9898/api/auth/login?format=json
> > http://localhost:9898/api/auth/login?format=protobuf
> > http://localhost:9898/api/auth/login    // defaults to the protobuf
> >
> > currently using url's like the ones above with a response like:
> >
> > {
> >   "email": true
> > }
> > which states that email authentication is available (allows us to add
> > oauth providers latter). The change of URL is due to using client side
> > frameworks (Angular 2) instead of GWT to achieve the UI which will be
> > at a non /api/ route. This also lets the server be more easily
> > configured to be of use to SwellRT and other projects as our client
> > isn't part of the backend anymore and the server is an abstract
> > element.Ive also made the source for this endpoint at
> > /wave/src/main/java/org/apache/wave/server/api/v1/LoginServlet.java so
> > that we can remove dead code as we transition into one naming scheme
> > instead of the 3 that exist atm.
> >
> > ~ Evan Hughes
> >
>
>
> --
> Thanks!
> -Brandon
>

Re: Api & Client Rewrite

Posted by Brandon Brinkley <br...@gmail.com>.
This is timely, as I have just recently renewed my interest in Wave with
the idea of potentially bundling it with a few other services that could be
useful for small teams (e.g. students, auditors, etc.). I haven't had a
chance to look at it much yet, but I would want to either share the
authentication, or at least be able to pass through the credentials. Also,
I it would be useful to be authenticate against AD if that isn't already
possible.

Thanks!
-Brandon

On Saturday, December 24, 2016, Evan Hughes <wi...@apache.org> wrote:

> Hello All,
>
> Just wanting to get some feedback from the community as I start rewriting
> the client and the api behind it (to replace the Gwt code in the repo and
> the current servlets).
>
> http://localhost:9898/api/auth/login?format=json
> http://localhost:9898/api/auth/login?format=protobuf
> http://localhost:9898/api/auth/login    // defaults to the protobuf
>
> currently using url's like the ones above with a response like:
>
> {
>   "email": true
> }
> which states that email authentication is available (allows us to add
> oauth providers latter). The change of URL is due to using client side
> frameworks (Angular 2) instead of GWT to achieve the UI which will be
> at a non /api/ route. This also lets the server be more easily
> configured to be of use to SwellRT and other projects as our client
> isn't part of the backend anymore and the server is an abstract
> element.Ive also made the source for this endpoint at
> /wave/src/main/java/org/apache/wave/server/api/v1/LoginServlet.java so
> that we can remove dead code as we transition into one naming scheme
> instead of the 3 that exist atm.
>
> ~ Evan Hughes
>


-- 
Thanks!
-Brandon