Discussion:
[urbit] First roadblock in an IDE as a service for urbit. Restful endpoint support.
Jeremy Wall
2015-11-25 03:17:44 UTC
Permalink
So it doesn't appear that there is a clean way to set up urbit to handle
restful api endpoints.

i.e. I can tell urbit to handle this url, method with this code. And have
that code get access to the payload in the body of that request if it is
say a post or put request.

Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-25 03:22:00 UTC
Permalink
Correct. There is a way to send a json post anonymously to an app(and get a
nice/mean), or there is a way to access the query string from a hook file.

I suppose crashing in the app and sticking JSON in the stateless "error"
might work?
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit to handle
restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code. And have
that code get access to the payload in the body of that request if it is
say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Galen Wolfe-Pauly
2015-11-25 03:27:52 UTC
Permalink
I wonder whether we have made a design error here. It’s nice to be able to treat all HTTP requests as comets — but there are likely devices that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an app(and get a nice/mean), or there is a way to access the query string from a hook file.
I suppose crashing in the app and sticking JSON in the stateless "error" might work?
So it doesn't appear that there is a clean way to set up urbit to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code. And have that code get access to the payload in the body of that request if it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com <http://jeremy.marzhillstudios.com/>
--
You received this message because you are subscribed to the Google Groups "urbit" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "urbit" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-11-25 03:31:43 UTC
Permalink
We can still treat http requests as comets as long as the token/cookie and
process for getting/using one is well documented.
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice to be able
to treat all HTTP requests as comets — but there are likely devices that
want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an app(and get
a nice/mean), or there is a way to access the query string from a hook file.
I suppose crashing in the app and sticking JSON in the stateless "error" might work?
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit to handle
restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code. And have
that code get access to the payload in the body of that request if it is
say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-25 05:11:31 UTC
Permalink
To mirror chat: http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was
private doc and may be lost with the ship etc.

The /~/to endpoint also accepts wire and oryx as query string parameters,
in which case the entire post body is treated as the message. The query
string can also contain 'anon', which obviates the need for an oryx
parameter.
Post by Jeremy Wall
We can still treat http requests as comets as long as the token/cookie and
process for getting/using one is well documented.
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice to be able
to treat all HTTP requests as comets — but there are likely devices that
want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an app(and get
a nice/mean), or there is a way to access the query string from a hook file.
I suppose crashing in the app and sticking JSON in the stateless "error" might work?
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit to handle
restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code. And
have that code get access to the payload in the body of that request if it
is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an
.
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-11-27 23:02:33 UTC
Permalink
Hey Anton,

I've been reading your spec and playing with curl for a bit attempting to
manually succeed in a handshake. It looks to me like you should be able
authenticate using a POST /~/auth.json?PUT with a payload containing the
csrf token, ship name and code. However I can't figure out how you get the
csrf token to start with. It seems like a bit of a chicken and an egg
problem to me. It won't let you resuse the oryx from a GEt /~/auth.json so
that won't work according to my testing.
Post by Anton Dyudin
To mirror chat: http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was private doc and may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string parameters,
in which case the entire post body is treated as the message. The query
string can also contain 'anon', which obviates the need for an oryx
parameter.
Post by Jeremy Wall
We can still treat http requests as comets as long as the token/cookie
and process for getting/using one is well documented.
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice to be able
to treat all HTTP requests as comets — but there are likely devices that
want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an app(and
get a nice/mean), or there is a way to access the query string from a hook
file.
I suppose crashing in the app and sticking JSON in the stateless "error" might work?
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit to
handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code. And
have that code get access to the payload in the body of that request if it
is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-28 00:15:44 UTC
Permalink
What precisely do you mean by "won't let you reuse"? Is it crashing on some
specific assert, or printing an error?

%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have the latter).
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit attempting to
manually succeed in a handshake. It looks to me like you should be able
authenticate using a POST /~/auth.json?PUT with a payload containing the
csrf token, ship name and code. However I can't figure out how you get the
csrf token to start with. It seems like a bit of a chicken and an egg
problem to me. It won't let you resuse the oryx from a GEt /~/auth.json so
that won't work according to my testing.
Post by Anton Dyudin
To mirror chat: http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was private doc and may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string parameters,
in which case the entire post body is treated as the message. The query
string can also contain 'anon', which obviates the need for an oryx
parameter.
Post by Jeremy Wall
We can still treat http requests as comets as long as the token/cookie
and process for getting/using one is well documented.
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice to be
able to treat all HTTP requests as comets — but there are likely devices
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an app(and
get a nice/mean), or there is a way to access the query string from a hook
file.
I suppose crashing in the app and sticking JSON in the stateless "error" might work?
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit to
handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code. And
have that code get access to the payload in the body of that request if it
is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-11-28 00:21:53 UTC
Permalink
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing on
some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have the latter).
This is all happening with curl.

I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is there a
url you hit to drop the cookie that you then use when you authenticate?
Post by Anton Dyudin
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit attempting to
manually succeed in a handshake. It looks to me like you should be able
authenticate using a POST /~/auth.json?PUT with a payload containing the
csrf token, ship name and code. However I can't figure out how you get the
csrf token to start with. It seems like a bit of a chicken and an egg
problem to me. It won't let you resuse the oryx from a GEt /~/auth.json so
that won't work according to my testing.
Post by Anton Dyudin
To mirror chat: http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was private doc and may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as the
message. The query string can also contain 'anon', which obviates the need
for an oryx parameter.
Post by Jeremy Wall
We can still treat http requests as comets as long as the token/cookie
and process for getting/using one is well documented.
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice to be
able to treat all HTTP requests as comets — but there are likely devices
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an app(and
get a nice/mean), or there is a way to access the query string from a hook
file.
I suppose crashing in the app and sticking JSON in the stateless
"error" might work?
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit to
handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code. And
have that code get access to the payload in the body of that request if it
is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-28 00:31:16 UTC
Permalink
You're right, that should only happen on requests actually making use of
it. Any random auth.json oryx should in fact work for auth.json PUT
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing on
some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is there a
url you hit to drop the cookie that you then use when you authenticate?
Post by Anton Dyudin
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit attempting
to manually succeed in a handshake. It looks to me like you should be able
authenticate using a POST /~/auth.json?PUT with a payload containing the
csrf token, ship name and code. However I can't figure out how you get the
csrf token to start with. It seems like a bit of a chicken and an egg
problem to me. It won't let you resuse the oryx from a GEt /~/auth.json so
that won't work according to my testing.
Post by Anton Dyudin
To mirror chat: http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was private doc and may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as the
message. The query string can also contain 'anon', which obviates the need
for an oryx parameter.
Post by Jeremy Wall
We can still treat http requests as comets as long as the token/cookie
and process for getting/using one is well documented.
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice to be
able to treat all HTTP requests as comets — but there are likely devices
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an app(and
get a nice/mean), or there is a way to access the query string from a hook
file.
I suppose crashing in the app and sticking JSON in the stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall <
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit to
handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code. And
have that code get access to the payload in the body of that request if it
is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-11-28 01:09:46 UTC
Permalink
For reference this script with curl and jq does not work:

#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just grabs
the oryx from this request.

genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}

echo $(genpayload $oryx)

#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT

Given what you just said and what I think I understand from the spec doc I
would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use of
it. Any random auth.json oryx should in fact work for auth.json PUT
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing on
some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is there a
url you hit to drop the cookie that you then use when you authenticate?
Post by Anton Dyudin
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit attempting
to manually succeed in a handshake. It looks to me like you should be able
authenticate using a POST /~/auth.json?PUT with a payload containing the
csrf token, ship name and code. However I can't figure out how you get the
csrf token to start with. It seems like a bit of a chicken and an egg
problem to me. It won't let you resuse the oryx from a GEt /~/auth.json so
that won't work according to my testing.
Post by Anton Dyudin
To mirror chat: http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was private doc and may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as the
message. The query string can also contain 'anon', which obviates the need
for an oryx parameter.
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well documented.
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice to be
able to treat all HTTP requests as comets — but there are likely devices
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an
app(and get a nice/mean), or there is a way to access the query string from
a hook file.
I suppose crashing in the app and sticking JSON in the stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall <
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit to
handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code.
And have that code get access to the payload in the body of that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-11-28 01:17:29 UTC
Permalink
Actually never mind. I think I just figured it out. My bash-fu was lacking
:-p
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just grabs
the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the spec doc I
would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use of
it. Any random auth.json oryx should in fact work for auth.json PUT
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing on
some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is there a
url you hit to drop the cookie that you then use when you authenticate?
Post by Anton Dyudin
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit attempting
to manually succeed in a handshake. It looks to me like you should be able
authenticate using a POST /~/auth.json?PUT with a payload containing the
csrf token, ship name and code. However I can't figure out how you get the
csrf token to start with. It seems like a bit of a chicken and an egg
problem to me. It won't let you resuse the oryx from a GEt /~/auth.json so
that won't work according to my testing.
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was private
doc and may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as the
message. The query string can also contain 'anon', which obviates the need
for an oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall <
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well documented.
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice to be
able to treat all HTTP requests as comets — but there are likely devices
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an
app(and get a nice/mean), or there is a way to access the query string from
a hook file.
I suppose crashing in the app and sticking JSON in the stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall <
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit to
handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code.
And have that code get access to the payload in the body of that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-11-28 01:50:25 UTC
Permalink
For folks who want to follow along I'm keeping notes here:

http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes

I've worked out how to do a successful authentication handshake. Now to
work out how to use that authentication handshake for future requests :-p
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was lacking
:-p
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the spec doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use of
it. Any random auth.json oryx should in fact work for auth.json PUT
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing on
some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is there a
url you hit to drop the cookie that you then use when you authenticate?
Post by Anton Dyudin
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me like you
should be able authenticate using a POST /~/auth.json?PUT with a payload
containing the csrf token, ship name and code. However I can't figure out
how you get the csrf token to start with. It seems like a bit of a chicken
and an egg problem to me. It won't let you resuse the oryx from a GEt
/~/auth.json so that won't work according to my testing.
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was private
doc and may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as the
message. The query string can also contain 'anon', which obviates the need
for an oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall <
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well documented.
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice to
be able to treat all HTTP requests as comets — but there are likely devices
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an
app(and get a nice/mean), or there is a way to access the query string from
a hook file.
I suppose crashing in the app and sticking JSON in the stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall <
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit to
handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code.
And have that code get access to the payload in the body of that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-11-30 01:24:47 UTC
Permalink
Okay now the rubber is starting to meet the road. I've successfully
perfomed a handshake for authentication and then hit a poke-json arm in a
gall app and seen the payload.

What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this request?

Any guidance here?
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication handshake. Now to
work out how to use that authentication handshake for future requests :-p
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the spec doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use
of it. Any random auth.json oryx should in fact work for auth.json PUT
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is there a
url you hit to drop the cookie that you then use when you authenticate?
Post by Anton Dyudin
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me like you
should be able authenticate using a POST /~/auth.json?PUT with a payload
containing the csrf token, ship name and code. However I can't figure out
how you get the csrf token to start with. It seems like a bit of a chicken
and an egg problem to me. It won't let you resuse the oryx from a GEt
/~/auth.json so that won't work according to my testing.
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was
private doc and may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as the
message. The query string can also contain 'anon', which obviates the need
for an oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall <
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well documented.
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice to
be able to treat all HTTP requests as comets — but there are likely devices
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an
app(and get a nice/mean), or there is a way to access the query string from
a hook file.
I suppose crashing in the app and sticking JSON in the stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall <
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code.
And have that code get access to the payload in the body of that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Curtis Yarvin
2015-11-30 03:23:22 UTC
Permalink
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.

As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like to a
JS client.

If you want to read data from the server, you need a subscription -- a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Okay now the rubber is starting to meet the road. I've successfully perfomed
a handshake for authentication and then hit a poke-json arm in a gall app
and seen the payload.
What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication handshake. Now to
work out how to use that authentication handshake for future requests :-p
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the spec doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use
of it. Any random auth.json oryx should in fact work for auth.json PUT
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is there a
url you hit to drop the cookie that you then use when you authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me like you
should be able authenticate using a POST /~/auth.json?PUT with a payload
containing the csrf token, ship name and code. However I can't figure out
how you get the csrf token to start with. It seems like a bit of a chicken
and an egg problem to me. It won't let you resuse the oryx from a GEt
/~/auth.json so that won't work according to my testing.
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as the message.
The query string can also contain 'anon', which obviates the need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well documented.
I wonder whether we have made a design error here. It’s nice to
be able to treat all HTTP requests as comets — but there are likely devices
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an
app(and get a nice/mean), or there is a way to access the query string from
a hook file.
I suppose crashing in the app and sticking JSON in the stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code.
And have that code get access to the payload in the body of that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-30 03:26:12 UTC
Permalink
I think the response is "{ok:true}", but otherwise yes.
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like to a
JS client.
If you want to read data from the server, you need a subscription -- a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've successfully
perfomed
Post by Jeremy Wall
a handshake for authentication and then hit a poke-json arm in a gall app
and seen the payload.
What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
<javascript:;>>
Post by Jeremy Wall
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication handshake. Now to
work out how to use that authentication handshake for future requests
:-p
Post by Jeremy Wall
Post by Jeremy Wall
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall <
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall <
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the spec
doc
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use
of it. Any random auth.json oryx should in fact work for auth.json
PUT
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall <
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have
the latter).
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is
there a
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
url you hit to drop the cookie that you then use when you
authenticate?
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me
like you
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
should be able authenticate using a POST /~/auth.json?PUT with a
payload
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
containing the csrf token, ship name and code. However I can't
figure out
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
how you get the csrf token to start with. It seems like a bit of
a chicken
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
and an egg problem to me. It won't let you resuse the oryx from a
GEt
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
/~/auth.json so that won't work according to my testing.
<javascript:;>>
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was
private doc and
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as the
message.
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
The query string can also contain 'anon', which obviates the
need for an
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well
documented.
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly <
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice
to
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
be able to treat all HTTP requests as comets — but there are
likely devices
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an
app(and get a nice/mean), or there is a way to access the
query string from
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this
code.
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
And have that code get access to the payload in the body of
that request if
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from
<javascript:;>.
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from
it,
<javascript:;>.
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:;>.
Post by Jeremy Wall
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Galen Wolfe-Pauly
2015-11-30 04:02:18 UTC
Permalink
This might be informative, also: https://github.com/urbit/examples/blob/master/gall/mail/ape/mail.hoon <https://github.com/urbit/examples/blob/master/gall/mail/ape/mail.hoon>
Post by Anton Dyudin
I think the response is "{ok:true}", but otherwise yes.
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like to a
JS client.
If you want to read data from the server, you need a subscription -- a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Okay now the rubber is starting to meet the road. I've successfully perfomed
a handshake for authentication and then hit a poke-json arm in a gall app
and seen the payload.
What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes <http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes>
I've worked out how to do a successful authentication handshake. Now to
work out how to use that authentication handshake for future requests :-p
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json <http://localhost:8081/~/auth.json> | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT <http://localhost:8081/~/auth.json?PUT>
Given what you just said and what I think I understand from the spec doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use
of it. Any random auth.json oryx should in fact work for auth.json PUT
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is there a
url you hit to drop the cookie that you then use when you authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me like you
should be able authenticate using a POST /~/auth.json?PUT with a payload
containing the csrf token, ship name and code. However I can't figure out
how you get the csrf token to start with. It seems like a bit of a chicken
and an egg problem to me. It won't let you resuse the oryx from a GEt
/~/auth.json so that won't work according to my testing.
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre <http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre>, was private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as the message.
The query string can also contain 'anon', which obviates the need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well documented.
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice to
be able to treat all HTTP requests as comets — but there are likely devices
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an
app(and get a nice/mean), or there is a way to access the query string from
a hook file.
I suppose crashing in the app and sticking JSON in the stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this code.
And have that code get access to the payload in the body of that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com <http://jeremy.marzhillstudios.com/>
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
Jeremy Wall
http://jeremy.marzhillstudios.com <http://jeremy.marzhillstudios.com/>
--
Jeremy Wall
http://jeremy.marzhillstudios.com <http://jeremy.marzhillstudios.com/>
--
Jeremy Wall
http://jeremy.marzhillstudios.com <http://jeremy.marzhillstudios.com/>
--
Jeremy Wall
http://jeremy.marzhillstudios.com <http://jeremy.marzhillstudios.com/>
--
Jeremy Wall
http://jeremy.marzhillstudios.com <http://jeremy.marzhillstudios.com/>
--
Jeremy Wall
http://jeremy.marzhillstudios.com <http://jeremy.marzhillstudios.com/>
--
Jeremy Wall
http://jeremy.marzhillstudios.com <http://jeremy.marzhillstudios.com/>
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-11-30 15:26:03 UTC
Permalink
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like to a
JS client.
If you want to read data from the server, you need a subscription -- a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.

So what we want then is for the poke to cause something to occur in the
subscription channel for this request. (e.g. /~/of/[ixor]) Would I use the
same ixor that I got when I authenticated? or do I need to do something get
a new ixor associated to this app and my session?

And in that case what cards should the poke arm produce to cause things to
happen in the ixor for this session?

Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a procedure?
This is a lot of work for third party services to consume an urbit service
and is likely to be a hindrance to them. (Perhaps this is desired?) Enough
work that I'm almost persuaded to create a go proxy that abstracts the
whole thing away into a restful service for me :-p
Post by Curtis Yarvin
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've successfully
perfomed
Post by Jeremy Wall
a handshake for authentication and then hit a poke-json arm in a gall app
and seen the payload.
What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication handshake. Now to
work out how to use that authentication handshake for future requests
:-p
Post by Jeremy Wall
Post by Jeremy Wall
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall <
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall <
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the spec
doc
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use
of it. Any random auth.json oryx should in fact work for auth.json
PUT
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall <
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have
the latter).
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is
there a
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
url you hit to drop the cookie that you then use when you
authenticate?
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me
like you
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
should be able authenticate using a POST /~/auth.json?PUT with a
payload
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
containing the csrf token, ship name and code. However I can't
figure out
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
how you get the csrf token to start with. It seems like a bit of
a chicken
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
and an egg problem to me. It won't let you resuse the oryx from a
GEt
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
/~/auth.json so that won't work according to my testing.
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was
private doc and
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as the
message.
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
The query string can also contain 'anon', which obviates the
need for an
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well
documented.
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly <
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice
to
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
be able to treat all HTTP requests as comets — but there are
likely devices
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an
app(and get a nice/mean), or there is a way to access the
query string from
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this
code.
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
And have that code get access to the payload in the body of
that request if
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from
it,
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Curtis Yarvin
2015-11-30 19:54:44 UTC
Permalink
You should produce a %diff card and return it on your subscription bone.

Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.

For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.

If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like to a
JS client.
If you want to read data from the server, you need a subscription -- a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in the
subscription channel for this request. (e.g. /~/of/[ixor]) Would I use the
same ixor that I got when I authenticated? or do I need to do something get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause things to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a procedure?
This is a lot of work for third party services to consume an urbit service
and is likely to be a hindrance to them. (Perhaps this is desired?) Enough
work that I'm almost persuaded to create a go proxy that abstracts the whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
Okay now the rubber is starting to meet the road. I've successfully perfomed
a handshake for authentication and then hit a poke-json arm in a gall app
and seen the payload.
What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication handshake. Now to
work out how to use that authentication handshake for future requests :-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the spec doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use
of it. Any random auth.json oryx should in fact work for auth.json PUT
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is there a
url you hit to drop the cookie that you then use when you authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me like you
should be able authenticate using a POST /~/auth.json?PUT with a
payload
containing the csrf token, ship name and code. However I can't
figure out
how you get the csrf token to start with. It seems like a bit of
a chicken
and an egg problem to me. It won't let you resuse the oryx from a GEt
/~/auth.json so that won't work according to my testing.
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as the
message.
The query string can also contain 'anon', which obviates the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s nice
to
be able to treat all HTTP requests as comets — but there are
likely devices
that want to communicate over HTTP that can’t set up an oryx.
Correct. There is a way to send a json post anonymously to an
app(and get a nice/mean), or there is a way to access the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in the stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this
code.
And have that code get access to the payload in the body of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it,
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-11-30 21:48:28 UTC
Permalink
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription bone.
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The case
of check this text to see if it is parsable as hoon does not need to be
stateful though, so it seems like you are doing more work than you want to
do.

While the subscription model is generalizable to the stateless case it's
not trivial to use that way.
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like to a
JS client.
If you want to read data from the server, you need a subscription -- a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in the
subscription channel for this request. (e.g. /~/of/[ixor]) Would I use
the
Post by Jeremy Wall
same ixor that I got when I authenticated? or do I need to do something
get
Post by Jeremy Wall
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause things
to
Post by Jeremy Wall
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a procedure?
This is a lot of work for third party services to consume an urbit
service
Post by Jeremy Wall
and is likely to be a hindrance to them. (Perhaps this is desired?)
Enough
Post by Jeremy Wall
work that I'm almost persuaded to create a go proxy that abstracts the
whole
Post by Jeremy Wall
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall <
Okay now the rubber is starting to meet the road. I've successfully perfomed
a handshake for authentication and then hit a poke-json arm in a gall app
and seen the payload.
What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication handshake. Now
to
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
work out how to use that authentication handshake for future requests :-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") #
just
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the
spec
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use
of it. Any random auth.json oryx should in fact work for auth.json PUT
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is
there a
url you hit to drop the cookie that you then use when you authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me
like you
should be able authenticate using a POST /~/auth.json?PUT with
a
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
payload
containing the csrf token, ship name and code. However I can't
figure out
how you get the csrf token to start with. It seems like a bit
of
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
a chicken
and an egg problem to me. It won't let you resuse the oryx
from a
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
GEt
/~/auth.json so that won't work according to my testing.
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
message.
The query string can also contain 'anon', which obviates the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s
nice
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
be able to treat all HTTP requests as comets — but there are
likely devices
that want to communicate over HTTP that can’t set up an
oryx.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Correct. There is a way to send a json post anonymously to
an
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
app(and get a nice/mean), or there is a way to access the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this
code.
And have that code get access to the payload in the body of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
it, send an email to
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout
.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
it,
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-30 21:55:38 UTC
Permalink
The correct thing there is definitely some manner of hook file, yes.
Perhaps something akin to generators for post requests, similar to
the userspace outbound-api managers in eyre idea?
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription bone.
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The
case of check this text to see if it is parsable as hoon does not need to
be stateful though, so it seems like you are doing more work than you want
to do.
While the subscription model is generalizable to the stateless case it's
not trivial to use that way.
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like to a
JS client.
If you want to read data from the server, you need a subscription -- a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in the
subscription channel for this request. (e.g. /~/of/[ixor]) Would I use
the
Post by Jeremy Wall
same ixor that I got when I authenticated? or do I need to do something
get
Post by Jeremy Wall
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause things
to
Post by Jeremy Wall
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a procedure?
This is a lot of work for third party services to consume an urbit
service
Post by Jeremy Wall
and is likely to be a hindrance to them. (Perhaps this is desired?)
Enough
Post by Jeremy Wall
work that I'm almost persuaded to create a go proxy that abstracts the
whole
Post by Jeremy Wall
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall <
Okay now the rubber is starting to meet the road. I've successfully perfomed
a handshake for authentication and then hit a poke-json arm in a gall app
and seen the payload.
What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication handshake.
Now to
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
work out how to use that authentication handshake for future
requests
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") #
just
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the
spec
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use
of it. Any random auth.json oryx should in fact work for
auth.json
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
PUT
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And
is
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me
like you
should be able authenticate using a POST /~/auth.json?PUT
with a
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
payload
containing the csrf token, ship name and code. However I can't
figure out
how you get the csrf token to start with. It seems like a bit
of
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
a chicken
and an egg problem to me. It won't let you resuse the oryx
from a
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
GEt
/~/auth.json so that won't work according to my testing.
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
message.
The query string can also contain 'anon', which obviates the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s
nice
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
be able to treat all HTTP requests as comets — but there
are
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
likely devices
that want to communicate over HTTP that can’t set up an
oryx.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Correct. There is a way to send a json post anonymously to
an
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
app(and get a nice/mean), or there is a way to access the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this
code.
And have that code get access to the payload in the body
of
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
it, send an email to
.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
it,
.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout
.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it,
send
Post by Jeremy Wall
Post by Curtis Yarvin
an
.
Post by Jeremy Wall
Post by Curtis Yarvin
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-30 22:00:18 UTC
Permalink
And for now, there remains the "~| some json, crash" approach to
statelessness.

@Curtis: this would be one of those known-horrible solutions which I'd love
to hear better alternatives to. Anything stateful explicitly being
Post by Anton Dyudin
The correct thing there is definitely some manner of hook file, yes.
Perhaps something akin to generators for post requests, similar to
the userspace outbound-api managers in eyre idea?
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription bone.
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The
case of check this text to see if it is parsable as hoon does not need to
be stateful though, so it seems like you are doing more work than you want
to do.
While the subscription model is generalizable to the stateless case it's
not trivial to use that way.
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like to a
JS client.
If you want to read data from the server, you need a subscription -- a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in the
subscription channel for this request. (e.g. /~/of/[ixor]) Would I use
the
Post by Jeremy Wall
same ixor that I got when I authenticated? or do I need to do
something get
Post by Jeremy Wall
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause
things to
Post by Jeremy Wall
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a
procedure?
Post by Jeremy Wall
This is a lot of work for third party services to consume an urbit
service
Post by Jeremy Wall
and is likely to be a hindrance to them. (Perhaps this is desired?)
Enough
Post by Jeremy Wall
work that I'm almost persuaded to create a go proxy that abstracts the
whole
Post by Jeremy Wall
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall <
Okay now the rubber is starting to meet the road. I've successfully perfomed
a handshake for authentication and then hit a poke-json arm in a
gall
Post by Jeremy Wall
Post by Curtis Yarvin
app
and seen the payload.
What I can't quite figure out right now is what do I produce from
the
Post by Jeremy Wall
Post by Curtis Yarvin
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this
request?
Post by Jeremy Wall
Post by Curtis Yarvin
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication handshake.
Now to
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
work out how to use that authentication handshake for future
requests
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") #
just
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the
spec
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually
making
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
use
of it. Any random auth.json oryx should in fact work for
auth.json
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
PUT
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
set
recorded for your session cookie (for example if you don't
have
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And
is
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me
like you
should be able authenticate using a POST /~/auth.json?PUT
with a
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
payload
containing the csrf token, ship name and code. However I
can't
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
figure out
how you get the csrf token to start with. It seems like a
bit of
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
a chicken
and an egg problem to me. It won't let you resuse the oryx
from a
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
GEt
/~/auth.json so that won't work according to my testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin <
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query
string
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
parameters, in which case the entire post body is treated
as the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
message.
The query string can also contain 'anon', which obviates the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s
nice
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
be able to treat all HTTP requests as comets — but there
are
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
likely devices
that want to communicate over HTTP that can’t set up an
oryx.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Correct. There is a way to send a json post anonymously
to an
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
app(and get a nice/mean), or there is a way to access the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with
this
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
code.
And have that code get access to the payload in the body
of
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
--
You received this message because you are subscribed to
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
it,
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it,
send
Post by Jeremy Wall
Post by Curtis Yarvin
an
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Curtis Yarvin
2015-11-30 22:12:02 UTC
Permalink
Anton, please don't overload success results into a failure trace.

We should think of any user-level code we write now as sample code,
meaning it's meant to be copied. Meaning, it shouldn't use obvious
anti-patterns. Meaning, when we find the system unusable or difficult
in some way, that's a problem to be fixed and not hacked around...
Post by Anton Dyudin
And for now, there remains the "~| some json, crash" approach to
statelessness.
@Curtis: this would be one of those known-horrible solutions which I'd love
to hear better alternatives to. Anything stateful explicitly being
Post by Anton Dyudin
The correct thing there is definitely some manner of hook file, yes.
Perhaps something akin to generators for post requests, similar to the
userspace outbound-api managers in eyre idea?
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription bone.
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The
case of check this text to see if it is parsable as hoon does not need to be
stateful though, so it seems like you are doing more work than you want to
do.
While the subscription model is generalizable to the stateless case it's
not trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like to a
JS client.
If you want to read data from the server, you need a subscription -- a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in the
subscription channel for this request. (e.g. /~/of/[ixor]) Would I use the
same ixor that I got when I authenticated? or do I need to do something get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause things to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a procedure?
This is a lot of work for third party services to consume an urbit service
and is likely to be a hindrance to them. (Perhaps this is desired?) Enough
work that I'm almost persuaded to create a go proxy that abstracts the whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've successfully
perfomed
a handshake for authentication and then hit a poke-json arm in a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication handshake. Now to
work out how to use that authentication handshake for future requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the spec
doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually
making
use
of it. Any random auth.json oryx should in fact work for auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in
the
set
recorded for your session cookie (for example if you don't have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me
like you
should be able authenticate using a POST /~/auth.json?PUT
with a
payload
containing the csrf token, ship name and code. However I
can't
figure out
how you get the csrf token to start with. It seems like a
bit of
a chicken
and an egg problem to me. It won't let you resuse the oryx
from a
GEt
/~/auth.json so that won't work according to my testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query
string
parameters, in which case the entire post body is treated
as the
message.
The query string can also contain 'anon', which obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s
nice
to
be able to treat all HTTP requests as comets — but there
are
likely devices
that want to communicate over HTTP that can’t set up an
oryx.
Correct. There is a way to send a json post anonymously
to an
app(and get a nice/mean), or there is a way to access the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with
this
code.
And have that code get access to the payload in the body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
it,
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
an
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-30 22:18:48 UTC
Permalink
I repeat, there is not currently a "pattern"ful way to statelessly process
and respond to a request. I agree this is a problem to be fixed, but
meanwhile am unconvinced "the IDE service project is blocked on that new
feature being implemented, don't worry we'll get to it eventually" is a
reasonable response here.
Post by Curtis Yarvin
Anton, please don't overload success results into a failure trace.
We should think of any user-level code we write now as sample code,
meaning it's meant to be copied. Meaning, it shouldn't use obvious
anti-patterns. Meaning, when we find the system unusable or difficult
in some way, that's a problem to be fixed and not hacked around...
Post by Anton Dyudin
And for now, there remains the "~| some json, crash" approach to
statelessness.
@Curtis: this would be one of those known-horrible solutions which I'd
love
Post by Anton Dyudin
to hear better alternatives to. Anything stateful explicitly being
Post by Anton Dyudin
The correct thing there is definitely some manner of hook file, yes.
Perhaps something akin to generators for post requests, similar to the
userspace outbound-api managers in eyre idea?
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription
bone.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The
case of check this text to see if it is parsable as hoon does not need
to be
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
stateful though, so it seems like you are doing more work than you
want to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
do.
While the subscription model is generalizable to the stateless case
it's
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
not trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but
rather a
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with
an
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like
to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
a
JS client.
If you want to read data from the server, you need a subscription
--
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes
with
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in the
subscription channel for this request. (e.g. /~/of/[ixor]) Would I
use
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
the
same ixor that I got when I authenticated? or do I need to do something get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause things to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a
mechanism
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
similar to poke that works like a function call rather than a procedure?
This is a lot of work for third party services to consume an urbit service
and is likely to be a hindrance to them. (Perhaps this is desired?) Enough
work that I'm almost persuaded to create a go proxy that abstracts
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
perfomed
a handshake for authentication and then hit a poke-json arm in a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should
my
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
%gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication handshake.
Now to
work out how to use that authentication handshake for future requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx")
#
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
spec
doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually
making
use
of it. Any random auth.json oryx should in fact work for
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin <
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in
the
set
recorded for your session cookie (for example if you don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't
yet
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
authenticated. Do you get a session before authenticating?
And
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
is
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a
bit
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
attempting to manually succeed in a handshake. It looks to
me
like you
should be able authenticate using a POST /~/auth.json?PUT
with a
payload
containing the csrf token, ship name and code. However I
can't
figure out
how you get the csrf token to start with. It seems like a
bit of
a chicken
and an egg problem to me. It won't let you resuse the oryx
from a
GEt
/~/auth.json so that won't work according to my testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query
string
parameters, in which case the entire post body is treated
as the
message.
The query string can also contain 'anon', which obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
token/cookie and process for getting/using one is well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here.
It’s
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
nice
to
be able to treat all HTTP requests as comets — but
there
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
are
likely devices
that want to communicate over HTTP that can’t set up an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin <
Correct. There is a way to send a json post anonymously
to an
app(and get a nice/mean), or there is a way to access
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
query string from
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set
up
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with
this
code.
And have that code get access to the payload in the
body
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed
to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
an
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Curtis Yarvin
2015-11-30 22:08:51 UTC
Permalink
Jeremy, we're on the same page. The mismatch *here* is that poke was
the wrong thing to begin with, since there's no actual state change.

The absence of a simple GET was intentional, because it is a special
case of the subscription model. On the server end, you have two cases
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful (eg,
some data needs to be fetched). The client should not see the
difference.

But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're not
optimizing for this common special case, although I still insist that
it's a special case.
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription bone.
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The case
of check this text to see if it is parsable as hoon does not need to be
stateful though, so it seems like you are doing more work than you want to
do.
While the subscription model is generalizable to the stateless case it's not
trivial to use that way.
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like to a
JS client.
If you want to read data from the server, you need a subscription -- a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in the
subscription channel for this request. (e.g. /~/of/[ixor]) Would I use the
same ixor that I got when I authenticated? or do I need to do something get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause things to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a procedure?
This is a lot of work for third party services to consume an urbit service
and is likely to be a hindrance to them. (Perhaps this is desired?) Enough
work that I'm almost persuaded to create a go proxy that abstracts the whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Okay now the rubber is starting to meet the road. I've successfully perfomed
a handshake for authentication and then hit a poke-json arm in a gall app
and seen the payload.
What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication handshake. Now to
work out how to use that authentication handshake for future requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the spec
doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually making use
of it. Any random auth.json oryx should in fact work for auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in the set
recorded for your session cookie (for example if you don't have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to me
like you
should be able authenticate using a POST /~/auth.json?PUT with a
payload
containing the csrf token, ship name and code. However I can't
figure out
how you get the csrf token to start with. It seems like a bit of
a chicken
and an egg problem to me. It won't let you resuse the oryx from a
GEt
/~/auth.json so that won't work according to my testing.
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre, was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query string
parameters, in which case the entire post body is treated as
the
message.
The query string can also contain 'anon', which obviates the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s
nice
to
be able to treat all HTTP requests as comets — but there
are
likely devices
that want to communicate over HTTP that can’t set up an
oryx.
Correct. There is a way to send a json post anonymously to
an
app(and get a nice/mean), or there is a way to access the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with this
code.
And have that code get access to the payload in the body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
it,
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
an
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-30 22:11:43 UTC
Permalink
I feel like that still fails to recouple that "send this string and return
a result" is a stateless request when taken as a whole, which neither
"receive this message and ack it" nor "serve some data you have saved" can
be.
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke was
the wrong thing to begin with, since there's no actual state change.
The absence of a simple GET was intentional, because it is a special
case of the subscription model. On the server end, you have two cases
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful (eg,
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're not
optimizing for this common special case, although I still insist that
it's a special case.
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription bone.
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The
case
Post by Jeremy Wall
of check this text to see if it is parsable as hoon does not need to be
stateful though, so it seems like you are doing more work than you want
to
Post by Jeremy Wall
do.
While the subscription model is generalizable to the stateless case it's
not
Post by Jeremy Wall
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall <
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack
is
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
a feature, not a bug; it's just what an end-to-end ack looks like to
a
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
JS client.
If you want to read data from the server, you need a subscription --
a
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
different communication pattern. Note however that the gall
appliance
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
subscription channel for this request. (e.g. /~/of/[ixor]) Would I use the
same ixor that I got when I authenticated? or do I need to do
something
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause
things
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a
procedure?
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
This is a lot of work for third party services to consume an urbit service
and is likely to be a hindrance to them. (Perhaps this is desired?) Enough
work that I'm almost persuaded to create a go proxy that abstracts the whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've successfully
perfomed
a handshake for authentication and then hit a poke-json arm in a
gall
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
app
and seen the payload.
What I can't quite figure out right now is what do I produce from
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
poke-arm to send a response back? In other word what card should my %gall
app produce to tell eyre send this out as a response to this
request?
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication handshake.
Now
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
to
work out how to use that authentication handshake for future requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu
was
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the spec
doc
I would have expected it to work.
<javascript:;>>
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
You're right, that should only happen on requests actually
making
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
use
of it. Any random auth.json oryx should in fact work for auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
<javascript:;>>
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
set
recorded for your session cookie (for example if you don't
have
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating? And is
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to
me
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
like you
should be able authenticate using a POST /~/auth.json?PUT
with
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
a
payload
containing the csrf token, ship name and code. However I
can't
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
figure out
how you get the csrf token to start with. It seems like a
bit
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
of
a chicken
and an egg problem to me. It won't let you resuse the oryx
from a
GEt
/~/auth.json so that won't work according to my testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin <
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query
string
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
parameters, in which case the entire post body is treated
as
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
the
message.
The query string can also contain 'anon', which obviates
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s
nice
to
be able to treat all HTTP requests as comets — but there
are
likely devices
that want to communicate over HTTP that can’t set up an
oryx.
<javascript:;>>
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Correct. There is a way to send a json post anonymously
to
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
an
app(and get a nice/mean), or there is a way to access the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with
this
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
code.
And have that code get access to the payload in the body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are subscribed to
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
it,
<javascript:;>.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
an
<javascript:;>.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-30 22:12:06 UTC
Permalink
And return a pure function of it*
Post by Anton Dyudin
I feel like that still fails to recouple that "send this string and return
a result" is a stateless request when taken as a whole, which neither
"receive this message and ack it" nor "serve some data you have saved" can
be.
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke was
the wrong thing to begin with, since there's no actual state change.
The absence of a simple GET was intentional, because it is a special
case of the subscription model. On the server end, you have two cases
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful (eg,
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're not
optimizing for this common special case, although I still insist that
it's a special case.
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription
bone.
Post by Jeremy Wall
Post by Curtis Yarvin
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The
case
Post by Jeremy Wall
of check this text to see if it is parsable as hoon does not need to be
stateful though, so it seems like you are doing more work than you want
to
Post by Jeremy Wall
do.
While the subscription model is generalizable to the stateless case
it's not
Post by Jeremy Wall
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall <
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but rather
a
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack
is
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
a feature, not a bug; it's just what an end-to-end ack looks like
to a
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
JS client.
If you want to read data from the server, you need a subscription
-- a
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
different communication pattern. Note however that the gall
appliance
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
subscription channel for this request. (e.g. /~/of/[ixor]) Would I
use
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
the
same ixor that I got when I authenticated? or do I need to do
something
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause
things
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a
mechanism
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
similar to poke that works like a function call rather than a
procedure?
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
This is a lot of work for third party services to consume an urbit service
and is likely to be a hindrance to them. (Perhaps this is desired?) Enough
work that I'm almost persuaded to create a go proxy that abstracts
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
perfomed
a handshake for authentication and then hit a poke-json arm in a
gall
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
app
and seen the payload.
What I can't quite figure out right now is what do I produce from
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
poke-arm to send a response back? In other word what card should
my
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
%gall
app produce to tell eyre send this out as a response to this
request?
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication handshake.
Now
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
to
work out how to use that authentication handshake for future requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu
was
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the
spec
doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually
making
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
use
of it. Any random auth.json oryx should in fact work for
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
set
recorded for your session cookie (for example if you don't
have
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't
yet
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
authenticated. Do you get a session before authenticating?
And
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
is
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to
me
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
like you
should be able authenticate using a POST /~/auth.json?PUT
with
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
a
payload
containing the csrf token, ship name and code. However I
can't
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
figure out
how you get the csrf token to start with. It seems like a
bit
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
of
a chicken
and an egg problem to me. It won't let you resuse the oryx
from a
GEt
/~/auth.json so that won't work according to my testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin <
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query
string
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
parameters, in which case the entire post body is treated
as
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
the
message.
The query string can also contain 'anon', which obviates
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s
nice
to
be able to treat all HTTP requests as comets — but there
are
likely devices
that want to communicate over HTTP that can’t set up an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin <
Correct. There is a way to send a json post anonymously
to
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
an
app(and get a nice/mean), or there is a way to access
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
query string from
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set
up
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with
this
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
code.
And have that code get access to the payload in the
body
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are subscribed to
the
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
it,
.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
an
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Curtis Yarvin
2015-11-30 22:14:26 UTC
Permalink
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.

Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
I feel like that still fails to recouple that "send this string and return a
result" is a stateless request when taken as a whole, which neither "receive
this message and ack it" nor "serve some data you have saved" can be.
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke was
the wrong thing to begin with, since there's no actual state change.
The absence of a simple GET was intentional, because it is a special
case of the subscription model. On the server end, you have two cases
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful (eg,
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're not
optimizing for this common special case, although I still insist that
it's a special case.
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription bone.
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The case
of check this text to see if it is parsable as hoon does not need to be
stateful though, so it seems like you are doing more work than you want to
do.
While the subscription model is generalizable to the stateless case it's not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but rather a
transaction whose result only contains content if it fails. It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack is
a feature, not a bug; it's just what an end-to-end ack looks like to a
JS client.
If you want to read data from the server, you need a subscription -- a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in the
subscription channel for this request. (e.g. /~/of/[ixor]) Would I use
the
same ixor that I got when I authenticated? or do I need to do something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a procedure?
This is a lot of work for third party services to consume an urbit service
and is likely to be a hindrance to them. (Perhaps this is desired?) Enough
work that I'm almost persuaded to create a go proxy that abstracts the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've successfully
perfomed
a handshake for authentication and then hit a poke-json arm in a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I produce from the
poke-arm to send a response back? In other word what card should
my
%gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication handshake. Now
to
work out how to use that authentication handshake for future requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq "{.oryx") # just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from the
spec
doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually
making
use
of it. Any random auth.json oryx should in fact work for
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't in
the
set
recorded for your session cookie (for example if you don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't yet
authenticated. Do you get a session before authenticating?
And
is
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a bit
attempting to manually succeed in a handshake. It looks to
me
like you
should be able authenticate using a POST /~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code. However I
can't
figure out
how you get the csrf token to start with. It seems like a
bit
of
a chicken
and an egg problem to me. It won't let you resuse the oryx
from a
GEt
/~/auth.json so that won't work according to my testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query
string
parameters, in which case the entire post body is treated
as
the
message.
The query string can also contain 'anon', which obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as the
token/cookie and process for getting/using one is well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
I wonder whether we have made a design error here. It’s
nice
to
be able to treat all HTTP requests as comets — but there
are
likely devices
that want to communicate over HTTP that can’t set up an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post anonymously
to
an
app(and get a nice/mean), or there is a way to access
the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with
this
code.
And have that code get access to the payload in the
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails
from
it,
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it, send
an
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-30 22:19:56 UTC
Permalink
I think the point of REST is connection state on the client is already a
fail, and it's the server's problem if it can't work within that constraint.
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
Post by Anton Dyudin
I feel like that still fails to recouple that "send this string and
return a
Post by Anton Dyudin
result" is a stateless request when taken as a whole, which neither
"receive
Post by Anton Dyudin
this message and ack it" nor "serve some data you have saved" can be.
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke was
the wrong thing to begin with, since there's no actual state change.
The absence of a simple GET was intentional, because it is a special
case of the subscription model. On the server end, you have two cases
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful (eg,
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're not
optimizing for this common special case, although I still insist that
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall <
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription bone.
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change;
this
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some
part)
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the
new
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
input line in the response.
If instead we POST the key and send the new input line as a diff,
this
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you
did
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The case
of check this text to see if it is parsable as hoon does not need to
be
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
stateful though, so it seems like you are doing more work than you
want
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
to
do.
While the subscription model is generalizable to the stateless case
it's
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but
rather
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
a
transaction whose result only contains content if it fails. It's
a
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with
an
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
empty body (Anton, correct me if I'm wrong). Again, this naked
ack
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
is
a feature, not a bug; it's just what an end-to-end ack looks like
to
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
a
JS client.
If you want to read data from the server, you need a subscription
--
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes
with
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in the
subscription channel for this request. (e.g. /~/of/[ixor]) Would I use
the
same ixor that I got when I authenticated? or do I need to do something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a procedure?
This is a lot of work for third party services to consume an urbit service
and is likely to be a hindrance to them. (Perhaps this is desired?) Enough
work that I'm almost persuaded to create a go proxy that abstracts the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've successfully
perfomed
a handshake for authentication and then hit a poke-json arm in a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I produce
from
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
the
poke-arm to send a response back? In other word what card should
my
%gall
app produce to tell eyre send this out as a response to this request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication
handshake.
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Now
to
work out how to use that authentication handshake for future
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from
the
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
spec
doc
I would have expected it to work.
Post by Anton Dyudin
You're right, that should only happen on requests actually
making
use
of it. Any random auth.json oryx should in fact work for
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin <
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't
in
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
the
set
recorded for your session cookie (for example if you don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't
yet
authenticated. Do you get a session before authenticating?
And
is
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a
bit
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
attempting to manually succeed in a handshake. It looks
to
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
me
like you
should be able authenticate using a POST /~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code. However I
can't
figure out
how you get the csrf token to start with. It seems like a
bit
of
a chicken
and an egg problem to me. It won't let you resuse the
oryx
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
from a
GEt
/~/auth.json so that won't work according to my testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query
string
parameters, in which case the entire post body is
treated
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
as
the
message.
The query string can also contain 'anon', which obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as
the
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
token/cookie and process for getting/using one is well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here.
It’s
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
nice
to
be able to treat all HTTP requests as comets — but
there
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
are
likely devices
that want to communicate over HTTP that can’t set up
an
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
an
app(and get a nice/mean), or there is a way to access
the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method with
this
code.
And have that code get access to the payload in the
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed
to
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are subscribed
to
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from
it,
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
send
an
.
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-30 22:22:34 UTC
Permalink
(Specifically, domain-specific connection state. The client already has
basic guarantees in place for ordered delivery of bytes etc., namely TCP,
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is already a
fail, and it's the server's problem if it can't work within that constraint.
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
Post by Anton Dyudin
I feel like that still fails to recouple that "send this string and
return a
Post by Anton Dyudin
result" is a stateless request when taken as a whole, which neither
"receive
Post by Anton Dyudin
this message and ack it" nor "serve some data you have saved" can be.
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke was
the wrong thing to begin with, since there's no actual state change.
The absence of a simple GET was intentional, because it is a special
case of the subscription model. On the server end, you have two cases
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful (eg,
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're not
optimizing for this common special case, although I still insist that
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall <
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription bone.
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change;
this
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some
part)
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the
new
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
input line in the response.
If instead we POST the key and send the new input line as a diff,
this
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you
did
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
it the classic way, this refactoring is nontrivial. Do you want
this
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful.
The
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
case
of check this text to see if it is parsable as hoon does not need to
be
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
stateful though, so it seems like you are doing more work than you
want
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
to
do.
While the subscription model is generalizable to the stateless case
it's
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but
rather
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
a
transaction whose result only contains content if it fails.
It's a
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK
with an
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
empty body (Anton, correct me if I'm wrong). Again, this naked
ack
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
is
a feature, not a bug; it's just what an end-to-end ack looks
like to
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
a
JS client.
If you want to read data from the server, you need a
subscription --
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
a
different communication pattern. Note however that the gall appliance
gets the same bone if the same client both subscribes and pokes
with
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
the same wire (caller's causal path), so it's easy for the poke
to
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur
in
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
the
subscription channel for this request. (e.g. /~/of/[ixor]) Would I use
the
same ixor that I got when I authenticated? or do I need to do something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a procedure?
This is a lot of work for third party services to consume an urbit
service
and is likely to be a hindrance to them. (Perhaps this is
desired?)
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Enough
work that I'm almost persuaded to create a go proxy that abstracts the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've successfully
perfomed
a handshake for authentication and then hit a poke-json arm in
a
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
gall
app
and seen the payload.
What I can't quite figure out right now is what do I produce
from
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
the
poke-arm to send a response back? In other word what card
should
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
my
%gall
app produce to tell eyre send this out as a response to this
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication
handshake.
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Now
to
work out how to use that authentication handshake for future
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My
bash-fu
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from
the
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin <
Post by Anton Dyudin
You're right, that should only happen on requests actually
making
use
of it. Any random auth.json oryx should in fact work for
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin <
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is
it
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't
in
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
the
set
recorded for your session cookie (for example if you
don't
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I haven't
yet
authenticated. Do you get a session before authenticating?
And
is
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a
bit
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
attempting to manually succeed in a handshake. It looks
to
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
with
a
payload
containing the csrf token, ship name and code. However I
can't
figure out
how you get the csrf token to start with. It seems like
a
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
bit
of
a chicken
and an egg problem to me. It won't let you resuse the
oryx
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
from a
GEt
/~/auth.json so that won't work according to my testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre
,
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query
string
parameters, in which case the entire post body is
treated
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
as
the
message.
The query string can also contain 'anon', which
obviates
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as
the
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
token/cookie and process for getting/using one is well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here.
It’s
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
nice
to
be able to treat all HTTP requests as comets — but
there
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
are
likely devices
that want to communicate over HTTP that can’t set up
an
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
an
app(and get a nice/mean), or there is a way to access
the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in
the
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to
set
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method
with
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
this
code.
And have that code get access to the payload in the
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are subscribed
to
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from
it,
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
send
an
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Curtis Yarvin
2015-11-30 22:36:25 UTC
Permalink
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do this
as a stateless GET.

Arguably, it's a feature that %eyre can and should implement - whether
or not there's any direct support for it in %gall. All you need to do
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already has
basic guarantees in place for ordered delivery of bytes etc., namely TCP,
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is already a
fail, and it's the server's problem if it can't work within that constraint.
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
I feel like that still fails to recouple that "send this string and return a
result" is a stateless request when taken as a whole, which neither "receive
this message and ack it" nor "serve some data you have saved" can be.
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke was
the wrong thing to begin with, since there's no actual state change.
The absence of a simple GET was intentional, because it is a special
case of the subscription model. On the server end, you have two cases
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful (eg,
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're not
optimizing for this common special case, although I still insist that
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription bone.
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The
case
of check this text to see if it is parsable as hoon does not need to be
stateful though, so it seems like you are doing more work than you want
to
do.
While the subscription model is generalizable to the stateless case it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but
rather
a
transaction whose result only contains content if it fails.
It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack
is
a feature, not a bug; it's just what an end-to-end ack looks like to
a
JS client.
If you want to read data from the server, you need a subscription --
a
different communication pattern. Note however that the gall
appliance
gets the same bone if the same client both subscribes and pokes with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in
the
subscription channel for this request. (e.g. /~/of/[ixor]) Would
I
use
the
same ixor that I got when I authenticated? or do I need to do something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a mechanism
similar to poke that works like a function call rather than a
procedure?
This is a lot of work for third party services to consume an urbit
service
and is likely to be a hindrance to them. (Perhaps this is desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
perfomed
a handshake for authentication and then hit a poke-json arm in a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I produce from
the
poke-arm to send a response back? In other word what card should
my
%gall
app produce to tell eyre send this out as a response to this
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication
handshake.
Now
to
work out how to use that authentication handshake for future
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests actually
making
use
of it. Any random auth.json oryx should in fact work for
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't
in
the
set
recorded for your session cookie (for example if you
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a
bit
attempting to manually succeed in a handshake. It looks
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code. However
I
can't
figure out
how you get the csrf token to start with. It seems like
a
bit
of
a chicken
and an egg problem to me. It won't let you resuse the
oryx
from a
GEt
/~/auth.json so that won't work according to my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query
string
parameters, in which case the entire post body is
treated
as
the
message.
The query string can also contain 'anon', which
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as
the
token/cookie and process for getting/using one is
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here.
It’s
nice
to
be able to treat all HTTP requests as comets — but
there
are
likely devices
that want to communicate over HTTP that can’t set up
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way to
access
the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method
with
this
code.
And have that code get access to the payload in the
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are subscribed
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from it,
send
an
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Curtis Yarvin
2015-11-30 22:38:32 UTC
Permalink
There are two separate ways to improve %gall to support this: one, a
%read message with the "%peer then %pull" semantics; two, letting an
application declare an express gate that %gall detects, for when your
subscription path actually is a pure function.

Both these things should be done. But if you solve it first in %eyre,
Jeremy can use your solution as soon as possible...
Post by Curtis Yarvin
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do this
as a stateless GET.
Arguably, it's a feature that %eyre can and should implement - whether
or not there's any direct support for it in %gall. All you need to do
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already has
basic guarantees in place for ordered delivery of bytes etc., namely TCP,
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is already a
fail, and it's the server's problem if it can't work within that constraint.
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
I feel like that still fails to recouple that "send this string and return a
result" is a stateless request when taken as a whole, which neither "receive
this message and ack it" nor "serve some data you have saved" can be.
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke was
the wrong thing to begin with, since there's no actual state change.
The absence of a simple GET was intentional, because it is a special
case of the subscription model. On the server end, you have two cases
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful (eg,
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're not
optimizing for this common special case, although I still insist that
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your subscription bone.
Let me step back and explain the theory behind this architecture a
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't cause
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return the new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If you did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant, I
hope.
The mismatch here is that this forces all requests to be stateful. The
case
of check this text to see if it is parsable as hoon does not need to be
stateful though, so it seems like you are doing more work than you want
to
do.
While the subscription model is generalizable to the stateless case it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but
rather
a
transaction whose result only contains content if it fails.
It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK
with an
empty body (Anton, correct me if I'm wrong). Again, this naked ack
is
a feature, not a bug; it's just what an end-to-end ack looks
like to
a
JS client.
If you want to read data from the server, you need a
subscription --
a
different communication pattern. Note however that the gall
appliance
gets the same bone if the same client both subscribes and pokes
with
the same wire (caller's causal path), so it's easy for the poke to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to occur in
the
subscription channel for this request. (e.g. /~/of/[ixor]) Would
I
use
the
same ixor that I got when I authenticated? or do I need to do
something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to cause
things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a
mechanism
similar to poke that works like a function call rather than a
procedure?
This is a lot of work for third party services to consume an urbit
service
and is likely to be a hindrance to them. (Perhaps this is desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
perfomed
a handshake for authentication and then hit a poke-json arm in
a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I produce
from
the
poke-arm to send a response back? In other word what card
should
my
%gall
app produce to tell eyre send this out as a response to this
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication
handshake.
Now
to
work out how to use that authentication handshake for future
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand from
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests actually
making
use
of it. Any random auth.json oryx should in fact work for
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"? Is
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token isn't
in
the
set
recorded for your session cookie (for example if you
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl for a
bit
attempting to manually succeed in a handshake. It looks
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code. However
I
can't
figure out
how you get the csrf token to start with. It seems like
a
bit
of
a chicken
and an egg problem to me. It won't let you resuse the
oryx
from a
GEt
/~/auth.json so that won't work according to my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as query
string
parameters, in which case the entire post body is
treated
as
the
message.
The query string can also contain 'anon', which
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long as
the
token/cookie and process for getting/using one is
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here.
It’s
nice
to
be able to treat all HTTP requests as comets — but
there
are
likely devices
that want to communicate over HTTP that can’t set up
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way to
access
the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method
with
this
code.
And have that code get access to the payload in the
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are subscribed
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails from
it,
send
an
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-30 22:40:40 UTC
Permalink
Ah, so the suggestion here is to stuff kilobytes of hoon into the
subscription path? For small values, the current .hook query string
protocol already works.
Post by Curtis Yarvin
There are two separate ways to improve %gall to support this: one, a
%read message with the "%peer then %pull" semantics; two, letting an
application declare an express gate that %gall detects, for when your
subscription path actually is a pure function.
Both these things should be done. But if you solve it first in %eyre,
Jeremy can use your solution as soon as possible...
Post by Curtis Yarvin
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do this
as a stateless GET.
Arguably, it's a feature that %eyre can and should implement - whether
or not there's any direct support for it in %gall. All you need to do
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already has
basic guarantees in place for ordered delivery of bytes etc., namely
TCP,
Post by Curtis Yarvin
Post by Anton Dyudin
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is already
a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
fail, and it's the server's problem if it can't work within that
constraint.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
I feel like that still fails to recouple that "send this string and return a
result" is a stateless request when taken as a whole, which neither "receive
this message and ack it" nor "serve some data you have saved" can
be.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke
was
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
the wrong thing to begin with, since there's no actual state
change.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
The absence of a simple GET was intentional, because it is a
special
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
case of the subscription model. On the server end, you have two
cases
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful
(eg,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're
not
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
optimizing for this common special case, although I still insist
that
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
<javascript:;>>
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your
subscription
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
bone.
Let me step back and explain the theory behind this
architecture a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
little better. A poke causes some state on the server to
change;
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
change is reported to one or more subscribers. By decoupling
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some
part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't
cause
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
input line, in a way that the client can't (always) predict.
The
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
classic function-as-RPC approach would POST the key and return
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
new
input line in the response.
If instead we POST the key and send the new input line as a
diff,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If
you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more
elegant, I
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
hope.
The mismatch here is that this forces all requests to be
stateful.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
The
case
of check this text to see if it is parsable as hoon does not
need to
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
be
stateful though, so it seems like you are doing more work than
you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
want
to
do.
While the subscription model is generalizable to the stateless
case
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
On Sun, Nov 29, 2015 at 9:23 PM, Curtis Yarvin <
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but
rather
a
transaction whose result only contains content if it fails.
It's a
procedure, not a function, as it were. Or if it's a
function,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK
with an
empty body (Anton, correct me if I'm wrong). Again, this
naked
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
ack
is
a feature, not a bug; it's just what an end-to-end ack looks
like to
a
JS client.
If you want to read data from the server, you need a
subscription --
a
different communication pattern. Note however that the gall
appliance
gets the same bone if the same client both subscribes and
pokes
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
with
the same wire (caller's causal path), so it's easy for the
poke
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to
occur
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
in
the
subscription channel for this request. (e.g. /~/of/[ixor])
Would
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
I
use
the
same ixor that I got when I authenticated? or do I need to do
something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to
cause
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a
mechanism
similar to poke that works like a function call rather than a
procedure?
This is a lot of work for third party services to consume an
urbit
service
and is likely to be a hindrance to them. (Perhaps this is
desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
perfomed
a handshake for authentication and then hit a poke-json
arm in
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I
produce
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
from
the
poke-arm to send a response back? In other word what card
should
my
%gall
app produce to tell eyre send this out as a response to
this
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication
handshake.
Now
to
work out how to use that authentication handshake for
future
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
For reference this script with curl and jq does not
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for
posting
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand
from
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests
actually
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
making
use
of it. Any random auth.json oryx should in fact work
for
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"?
Is
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token
isn't
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
in
the
set
recorded for your session cookie (for example if you
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use when
you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl
for a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
bit
attempting to manually succeed in a handshake. It
looks
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code.
However
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
I
can't
figure out
how you get the csrf token to start with. It seems
like
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
a
bit
of
a chicken
and an egg problem to me. It won't let you resuse
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
oryx
from a
GEt
/~/auth.json so that won't work according to my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as
query
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
string
parameters, in which case the entire post body is
treated
as
the
message.
The query string can also contain 'anon', which
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as
long as
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
the
token/cookie and process for getting/using one is
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error
here.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
It’s
nice
to
be able to treat all HTTP requests as comets —
but
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
there
are
likely devices
that want to communicate over HTTP that can’t
set up
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way to
access
the
query string from
a hook file.
I suppose crashing in the app and sticking JSON
in
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way
to
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method
with
this
code.
And have that code get access to the payload in
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
emails
from
it, send an email to
<javascript:;>.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are
subscribed
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it,
send an email to
<javascript:;>.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
it,
send
an
<javascript:;>.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout
.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-30 22:42:43 UTC
Permalink
Like, my understanding of the original intent is something along the lines
of "POST hoon.hoon with a small typo in the middle, get line and column of
the typo as the http response". A pure function, certainly, but not one of
what would conventionally be considered a "path".
Post by Anton Dyudin
Ah, so the suggestion here is to stuff kilobytes of hoon into the
subscription path? For small values, the current .hook query string
protocol already works.
Post by Curtis Yarvin
There are two separate ways to improve %gall to support this: one, a
%read message with the "%peer then %pull" semantics; two, letting an
application declare an express gate that %gall detects, for when your
subscription path actually is a pure function.
Both these things should be done. But if you solve it first in %eyre,
Jeremy can use your solution as soon as possible...
Post by Curtis Yarvin
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do this
as a stateless GET.
Arguably, it's a feature that %eyre can and should implement - whether
or not there's any direct support for it in %gall. All you need to do
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already has
basic guarantees in place for ordered delivery of bytes etc., namely
TCP,
Post by Curtis Yarvin
Post by Anton Dyudin
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is
already a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
fail, and it's the server's problem if it can't work within that
constraint.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
Post by Anton Dyudin
I feel like that still fails to recouple that "send this string and
return a
result" is a stateless request when taken as a whole, which neither
"receive
this message and ack it" nor "serve some data you have saved" can
be.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke
was
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
the wrong thing to begin with, since there's no actual state
change.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
The absence of a simple GET was intentional, because it is a
special
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
case of the subscription model. On the server end, you have two
cases
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
of GET: one is genuinely stateless (the function is actually a
pure
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
function), the other is apparently stateless but in fact stateful
(eg,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use)
that
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
means GET, even though at the %gall level it becomes "subscribe
and
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
then close the subscription." Essentially you're right that
we're not
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
optimizing for this common special case, although I still insist
that
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your
subscription
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
bone.
Let me step back and explain the theory behind this
architecture a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
little better. A poke causes some state on the server to
change;
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
change is reported to one or more subscribers. By decoupling
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with
(some
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
part)
of server state. If some other user-agent caused the same
state
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
change, you would also see this update even though you didn't
cause
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
it.
For example, a trivial case of coupling is a console with
nontrivial
server-side update semantics. You press a key. This changes
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
input line, in a way that the client can't (always) predict.
The
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
classic function-as-RPC approach would POST the key and return
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
new
input line in the response.
If instead we POST the key and send the new input line as a
diff,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
same application -- though slightly more complex -- can be
trivially
generalized to let other users watch your console session. If
you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
did
it the classic way, this refactoring is nontrivial. Do you
want
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
feature in the product? Maybe, maybe not -- but you can see
how
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
separating "causing" from "watching" is abstractly more
elegant, I
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
hope.
The mismatch here is that this forces all requests to be
stateful.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
The
case
of check this text to see if it is parsable as hoon does not
need to
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
be
stateful though, so it seems like you are doing more work than
you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
want
to
do.
While the subscription model is generalizable to the stateless
case
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
On Sun, Nov 29, 2015 at 9:23 PM, Curtis Yarvin <
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but
rather
a
transaction whose result only contains content if it fails.
It's a
procedure, not a function, as it were. Or if it's a
function,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK
with an
empty body (Anton, correct me if I'm wrong). Again, this
naked
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
ack
is
a feature, not a bug; it's just what an end-to-end ack looks
like to
a
JS client.
If you want to read data from the server, you need a
subscription --
a
different communication pattern. Note however that the gall
appliance
gets the same bone if the same client both subscribes and
pokes
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
with
the same wire (caller's causal path), so it's easy for the
poke
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to
occur
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
in
the
subscription channel for this request. (e.g. /~/of/[ixor])
Would
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
I
use
the
same ixor that I got when I authenticated? or do I need to do
something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to
cause
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a
mechanism
similar to poke that works like a function call rather than a
procedure?
This is a lot of work for third party services to consume an
urbit
service
and is likely to be a hindrance to them. (Perhaps this is
desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
perfomed
a handshake for authentication and then hit a poke-json
arm in
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I
produce
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
from
the
poke-arm to send a response back? In other word what card
should
my
%gall
app produce to tell eyre send this out as a response to
this
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
For folks who want to follow along I'm keeping notes
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication
handshake.
Now
to
work out how to use that authentication handshake for
future
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
For reference this script with curl and jq does not
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for
posting
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand
from
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests
actually
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
making
use
of it. Any random auth.json oryx should in fact work
for
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you
reuse"? Is
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token
isn't
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
in
the
set
recorded for your session cookie (for example if you
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use
when you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl
for a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
bit
attempting to manually succeed in a handshake. It
looks
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code.
However
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
I
can't
figure out
how you get the csrf token to start with. It seems
like
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
a
bit
of
a chicken
and an egg problem to me. It won't let you resuse
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
oryx
from a
GEt
/~/auth.json so that won't work according to my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as
query
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
string
parameters, in which case the entire post body is
treated
as
the
message.
The query string can also contain 'anon', which
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as
long as
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
the
token/cookie and process for getting/using one is
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen
Wolfe-Pauly
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error
here.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
It’s
nice
to
be able to treat all HTTP requests as comets —
but
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
there
are
likely devices
that want to communicate over HTTP that can’t
set up
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way to
access
the
query string from
a hook file.
I suppose crashing in the app and sticking JSON
in
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way
to
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url,
method
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
with
this
code.
And have that code get access to the payload
in the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are
subscribed
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
emails
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
it,
send
an
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-11-30 22:47:51 UTC
Permalink
The original intent was indeed to support something along the lines of POST
hoon.hoon with a small typo in the middle and get line and column of the
typo as an http response.

There are probably many different ways to work around the unweildy nature
of the subscription model for this. And it is also possible that a future
iteration of the IDE as service may in fact become stateful. (Multiple
people editing the same code at the same time?)

However, I don't want to commit to stateful yet since it seems premature
for a Proof of Concept. So the question becomes... What is the best way
forward for that above notion? Just move forward with the subscription
model? Or is there a better work around?
Post by Anton Dyudin
Like, my understanding of the original intent is something along the lines
of "POST hoon.hoon with a small typo in the middle, get line and column of
the typo as the http response". A pure function, certainly, but not one of
what would conventionally be considered a "path".
Post by Anton Dyudin
Ah, so the suggestion here is to stuff kilobytes of hoon into the
subscription path? For small values, the current .hook query string
protocol already works.
Post by Curtis Yarvin
There are two separate ways to improve %gall to support this: one, a
%read message with the "%peer then %pull" semantics; two, letting an
application declare an express gate that %gall detects, for when your
subscription path actually is a pure function.
Both these things should be done. But if you solve it first in %eyre,
Jeremy can use your solution as soon as possible...
Post by Curtis Yarvin
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do this
as a stateless GET.
Arguably, it's a feature that %eyre can and should implement - whether
or not there's any direct support for it in %gall. All you need to do
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already
has
Post by Curtis Yarvin
Post by Anton Dyudin
basic guarantees in place for ordered delivery of bytes etc., namely
TCP,
Post by Curtis Yarvin
Post by Anton Dyudin
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is
already a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
fail, and it's the server's problem if it can't work within that
constraint.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
Post by Anton Dyudin
I feel like that still fails to recouple that "send this string
and
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
return a
result" is a stateless request when taken as a whole, which
neither
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
"receive
this message and ack it" nor "serve some data you have saved" can
be.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that
poke was
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
the wrong thing to begin with, since there's no actual state
change.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
The absence of a simple GET was intentional, because it is a
special
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
case of the subscription model. On the server end, you have two
cases
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
of GET: one is genuinely stateless (the function is actually a
pure
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
function), the other is apparently stateless but in fact
stateful (eg,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use)
that
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
means GET, even though at the %gall level it becomes "subscribe
and
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
then close the subscription." Essentially you're right that
we're not
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
optimizing for this common special case, although I still insist
that
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your
subscription
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
bone.
Let me step back and explain the theory behind this
architecture a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
little better. A poke causes some state on the server to
change;
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
change is reported to one or more subscribers. By decoupling
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with
(some
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
part)
of server state. If some other user-agent caused the same
state
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
change, you would also see this update even though you didn't
cause
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
it.
For example, a trivial case of coupling is a console with
nontrivial
server-side update semantics. You press a key. This changes
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
input line, in a way that the client can't (always) predict.
The
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
classic function-as-RPC approach would POST the key and
return the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
new
input line in the response.
If instead we POST the key and send the new input line as a
diff,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
same application -- though slightly more complex -- can be
trivially
generalized to let other users watch your console session.
If you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
did
it the classic way, this refactoring is nontrivial. Do you
want
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
feature in the product? Maybe, maybe not -- but you can see
how
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
separating "causing" from "watching" is abstractly more
elegant, I
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
hope.
The mismatch here is that this forces all requests to be
stateful.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
The
case
of check this text to see if it is parsable as hoon does not
need to
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
be
stateful though, so it seems like you are doing more work than
you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
want
to
do.
While the subscription model is generalizable to the stateless
case
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
On Sun, Nov 29, 2015 at 9:23 PM, Curtis Yarvin <
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC
but
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
rather
a
transaction whose result only contains content if it fails.
It's a
procedure, not a function, as it were. Or if it's a
function,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
it
returns void.
As long as the poke arm doesn't crash, you should get 200
OK
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
with an
empty body (Anton, correct me if I'm wrong). Again, this
naked
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
ack
is
a feature, not a bug; it's just what an end-to-end ack
looks
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
like to
a
JS client.
If you want to read data from the server, you need a
subscription --
a
different communication pattern. Note however that the
gall
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
appliance
gets the same bone if the same client both subscribes and
pokes
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
with
the same wire (caller's causal path), so it's easy for the
poke
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to
occur
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
in
the
subscription channel for this request. (e.g. /~/of/[ixor])
Would
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
I
use
the
same ixor that I got when I authenticated? or do I need to
do
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to
cause
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a
mechanism
similar to poke that works like a function call rather than
a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
procedure?
This is a lot of work for third party services to consume an
urbit
service
and is likely to be a hindrance to them. (Perhaps this is
desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
perfomed
a handshake for authentication and then hit a poke-json
arm in
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I
produce
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
from
the
poke-arm to send a response back? In other word what card
should
my
%gall
app produce to tell eyre send this out as a response to
this
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
For folks who want to follow along I'm keeping notes
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication
handshake.
Now
to
work out how to use that authentication handshake for
future
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
For reference this script with curl and jq does not
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for
posting
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I
understand from
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests
actually
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
making
use
of it. Any random auth.json oryx should in fact work
for
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you
reuse"? Is
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token
isn't
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
in
the
set
recorded for your session cookie (for example if
you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use
when you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl
for a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
bit
attempting to manually succeed in a handshake. It
looks
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code.
However
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
I
can't
figure out
how you get the csrf token to start with. It
seems like
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
a
bit
of
a chicken
and an egg problem to me. It won't let you resuse
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
oryx
from a
GEt
/~/auth.json so that won't work according to my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as
query
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
string
parameters, in which case the entire post body is
treated
as
the
message.
The query string can also contain 'anon', which
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as
long as
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
the
token/cookie and process for getting/using one
is
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen
Wolfe-Pauly
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error
here.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
It’s
nice
to
be able to treat all HTTP requests as comets —
but
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
there
are
likely devices
that want to communicate over HTTP that can’t
set up
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way to
access
the
query string from
a hook file.
I suppose crashing in the app and sticking
JSON in
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean
way to
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url,
method
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
with
this
code.
And have that code get access to the payload
in the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are
subscribed
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
emails
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
it,
send
an
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-11-30 22:50:20 UTC
Permalink
And my (uncharitable) reading of the response is "first you must acquire an
oryx, then you must begin a long-poll heartbeat subscription at that oryx,
then you must send the data as a json poke request and receive the response
on the subscription; this response will have to be saved by your app,
adding in-urbit state as well, but at least the bones are the same if you
got your paths right so you'll be able to figure out /where/ to send the
response maybe." "Oh an we have a way you could do the former but it is
WRONG in its unurbititude and you're really better off using the version
with all the moving parts, those are relevant and/or useful to this problem
we promise."
Post by Anton Dyudin
Like, my understanding of the original intent is something along the lines
of "POST hoon.hoon with a small typo in the middle, get line and column of
the typo as the http response". A pure function, certainly, but not one of
what would conventionally be considered a "path".
Post by Anton Dyudin
Ah, so the suggestion here is to stuff kilobytes of hoon into the
subscription path? For small values, the current .hook query string
protocol already works.
Post by Curtis Yarvin
There are two separate ways to improve %gall to support this: one, a
%read message with the "%peer then %pull" semantics; two, letting an
application declare an express gate that %gall detects, for when your
subscription path actually is a pure function.
Both these things should be done. But if you solve it first in %eyre,
Jeremy can use your solution as soon as possible...
Post by Curtis Yarvin
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do this
as a stateless GET.
Arguably, it's a feature that %eyre can and should implement - whether
or not there's any direct support for it in %gall. All you need to do
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already
has
Post by Curtis Yarvin
Post by Anton Dyudin
basic guarantees in place for ordered delivery of bytes etc., namely
TCP,
Post by Curtis Yarvin
Post by Anton Dyudin
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is
already a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
fail, and it's the server's problem if it can't work within that
constraint.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
Post by Anton Dyudin
I feel like that still fails to recouple that "send this string
and
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
return a
result" is a stateless request when taken as a whole, which
neither
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
"receive
this message and ack it" nor "serve some data you have saved" can
be.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that
poke was
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
the wrong thing to begin with, since there's no actual state
change.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
The absence of a simple GET was intentional, because it is a
special
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
case of the subscription model. On the server end, you have two
cases
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
of GET: one is genuinely stateless (the function is actually a
pure
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
function), the other is apparently stateless but in fact
stateful (eg,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use)
that
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
means GET, even though at the %gall level it becomes "subscribe
and
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
then close the subscription." Essentially you're right that
we're not
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
optimizing for this common special case, although I still insist
that
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your
subscription
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
bone.
Let me step back and explain the theory behind this
architecture a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
little better. A poke causes some state on the server to
change;
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
change is reported to one or more subscribers. By decoupling
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with
(some
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
part)
of server state. If some other user-agent caused the same
state
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
change, you would also see this update even though you didn't
cause
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
it.
For example, a trivial case of coupling is a console with
nontrivial
server-side update semantics. You press a key. This changes
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
input line, in a way that the client can't (always) predict.
The
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
classic function-as-RPC approach would POST the key and
return the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
new
input line in the response.
If instead we POST the key and send the new input line as a
diff,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
same application -- though slightly more complex -- can be
trivially
generalized to let other users watch your console session.
If you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
did
it the classic way, this refactoring is nontrivial. Do you
want
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
feature in the product? Maybe, maybe not -- but you can see
how
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
separating "causing" from "watching" is abstractly more
elegant, I
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
hope.
The mismatch here is that this forces all requests to be
stateful.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
The
case
of check this text to see if it is parsable as hoon does not
need to
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
be
stateful though, so it seems like you are doing more work than
you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
want
to
do.
While the subscription model is generalizable to the stateless
case
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
On Sun, Nov 29, 2015 at 9:23 PM, Curtis Yarvin <
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC
but
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
rather
a
transaction whose result only contains content if it fails.
It's a
procedure, not a function, as it were. Or if it's a
function,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
it
returns void.
As long as the poke arm doesn't crash, you should get 200
OK
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
with an
empty body (Anton, correct me if I'm wrong). Again, this
naked
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
ack
is
a feature, not a bug; it's just what an end-to-end ack
looks
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
like to
a
JS client.
If you want to read data from the server, you need a
subscription --
a
different communication pattern. Note however that the
gall
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
appliance
gets the same bone if the same client both subscribes and
pokes
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
with
the same wire (caller's causal path), so it's easy for the
poke
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to
occur
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
in
the
subscription channel for this request. (e.g. /~/of/[ixor])
Would
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
I
use
the
same ixor that I got when I authenticated? or do I need to
do
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to
cause
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a
mechanism
similar to poke that works like a function call rather than
a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
procedure?
This is a lot of work for third party services to consume an
urbit
service
and is likely to be a hindrance to them. (Perhaps this is
desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
perfomed
a handshake for authentication and then hit a poke-json
arm in
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I
produce
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
from
the
poke-arm to send a response back? In other word what card
should
my
%gall
app produce to tell eyre send this out as a response to
this
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
For folks who want to follow along I'm keeping notes
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication
handshake.
Now
to
work out how to use that authentication handshake for
future
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
For reference this script with curl and jq does not
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for
posting
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I
understand from
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests
actually
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
making
use
of it. Any random auth.json oryx should in fact work
for
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you
reuse"? Is
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token
isn't
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
in
the
set
recorded for your session cookie (for example if
you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use
when you
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl
for a
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
bit
attempting to manually succeed in a handshake. It
looks
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code.
However
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
I
can't
figure out
how you get the csrf token to start with. It
seems like
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
a
bit
of
a chicken
and an egg problem to me. It won't let you resuse
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
oryx
from a
GEt
/~/auth.json so that won't work according to my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as
query
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
string
parameters, in which case the entire post body is
treated
as
the
message.
The query string can also contain 'anon', which
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as
long as
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
the
token/cookie and process for getting/using one
is
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen
Wolfe-Pauly
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error
here.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
It’s
nice
to
be able to treat all HTTP requests as comets —
but
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
there
are
likely devices
that want to communicate over HTTP that can’t
set up
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way to
access
the
query string from
a hook file.
I suppose crashing in the app and sticking
JSON in
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean
way to
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url,
method
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
with
this
code.
And have that code get access to the payload
in the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are
subscribed
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
emails
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to
the
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
it,
send
an
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Curtis Yarvin
2015-11-30 23:05:44 UTC
Permalink
First of all (now that I'm reminded of what you're actually doing),
Anton is right that you should be using a hook, not connecting to an
appliance, because the data you want is not a function of any
particular appliance state. So most of the discussion above is, while
interesting and valid, not relevant to what you're trying to do.

Second, the potential size of the data here makes a GET request
impractical. We can still do it this way for testing, but you simply
can't cram the value into the URL string.

That creates another %eyre endpoint / protocol need: the "POST that's
really a GET." I don't know if there's a standard way of framing this
in an API, but if so we should use it.
Post by Anton Dyudin
And my (uncharitable) reading of the response is "first you must acquire an
oryx, then you must begin a long-poll heartbeat subscription at that oryx,
then you must send the data as a json poke request and receive the response
on the subscription; this response will have to be saved by your app, adding
in-urbit state as well, but at least the bones are the same if you got your
paths right so you'll be able to figure out /where/ to send the response
maybe." "Oh an we have a way you could do the former but it is WRONG in its
unurbititude and you're really better off using the version with all the
moving parts, those are relevant and/or useful to this problem we promise."
Post by Anton Dyudin
Like, my understanding of the original intent is something along the lines
of "POST hoon.hoon with a small typo in the middle, get line and column of
the typo as the http response". A pure function, certainly, but not one of
what would conventionally be considered a "path".
Post by Anton Dyudin
Ah, so the suggestion here is to stuff kilobytes of hoon into the
subscription path? For small values, the current .hook query string protocol
already works.
Post by Curtis Yarvin
There are two separate ways to improve %gall to support this: one, a
%read message with the "%peer then %pull" semantics; two, letting an
application declare an express gate that %gall detects, for when your
subscription path actually is a pure function.
Both these things should be done. But if you solve it first in %eyre,
Jeremy can use your solution as soon as possible...
Post by Curtis Yarvin
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do this
as a stateless GET.
Arguably, it's a feature that %eyre can and should implement - whether
or not there's any direct support for it in %gall. All you need to do
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already has
basic guarantees in place for ordered delivery of bytes etc., namely TCP,
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is already a
fail, and it's the server's problem if it can't work within that constraint.
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
Post by Anton Dyudin
I feel like that still fails to recouple that "send this string and
return a
result" is a stateless request when taken as a whole, which neither
"receive
this message and ack it" nor "serve some data you have saved" can be.
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke was
the wrong thing to begin with, since there's no actual state change.
The absence of a simple GET was intentional, because it is a special
case of the subscription model. On the server end, you have two
cases
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact
stateful (eg,
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that
we're not
optimizing for this common special case, although I still insist that
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
On Mon, Nov 30, 2015 at 1:54 PM, Curtis Yarvin
Post by Curtis Yarvin
You should produce a %diff card and return it on your
subscription
bone.
Let me step back and explain the theory behind this
architecture a
little better. A poke causes some state on the server to
change;
this
change is reported to one or more subscribers. By decoupling
the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with
(some
part)
of server state. If some other user-agent caused the same
state
change, you would also see this update even though you didn't
cause
it.
For example, a trivial case of coupling is a console with
nontrivial
server-side update semantics. You press a key. This changes
the
input line, in a way that the client can't (always) predict.
The
classic function-as-RPC approach would POST the key and
return the
new
input line in the response.
If instead we POST the key and send the new input line as a
diff,
this
same application -- though slightly more complex -- can be
trivially
generalized to let other users watch your console session.
If you
did
it the classic way, this refactoring is nontrivial. Do you
want
this
feature in the product? Maybe, maybe not -- but you can see
how
separating "causing" from "watching" is abstractly more
elegant, I
hope.
The mismatch here is that this forces all requests to be
stateful.
The
case
of check this text to see if it is parsable as hoon does not
need to
be
stateful though, so it seems like you are doing more work than
you
want
to
do.
While the subscription model is generalizable to the stateless
case
it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
On Sun, Nov 29, 2015 at 9:23 PM, Curtis Yarvin
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC
but
rather
a
transaction whose result only contains content if it
fails.
It's a
procedure, not a function, as it were. Or if it's a
function,
it
returns void.
As long as the poke arm doesn't crash, you should get 200
OK
with an
empty body (Anton, correct me if I'm wrong). Again, this
naked
ack
is
a feature, not a bug; it's just what an end-to-end ack
looks
like to
a
JS client.
If you want to read data from the server, you need a
subscription --
a
different communication pattern. Note however that the
gall
appliance
gets the same bone if the same client both subscribes and
pokes
with
the same wire (caller's causal path), so it's easy for the
poke
to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to
occur
in
the
subscription channel for this request. (e.g. /~/of/[ixor])
Would
I
use
the
same ixor that I got when I authenticated? or do I need to
do
something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to
cause
things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce
a
mechanism
similar to poke that works like a function call rather than
a
procedure?
This is a lot of work for third party services to consume
an
urbit
service
and is likely to be a hindrance to them. (Perhaps this is
desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
perfomed
a handshake for authentication and then hit a poke-json
arm in
a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I
produce
from
the
poke-arm to send a response back? In other word what
card
should
my
%gall
app produce to tell eyre send this out as a response to
this
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
For folks who want to follow along I'm keeping notes
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful authentication
handshake.
Now
to
work out how to use that authentication handshake for
future
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
For reference this script with curl and jq does not
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for
posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I
understand from
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests
actually
making
use
of it. Any random auth.json oryx should in fact work
for
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you
reuse"? Is
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token
isn't
in
the
set
recorded for your session cookie (for example if
you
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use
when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl
for a
bit
attempting to manually succeed in a handshake. It
looks
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code.
However
I
can't
figure out
how you get the csrf token to start with. It
seems like
a
bit
of
a chicken
and an egg problem to me. It won't let you resuse
the
oryx
from a
GEt
/~/auth.json so that won't work according to my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as
query
string
parameters, in which case the entire post body
is
treated
as
the
message.
The query string can also contain 'anon', which
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as
long as
the
token/cookie and process for getting/using one
is
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen
Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error
here.
It’s
nice
to
be able to treat all HTTP requests as comets —
but
there
are
likely devices
that want to communicate over HTTP that can’t
set up
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way to
access
the
query string from
a hook file.
I suppose crashing in the app and sticking
JSON in
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean
way to
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url,
method
with
this
code.
And have that code get access to the payload
in the
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are
subscribed
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
emails
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to
the
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails
from
it,
send
an
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-11-30 23:45:41 UTC
Permalink
That was my initial impression at first as well. I embarked on the %gall
app journey when it became clear there was no way to get access to the
request body in a hook.
Post by Curtis Yarvin
First of all (now that I'm reminded of what you're actually doing),
Anton is right that you should be using a hook, not connecting to an
appliance, because the data you want is not a function of any
particular appliance state. So most of the discussion above is, while
interesting and valid, not relevant to what you're trying to do.
Second, the potential size of the data here makes a GET request
impractical. We can still do it this way for testing, but you simply
can't cram the value into the URL string.
That creates another %eyre endpoint / protocol need: the "POST that's
really a GET." I don't know if there's a standard way of framing this
in an API, but if so we should use it.
Post by Anton Dyudin
And my (uncharitable) reading of the response is "first you must acquire
an
Post by Anton Dyudin
oryx, then you must begin a long-poll heartbeat subscription at that
oryx,
Post by Anton Dyudin
then you must send the data as a json poke request and receive the
response
Post by Anton Dyudin
on the subscription; this response will have to be saved by your app,
adding
Post by Anton Dyudin
in-urbit state as well, but at least the bones are the same if you got
your
Post by Anton Dyudin
paths right so you'll be able to figure out /where/ to send the response
maybe." "Oh an we have a way you could do the former but it is WRONG in
its
Post by Anton Dyudin
unurbititude and you're really better off using the version with all the
moving parts, those are relevant and/or useful to this problem we
promise."
Post by Anton Dyudin
Post by Anton Dyudin
Like, my understanding of the original intent is something along the
lines
Post by Anton Dyudin
Post by Anton Dyudin
of "POST hoon.hoon with a small typo in the middle, get line and column
of
Post by Anton Dyudin
Post by Anton Dyudin
the typo as the http response". A pure function, certainly, but not one
of
Post by Anton Dyudin
Post by Anton Dyudin
what would conventionally be considered a "path".
Post by Anton Dyudin
Ah, so the suggestion here is to stuff kilobytes of hoon into the
subscription path? For small values, the current .hook query string
protocol
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
already works.
Post by Curtis Yarvin
There are two separate ways to improve %gall to support this: one, a
%read message with the "%peer then %pull" semantics; two, letting an
application declare an express gate that %gall detects, for when your
subscription path actually is a pure function.
Both these things should be done. But if you solve it first in %eyre,
Jeremy can use your solution as soon as possible...
Post by Curtis Yarvin
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do
this
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
as a stateless GET.
Arguably, it's a feature that %eyre can and should implement -
whether
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
or not there's any direct support for it in %gall. All you need to
do
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already has
basic guarantees in place for ordered delivery of bytes etc.,
namely
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
TCP,
and everything session-specific (besides possibly authentication)
is
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is already a
fail, and it's the server's problem if it can't work within that
constraint.
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and
indeed
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
Post by Anton Dyudin
I feel like that still fails to recouple that "send this string and
return a
result" is a stateless request when taken as a whole, which neither
"receive
this message and ack it" nor "serve some data you have saved"
can
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
be.
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that
poke was
the wrong thing to begin with, since there's no actual state
change.
The absence of a simple GET was intentional, because it is a
special
case of the subscription model. On the server end, you have
two
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
cases
of GET: one is genuinely stateless (the function is actually a
pure
function), the other is apparently stateless but in fact
stateful (eg,
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use)
that
means GET, even though at the %gall level it becomes
"subscribe
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
and
then close the subscription." Essentially you're right that
we're not
optimizing for this common special case, although I still
insist
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
that
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
On Mon, Nov 30, 2015 at 1:54 PM, Curtis Yarvin
Post by Curtis Yarvin
You should produce a %diff card and return it on your
subscription
bone.
Let me step back and explain the theory behind this
architecture a
little better. A poke causes some state on the server to
change;
this
change is reported to one or more subscribers. By
decoupling
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
the
effect and the change report, we're forcing you to create
an
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
application that works by keeping subscribers in sync with
(some
part)
of server state. If some other user-agent caused the same
state
change, you would also see this update even though you
didn't
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
cause
it.
For example, a trivial case of coupling is a console with
nontrivial
server-side update semantics. You press a key. This
changes
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
the
input line, in a way that the client can't (always)
predict.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
The
classic function-as-RPC approach would POST the key and
return the
new
input line in the response.
If instead we POST the key and send the new input line as a
diff,
this
same application -- though slightly more complex -- can be
trivially
generalized to let other users watch your console session.
If you
did
it the classic way, this refactoring is nontrivial. Do you
want
this
feature in the product? Maybe, maybe not -- but you can
see
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
how
separating "causing" from "watching" is abstractly more
elegant, I
hope.
The mismatch here is that this forces all requests to be
stateful.
The
case
of check this text to see if it is parsable as hoon does not
need to
be
stateful though, so it seems like you are doing more work
than
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
you
want
to
do.
While the subscription model is generalizable to the
stateless
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
case
it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
On Sun, Nov 29, 2015 at 9:23 PM, Curtis Yarvin
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC
but
rather
a
transaction whose result only contains content if it
fails.
It's a
procedure, not a function, as it were. Or if it's a
function,
it
returns void.
As long as the poke arm doesn't crash, you should get
200
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
OK
with an
empty body (Anton, correct me if I'm wrong). Again,
this
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
naked
ack
is
a feature, not a bug; it's just what an end-to-end ack
looks
like to
a
JS client.
If you want to read data from the server, you need a
subscription --
a
different communication pattern. Note however that the
gall
appliance
gets the same bone if the same client both subscribes
and
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
pokes
with
the same wire (caller's causal path), so it's easy for
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
poke
to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something
to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
occur
in
the
subscription channel for this request. (e.g.
/~/of/[ixor])
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Would
I
use
the
same ixor that I got when I authenticated? or do I need
to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
do
something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce
to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
cause
things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to
introduce
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
a
mechanism
similar to poke that works like a function call rather
than
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
a
procedure?
This is a lot of work for third party services to consume
an
urbit
service
and is likely to be a hindrance to them. (Perhaps this is
desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
perfomed
a handshake for authentication and then hit a
poke-json
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
arm in
a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I
produce
from
the
poke-arm to send a response back? In other word what
card
should
my
%gall
app produce to tell eyre send this out as a response
to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
this
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
For folks who want to follow along I'm keeping notes
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication
handshake.
Now
to
work out how to use that authentication handshake for
future
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out.
My
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
For reference this script with curl and jq does not
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for
posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I
understand from
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests
actually
making
use
of it. Any random auth.json oryx should in fact
work
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
for
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you
reuse"? Is
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf
token
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
isn't
in
the
set
recorded for your session cookie (for example if
you
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since
I
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use
when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with
curl
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
for a
bit
attempting to manually succeed in a handshake.
It
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
looks
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code.
However
I
can't
figure out
how you get the csrf token to start with. It
seems like
a
bit
of
a chicken
and an egg problem to me. It won't let you
resuse
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
the
oryx
from a
GEt
/~/auth.json so that won't work according to my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx
as
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
query
string
parameters, in which case the entire post body
is
treated
as
the
message.
The query string can also contain 'anon',
which
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as
long as
the
token/cookie and process for getting/using
one
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
is
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen
Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error
here.
It’s
nice
to
be able to treat all HTTP requests as
comets —
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
but
there
are
likely devices
that want to communicate over HTTP that
can’t
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
set up
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way
to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
access
the
query string from
a hook file.
I suppose crashing in the app and sticking
JSON in
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean
way to
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url,
method
with
this
code.
And have that code get access to the
payload
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
in the
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist
yet?
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are
subscribed
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
emails
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed
to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
the
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving
emails
Post by Anton Dyudin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
from
it,
send
an
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Curtis Yarvin
2015-12-01 00:37:57 UTC
Permalink
Putting a POST-as-GET protocol into %eyre is, I suspect, well within
your abilities. If not, I'd recommend testing it with a hook and
Anton will put in the %eyre functionality. It's clearly something we
should have...
That was my initial impression at first as well. I embarked on the %gall app
journey when it became clear there was no way to get access to the request
body in a hook.
Post by Curtis Yarvin
First of all (now that I'm reminded of what you're actually doing),
Anton is right that you should be using a hook, not connecting to an
appliance, because the data you want is not a function of any
particular appliance state. So most of the discussion above is, while
interesting and valid, not relevant to what you're trying to do.
Second, the potential size of the data here makes a GET request
impractical. We can still do it this way for testing, but you simply
can't cram the value into the URL string.
That creates another %eyre endpoint / protocol need: the "POST that's
really a GET." I don't know if there's a standard way of framing this
in an API, but if so we should use it.
Post by Anton Dyudin
And my (uncharitable) reading of the response is "first you must acquire an
oryx, then you must begin a long-poll heartbeat subscription at that oryx,
then you must send the data as a json poke request and receive the response
on the subscription; this response will have to be saved by your app, adding
in-urbit state as well, but at least the bones are the same if you got your
paths right so you'll be able to figure out /where/ to send the response
maybe." "Oh an we have a way you could do the former but it is WRONG in its
unurbititude and you're really better off using the version with all the
moving parts, those are relevant and/or useful to this problem we promise."
Post by Anton Dyudin
Like, my understanding of the original intent is something along the lines
of "POST hoon.hoon with a small typo in the middle, get line and column of
the typo as the http response". A pure function, certainly, but not one of
what would conventionally be considered a "path".
Post by Anton Dyudin
Ah, so the suggestion here is to stuff kilobytes of hoon into the
subscription path? For small values, the current .hook query string protocol
already works.
Post by Curtis Yarvin
There are two separate ways to improve %gall to support this: one, a
%read message with the "%peer then %pull" semantics; two, letting an
application declare an express gate that %gall detects, for when your
subscription path actually is a pure function.
Both these things should be done. But if you solve it first in %eyre,
Jeremy can use your solution as soon as possible...
Post by Curtis Yarvin
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do this
as a stateless GET.
Arguably, it's a feature that %eyre can and should implement - whether
or not there's any direct support for it in %gall. All you need to do
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already
has
basic guarantees in place for ordered delivery of bytes etc., namely
TCP,
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is
already a
fail, and it's the server's problem if it can't work within that
constraint.
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
Post by Anton Dyudin
I feel like that still fails to recouple that "send this string
and
return a
result" is a stateless request when taken as a whole, which
neither
"receive
this message and ack it" nor "serve some data you have saved" can
be.
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that
poke was
the wrong thing to begin with, since there's no actual state
change.
The absence of a simple GET was intentional, because it is a
special
case of the subscription model. On the server end, you have
two
cases
of GET: one is genuinely stateless (the function is actually a
pure
function), the other is apparently stateless but in fact
stateful (eg,
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use)
that
means GET, even though at the %gall level it becomes "subscribe
and
then close the subscription." Essentially you're right that
we're not
optimizing for this common special case, although I still
insist
that
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
On Mon, Nov 30, 2015 at 1:54 PM, Curtis Yarvin
Post by Curtis Yarvin
You should produce a %diff card and return it on your
subscription
bone.
Let me step back and explain the theory behind this
architecture a
little better. A poke causes some state on the server to
change;
this
change is reported to one or more subscribers. By
decoupling
the
effect and the change report, we're forcing you to create
an
application that works by keeping subscribers in sync with
(some
part)
of server state. If some other user-agent caused the same
state
change, you would also see this update even though you
didn't
cause
it.
For example, a trivial case of coupling is a console with
nontrivial
server-side update semantics. You press a key. This
changes
the
input line, in a way that the client can't (always)
predict.
The
classic function-as-RPC approach would POST the key and
return the
new
input line in the response.
If instead we POST the key and send the new input line as
a
diff,
this
same application -- though slightly more complex -- can be
trivially
generalized to let other users watch your console session.
If you
did
it the classic way, this refactoring is nontrivial. Do
you
want
this
feature in the product? Maybe, maybe not -- but you can
see
how
separating "causing" from "watching" is abstractly more
elegant, I
hope.
The mismatch here is that this forces all requests to be
stateful.
The
case
of check this text to see if it is parsable as hoon does
not
need to
be
stateful though, so it seems like you are doing more work
than
you
want
to
do.
While the subscription model is generalizable to the
stateless
case
it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
On Sun, Nov 29, 2015 at 9:23 PM, Curtis Yarvin
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an
RPC
but
rather
a
transaction whose result only contains content if it
fails.
It's a
procedure, not a function, as it were. Or if it's a
function,
it
returns void.
As long as the poke arm doesn't crash, you should get
200
OK
with an
empty body (Anton, correct me if I'm wrong). Again,
this
naked
ack
is
a feature, not a bug; it's just what an end-to-end ack
looks
like to
a
JS client.
If you want to read data from the server, you need a
subscription --
a
different communication pattern. Note however that the
gall
appliance
gets the same bone if the same client both subscribes
and
pokes
with
the same wire (caller's causal path), so it's easy for
the
poke
to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something
to
occur
in
the
subscription channel for this request. (e.g.
/~/of/[ixor])
Would
I
use
the
same ixor that I got when I authenticated? or do I need
to
do
something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce
to
cause
things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to
introduce
a
mechanism
similar to poke that works like a function call rather
than
a
procedure?
This is a lot of work for third party services to
consume
an
urbit
service
and is likely to be a hindrance to them. (Perhaps this
is
desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road.
I've
successfully
perfomed
a handshake for authentication and then hit a
poke-json
arm in
a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I
produce
from
the
poke-arm to send a response back? In other word what
card
should
my
%gall
app produce to tell eyre send this out as a response
to
this
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
Post by Jeremy Wall
For folks who want to follow along I'm keeping notes
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
I've worked out how to do a successful
authentication
handshake.
Now
to
work out how to use that authentication handshake
for
future
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out.
My
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
For reference this script with curl and jq does
not
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload
for
posting
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I
understand from
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests
actually
making
use
of it. Any random auth.json oryx should in fact
work
for
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you
reuse"? Is
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf
token
isn't
in
the
set
recorded for your session cookie (for example
if
you
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since
I
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use
when you
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with
curl
for a
bit
attempting to manually succeed in a handshake.
It
looks
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code.
However
I
can't
figure out
how you get the csrf token to start with. It
seems like
a
bit
of
a chicken
and an egg problem to me. It won't let you
resuse
the
oryx
from a
GEt
/~/auth.json so that won't work according to
my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
Post by Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx
as
query
string
parameters, in which case the entire post
body
is
treated
as
the
message.
The query string can also contain 'anon',
which
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets
as
long as
the
token/cookie and process for getting/using
one
is
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen
Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design
error
here.
It’s
nice
to
be able to treat all HTTP requests as
comets —
but
there
are
likely devices
that want to communicate over HTTP that
can’t
set up
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way
to
access
the
query string from
a hook file.
I suppose crashing in the app and sticking
JSON in
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean
way to
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url,
method
with
this
code.
And have that code get access to the
payload
in the
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist
yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are
subscribed
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
emails
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed
to
the
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it,
send
an
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-12-04 19:59:21 UTC
Permalink
Of possible interest: https://github.com/ohAitch/urbit/tree/pub-repl is a
WIP "notebook"-style REPL. If your eyre query-string POST changes are in,
the front-end could be converted to send the "eval="+window.util.urle(str)
line as post data, with no changes to any surrounding code; this would
allow the evaluation of reasonably large hoon expressions.
Post by Curtis Yarvin
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do this
as a stateless GET.
Arguably, it's a feature that %eyre can and should implement - whether
or not there's any direct support for it in %gall. All you need to do
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already has
basic guarantees in place for ordered delivery of bytes etc., namely TCP,
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is already a
fail, and it's the server's problem if it can't work within that
constraint.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
I feel like that still fails to recouple that "send this string and return a
result" is a stateless request when taken as a whole, which neither "receive
this message and ack it" nor "serve some data you have saved" can be.
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke
was
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
the wrong thing to begin with, since there's no actual state change.
The absence of a simple GET was intentional, because it is a special
case of the subscription model. On the server end, you have two
cases
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful
(eg,
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're
not
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
optimizing for this common special case, although I still insist
that
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your
subscription
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
bone.
Let me step back and explain the theory behind this architecture
a
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
little better. A poke causes some state on the server to change; this
change is reported to one or more subscribers. By decoupling the
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't
cause
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes the
input line, in a way that the client can't (always) predict. The
classic function-as-RPC approach would POST the key and return
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
new
input line in the response.
If instead we POST the key and send the new input line as a diff, this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If
you
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more elegant,
I
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
hope.
The mismatch here is that this forces all requests to be stateful. The
case
of check this text to see if it is parsable as hoon does not need
to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
be
stateful though, so it seems like you are doing more work than you want
to
do.
While the subscription model is generalizable to the stateless
case
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but
rather
a
transaction whose result only contains content if it fails.
It's a
procedure, not a function, as it were. Or if it's a function, it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK
with an
empty body (Anton, correct me if I'm wrong). Again, this
naked
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
ack
is
a feature, not a bug; it's just what an end-to-end ack looks
like to
a
JS client.
If you want to read data from the server, you need a
subscription --
a
different communication pattern. Note however that the gall
appliance
gets the same bone if the same client both subscribes and
pokes
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
with
the same wire (caller's causal path), so it's easy for the
poke
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to
occur
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
in
the
subscription channel for this request. (e.g. /~/of/[ixor])
Would
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
I
use
the
same ixor that I got when I authenticated? or do I need to do
something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to
cause
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a
mechanism
similar to poke that works like a function call rather than a
procedure?
This is a lot of work for third party services to consume an urbit
service
and is likely to be a hindrance to them. (Perhaps this is desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
perfomed
a handshake for authentication and then hit a poke-json arm
in
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I produce
from
the
poke-arm to send a response back? In other word what card
should
my
%gall
app produce to tell eyre send this out as a response to this
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication
handshake.
Now
to
work out how to use that authentication handshake for
future
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for
posting
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand
from
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests
actually
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
making
use
of it. Any random auth.json oryx should in fact work for
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"?
Is
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token
isn't
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
in
the
set
recorded for your session cookie (for example if you
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use when
you
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl
for a
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
bit
attempting to manually succeed in a handshake. It
looks
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code.
However
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
I
can't
figure out
how you get the csrf token to start with. It seems
like
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
a
bit
of
a chicken
and an egg problem to me. It won't let you resuse the
oryx
from a
GEt
/~/auth.json so that won't work according to my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as
query
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
string
parameters, in which case the entire post body is
treated
as
the
message.
The query string can also contain 'anon', which
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as long
as
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
the
token/cookie and process for getting/using one is
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error here.
It’s
nice
to
be able to treat all HTTP requests as comets — but
there
are
likely devices
that want to communicate over HTTP that can’t set
up
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way to
access
the
query string from
a hook file.
I suppose crashing in the app and sticking JSON in
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way to
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method
with
this
code.
And have that code get access to the payload in
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are
subscribed
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Jeremy Wall
it,
send
an
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy Wall
2015-12-04 20:04:56 UTC
Permalink
Nice!

I've been absorbing eyre code for a few days now and feel like I'm close to
being able to make some changes. Right now I'me exploring the connection
between eyre and ford to identify the right way to add post body support to
ford pages.
Post by Anton Dyudin
Of possible interest: https://github.com/ohAitch/urbit/tree/pub-repl is a
WIP "notebook"-style REPL. If your eyre query-string POST changes are in,
the front-end could be converted to send the "eval="+window.util.urle(str)
line as post data, with no changes to any surrounding code; this would
allow the evaluation of reasonably large hoon expressions.
Post by Curtis Yarvin
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do this
as a stateless GET.
Arguably, it's a feature that %eyre can and should implement - whether
or not there's any direct support for it in %gall. All you need to do
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already has
basic guarantees in place for ordered delivery of bytes etc., namely
TCP,
Post by Anton Dyudin
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is already
a
Post by Anton Dyudin
Post by Anton Dyudin
fail, and it's the server's problem if it can't work within that
constraint.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
I feel like that still fails to recouple that "send this string and return a
result" is a stateless request when taken as a whole, which neither "receive
this message and ack it" nor "serve some data you have saved" can
be.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke
was
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
the wrong thing to begin with, since there's no actual state
change.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
The absence of a simple GET was intentional, because it is a
special
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
case of the subscription model. On the server end, you have two
cases
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful
(eg,
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're
not
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
optimizing for this common special case, although I still insist
that
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your
subscription
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
bone.
Let me step back and explain the theory behind this
architecture a
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
little better. A poke causes some state on the server to
change;
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
change is reported to one or more subscribers. By decoupling
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some
part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't
cause
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
input line, in a way that the client can't (always) predict.
The
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
classic function-as-RPC approach would POST the key and return
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
new
input line in the response.
If instead we POST the key and send the new input line as a
diff,
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If
you
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more
elegant, I
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
hope.
The mismatch here is that this forces all requests to be
stateful.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
The
case
of check this text to see if it is parsable as hoon does not
need to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
be
stateful though, so it seems like you are doing more work than
you
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
want
to
do.
While the subscription model is generalizable to the stateless
case
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
On Sun, Nov 29, 2015 at 9:23 PM, Curtis Yarvin <
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but
rather
a
transaction whose result only contains content if it fails.
It's a
procedure, not a function, as it were. Or if it's a
function,
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK
with an
empty body (Anton, correct me if I'm wrong). Again, this
naked
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
ack
is
a feature, not a bug; it's just what an end-to-end ack looks
like to
a
JS client.
If you want to read data from the server, you need a
subscription --
a
different communication pattern. Note however that the gall
appliance
gets the same bone if the same client both subscribes and
pokes
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
with
the same wire (caller's causal path), so it's easy for the
poke
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to
occur
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
in
the
subscription channel for this request. (e.g. /~/of/[ixor])
Would
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
I
use
the
same ixor that I got when I authenticated? or do I need to do
something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to
cause
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a
mechanism
similar to poke that works like a function call rather than a
procedure?
This is a lot of work for third party services to consume an
urbit
service
and is likely to be a hindrance to them. (Perhaps this is
desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
perfomed
a handshake for authentication and then hit a poke-json
arm in
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I
produce
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
from
the
poke-arm to send a response back? In other word what card
should
my
%gall
app produce to tell eyre send this out as a response to
this
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication
handshake.
Now
to
work out how to use that authentication handshake for
future
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
For reference this script with curl and jq does not
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for
posting
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand
from
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests
actually
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
making
use
of it. Any random auth.json oryx should in fact work
for
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"?
Is
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token
isn't
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
in
the
set
recorded for your session cookie (for example if you
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use when
you
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl
for a
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
bit
attempting to manually succeed in a handshake. It
looks
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code.
However
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
I
can't
figure out
how you get the csrf token to start with. It seems
like
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
a
bit
of
a chicken
and an egg problem to me. It won't let you resuse
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
oryx
from a
GEt
/~/auth.json so that won't work according to my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as
query
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
string
parameters, in which case the entire post body is
treated
as
the
message.
The query string can also contain 'anon', which
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as
long as
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
the
token/cookie and process for getting/using one is
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error
here.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
It’s
nice
to
be able to treat all HTTP requests as comets —
but
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
there
are
likely devices
that want to communicate over HTTP that can’t
set up
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way to
access
the
query string from
a hook file.
I suppose crashing in the app and sticking JSON
in
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way
to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method
with
this
code.
And have that code get access to the payload in
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are
subscribed
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
it,
send
an
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout
.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
***@marzhillstudios.com
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Anton Dyudin
2015-12-04 20:05:49 UTC
Permalink
To run, boot a fakezod and http://localhost:8443/home/pub/repl;
alternately, sync it onto your ship, but no guarantees on that being safe :P

Press enter to evaluate an expression, shift-enter to insert a literal
newline; going back and editing expressions does not insert all the DOM
nodes in the right places, but broadly works.
Post by Anton Dyudin
Of possible interest: https://github.com/ohAitch/urbit/tree/pub-repl is a
WIP "notebook"-style REPL. If your eyre query-string POST changes are in,
the front-end could be converted to send the "eval="+window.util.urle(str)
line as post data, with no changes to any surrounding code; this would
allow the evaluation of reasonably large hoon expressions.
Post by Curtis Yarvin
I do think Jeremy's client can probably work around this, but he
shouldn't have to. I agree that an HTTP client needs a way to do this
as a stateless GET.
Arguably, it's a feature that %eyre can and should implement - whether
or not there's any direct support for it in %gall. All you need to do
is send %peer and then %pull, I think -- effectively, GET means
unsubscribing as the second action in the session. You don't even
have to wait for the result of %peer to come back in order to send
your %pull.
Post by Anton Dyudin
(Specifically, domain-specific connection state. The client already has
basic guarantees in place for ordered delivery of bytes etc., namely
TCP,
Post by Anton Dyudin
and everything session-specific (besides possibly authentication) is
declared to be the wrong abstraction to use)
Post by Anton Dyudin
I think the point of REST is connection state on the client is already
a
Post by Anton Dyudin
Post by Anton Dyudin
fail, and it's the server's problem if it can't work within that
constraint.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
That's precisely the point of the RESTful style -- the GET is
*metaphorically* stateless. If we force it to be *actually*
stateless, we are piercing an abstraction layer.
Suppose I log a GET request. Suppose I don't. This can and indeed
must be invisible to the client. If to log I have to change the
client behavior, that's a fail.
I feel like that still fails to recouple that "send this string and return a
result" is a stateless request when taken as a whole, which neither "receive
this message and ack it" nor "serve some data you have saved" can
be.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Jeremy, we're on the same page. The mismatch *here* is that poke
was
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
the wrong thing to begin with, since there's no actual state
change.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
The absence of a simple GET was intentional, because it is a
special
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
case of the subscription model. On the server end, you have two
cases
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
of GET: one is genuinely stateless (the function is actually a pure
function), the other is apparently stateless but in fact stateful
(eg,
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
some data needs to be fetched). The client should not see the
difference.
But we *do* need a message type (both for web and non-web use) that
means GET, even though at the %gall level it becomes "subscribe and
then close the subscription." Essentially you're right that we're
not
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
optimizing for this common special case, although I still insist
that
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
it's a special case.
On Mon, Nov 30, 2015 at 1:48 PM, Jeremy Wall
Post by Jeremy Wall
Post by Curtis Yarvin
You should produce a %diff card and return it on your
subscription
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
bone.
Let me step back and explain the theory behind this
architecture a
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
little better. A poke causes some state on the server to
change;
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
change is reported to one or more subscribers. By decoupling
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
effect and the change report, we're forcing you to create an
application that works by keeping subscribers in sync with (some
part)
of server state. If some other user-agent caused the same state
change, you would also see this update even though you didn't
cause
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
it.
For example, a trivial case of coupling is a console with nontrivial
server-side update semantics. You press a key. This changes
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
input line, in a way that the client can't (always) predict.
The
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
classic function-as-RPC approach would POST the key and return
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
new
input line in the response.
If instead we POST the key and send the new input line as a
diff,
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
this
same application -- though slightly more complex -- can be trivially
generalized to let other users watch your console session. If
you
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
did
it the classic way, this refactoring is nontrivial. Do you want this
feature in the product? Maybe, maybe not -- but you can see how
separating "causing" from "watching" is abstractly more
elegant, I
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
hope.
The mismatch here is that this forces all requests to be
stateful.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
The
case
of check this text to see if it is parsable as hoon does not
need to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
be
stateful though, so it seems like you are doing more work than
you
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
want
to
do.
While the subscription model is generalizable to the stateless
case
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
it's
not
trivial to use that way.
Post by Curtis Yarvin
On Mon, Nov 30, 2015 at 7:26 AM, Jeremy Wall
On Sun, Nov 29, 2015 at 9:23 PM, Curtis Yarvin <
Post by Curtis Yarvin
You're sending a poke; by definition, this is not an RPC but
rather
a
transaction whose result only contains content if it fails.
It's a
procedure, not a function, as it were. Or if it's a
function,
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
it
returns void.
As long as the poke arm doesn't crash, you should get 200 OK
with an
empty body (Anton, correct me if I'm wrong). Again, this
naked
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
ack
is
a feature, not a bug; it's just what an end-to-end ack looks
like to
a
JS client.
If you want to read data from the server, you need a
subscription --
a
different communication pattern. Note however that the gall
appliance
gets the same bone if the same client both subscribes and
pokes
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
with
the same wire (caller's causal path), so it's easy for the
poke
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
to
cause some response on a downstream channel.
Ahhh okay this is what I was beginning to suspect.
So what we want then is for the poke to cause something to
occur
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
in
the
subscription channel for this request. (e.g. /~/of/[ixor])
Would
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
I
use
the
same ixor that I got when I authenticated? or do I need to do
something
get
a new ixor associated to this app and my session?
And in that case what cards should the poke arm produce to
cause
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
things
to
happen in the ixor for this session?
Alternatively is there now or are their plans to introduce a
mechanism
similar to poke that works like a function call rather than a
procedure?
This is a lot of work for third party services to consume an
urbit
service
and is likely to be a hindrance to them. (Perhaps this is
desired?)
Enough
work that I'm almost persuaded to create a go proxy that
abstracts
the
whole
thing away into a restful service for me :-p
Post by Curtis Yarvin
On Sun, Nov 29, 2015 at 5:24 PM, Jeremy Wall
Post by Jeremy Wall
Okay now the rubber is starting to meet the road. I've
successfully
perfomed
a handshake for authentication and then hit a poke-json
arm in
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
a
gall
app
and seen the payload.
What I can't quite figure out right now is what do I
produce
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
from
the
poke-arm to send a response back? In other word what card
should
my
%gall
app produce to tell eyre send this out as a response to
this
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
request?
Any guidance here?
On Fri, Nov 27, 2015 at 7:50 PM, Jeremy Wall
http://hidduc-posmeg.urbit.org/home/tree/pub/hoon-intro/rest/notes
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
I've worked out how to do a successful authentication
handshake.
Now
to
work out how to use that authentication handshake for
future
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
requests
:-p
On Fri, Nov 27, 2015 at 7:17 PM, Jeremy Wall
Post by Jeremy Wall
Actually never mind. I think I just figured it out. My
bash-fu
was
lacking :-p
On Fri, Nov 27, 2015 at 7:09 PM, Jeremy Wall
Post by Jeremy Wall
For reference this script with curl and jq does not
#!/bin/bash
oryx=$(curl http://localhost:8081/~/auth.json | jq
"{.oryx") #
just
grabs the oryx from this request.
genpayload () { #construct an auth.json payload for
posting
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
cat<<EOF
{
"oryx":$1,
"ship":"zod",
"code":"wisnyx-sitnev-podwen-matzod"
}
EOF
}
echo $(genpayload $oryx)
#Post that payload and see the result.
curl -i \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X POST -d "$(genpayload $oryx)" \
http://localhost:8081/~/auth.json?PUT
Given what you just said and what I think I understand
from
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
the
spec
doc
I would have expected it to work.
On Fri, Nov 27, 2015 at 6:31 PM, Anton Dyudin
Post by Anton Dyudin
You're right, that should only happen on requests
actually
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
making
use
of it. Any random auth.json oryx should in fact work
for
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
auth.json
PUT
On Friday, November 27, 2015, Jeremy Wall
On Fri, Nov 27, 2015 at 6:15 PM, Anton Dyudin
Post by Anton Dyudin
What precisely do you mean by "won't let you reuse"?
Is
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
it
crashing
on some specific assert, or printing an error?
%bad-oryx, for example, means that your csrf token
isn't
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
in
the
set
recorded for your session cookie (for example if you
don't
have
the latter).
This is all happening with curl.
I'm assuming I don't have a session cookie since I
haven't
yet
authenticated. Do you get a session before
authenticating?
And
is
there a
url you hit to drop the cookie that you then use when
you
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
authenticate?
Post by Anton Dyudin
On Friday, November 27, 2015, Jeremy Wall
Post by Jeremy Wall
Hey Anton,
I've been reading your spec and playing with curl
for a
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
bit
attempting to manually succeed in a handshake. It
looks
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
to
me
like you
should be able authenticate using a POST
/~/auth.json?PUT
with
a
payload
containing the csrf token, ship name and code.
However
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
I
can't
figure out
how you get the csrf token to start with. It seems
like
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
a
bit
of
a chicken
and an egg problem to me. It won't let you resuse
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
oryx
from a
GEt
/~/auth.json so that won't work according to my
testing.
On Tue, Nov 24, 2015 at 11:11 PM, Anton Dyudin
http://sondel-forsut.urbit.org/home/tree/pub/spec/eyre,
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
was
private doc and
may be lost with the ship etc.
The /~/to endpoint also accepts wire and oryx as
query
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
string
parameters, in which case the entire post body is
treated
as
the
message.
The query string can also contain 'anon', which
obviates
the
need for an
oryx parameter.
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
We can still treat http requests as comets as
long as
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
the
token/cookie and process for getting/using one is
well
documented.
On Tue, Nov 24, 2015 at 9:27 PM, Galen Wolfe-Pauly
Post by Galen Wolfe-Pauly
I wonder whether we have made a design error
here.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
It’s
nice
to
be able to treat all HTTP requests as comets —
but
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
there
are
likely devices
that want to communicate over HTTP that can’t
set up
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
an
oryx.
On Nov 24, 2015, at 7:22 PM, Anton Dyudin
Correct. There is a way to send a json post
anonymously
to
an
app(and get a nice/mean), or there is a way to
access
the
query string from
a hook file.
I suppose crashing in the app and sticking JSON
in
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
the
stateless
"error" might work?
On Tuesday, November 24, 2015, Jeremy Wall
Post by Jeremy Wall
So it doesn't appear that there is a clean way
to
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
set
up
urbit
to handle restful api endpoints.
i.e. I can tell urbit to handle this url, method
with
this
code.
And have that code get access to the payload in
the
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
body
of
that request if
it is say a post or put request.
Am I wrong? or does this just not exist yet?
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are
subscribed to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop
receiving
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
Post by Jeremy Wall
emails
from
it, send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
You received this message because you are
subscribed
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Jeremy Wall
Post by Anton Dyudin
Post by Anton Dyudin
Post by Jeremy Wall
Post by Anton Dyudin
Post by Jeremy Wall
Post by Galen Wolfe-Pauly
to
the
Google Groups "urbit" group.
To unsubscribe from this group and stop receiving
emails
from
it,
send an email to
To post to this group, send email to
For more options, visit
https://groups.google.com/d/optout.
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
You received this message because you are subscribed to the
Google
Groups
"urbit" group.
To unsubscribe from this group and stop receiving emails
from
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
it,
send
an
To post to this group, send email to
For more options, visit https://groups.google.com/d/optout
.
Post by Anton Dyudin
Post by Anton Dyudin
Post by Curtis Yarvin
Post by Curtis Yarvin
Post by Jeremy Wall
Post by Curtis Yarvin
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Jeremy Wall
http://jeremy.marzhillstudios.com
--
Cabmold delenda est
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...