on master help sign in
151ized docs
2ed5238Henry Ault
docs/about.md+1−1
@@ -4,4 +4,4 @@ sort: 1
4
4
5# About
5# About
6
6
7−<list dataPath="docs/about"></list>
7+<list />
docs/programming.md+1−1
@@ -4,4 +4,4 @@ sort: 3
4
4
5# Programming
5# Programming
6
6
7−<list dataPath="docs/programming"></list>
7+<list />
docs/programming/core.md+8−10
@@ -4,21 +4,19 @@ sort: 1
4
4
5# Core Hoon
5# Core Hoon
6
6
7−Hoon is strict, typed functional programming without math.
7+Hoon is strict, typed functional programming without category
8+theory.
8
9
9Hoon is named after a Wallace Stevens poem. Coincidentally, it
10Hoon is named after a Wallace Stevens poem. Coincidentally, it
10means "hooligan" in Australian. Practically, "Hoon" is a short
11means "hooligan" in Australian. Practically, "Hoon" is a short
11punchy name which search engines handle well.
12punchy name which search engines handle well.
12
13
13−This manual defines a practical Hoon subset we call Core Hoon.
14+Hoon has simple principles and a lot of details. To keep the
15+details from getting overwhelming, we start out learning a
16+simplified subset called Core Hoon. (Note that some of the
14−Some of the internal structures we present are simplified to
17+internal structures we show are simplified to match the subset.
15−reflect the Core subset.
18+These simplifications are corrected under Advanced Types.)
16
19
17−To read it for the first time, read these links in order:
20+To learn Hoon, traverse this tree in depth-first order:
18
21
19<list/>
22<list/>
20−
21−The Core manual is as terse as possible and written from a
22−top-down reference perspective. This will suit some and not others. For a
23−more narrative, bottom-up analysis, read [Deep Hoon](deep).
24−
docs/programming/core/demo.md+20−16
@@ -13,17 +13,18 @@ line is commented with its number:
13:gate end/atom :: 1
13:gate end/atom :: 1
14:var count 1 :: 2
14:var count 1 :: 2
15:loop :: 3
15:loop :: 3
16+:cast (list tape) :: 4
16−:if =(end count) :: 4
17+:if =(end count) :: 5
17− ~ :: 5
18+ ~ :: 6
18−:cons :: 6
19+:cons :: 7
19− :if =(0 (mod count 15)) :: 7
20+ :if =(0 (mod count 15)) :: 8
20− "FizzBuzz" :: 8
21+ "FizzBuzz" :: 9
21− :if =(0 (mod count 5)) :: 9
22+ :if =(0 (mod count 5)) :: 10
22− "Fizz" :: 10
23+ "Fizz" :: 11
23− :if =(0 (mod count 3)) :: 11
24+ :if =(0 (mod count 3)) :: 12
24− "Buzz" :: 12
25+ "Buzz" :: 13
25− (text :wrap(count)) :: 13
26+ (text :wrap(count)) :: 14
26−:moar(count (add 1 count)) :: 14
27+:moar(count (add 1 count)) :: 15
27```
28```
28
29
29Can you understand this code by just looking at it? Hopefully,
30Can you understand this code by just looking at it? Hopefully,
@@ -40,16 +41,19 @@ Line 2 declares a variable, `count`, with initial value `1`.
40
41
41Line 3 begins a loop.
42Line 3 begins a loop.
42
43
44+Line 4 casts the product of the loop to a list of `tape`
45+(string as a character list).
46+
43−Line 4 checks if `count` equals `end`. If so, line 5 (and the
47+Line 5 checks if `count` equals `end`. If so, line 6 (and the
44−whole loop) produces the value `~`, null. If not, line 6 begins
48+whole loop) produces the value `~`, null, the empty list. If
45−an ordered pair.
49+not, line 7 begins an ordered pair.
46
50
47The head of the pair is "FizzBuzz", or "Fizz", or "Buzz", if the
51The head of the pair is "FizzBuzz", or "Fizz", or "Buzz", if the
48−respective tests hit. If not, line 13 wraps a runtime type
52+respective tests hit. If not, line 14 wraps a runtime type
49around `count`, then prints the type-value pair to a string (like
53around `count`, then prints the type-value pair to a string (like
50C `sprintf()`). This string is the first item in the output list.
54C `sprintf()`). This string is the first item in the output list.
51
55
52−The tail of the pair is line 14, which repeats the loop (like
56+The tail of the pair is line 15, which repeats the loop (like
53Clojure `recur`), with `count` incremented. This list of strings
57Clojure `recur`), with `count` incremented. This list of strings
54is the rest of the output list.
58is the rest of the output list.
55
59
docs/programming/reference.md+1−1
@@ -6,4 +6,4 @@ sort: 4
6
6
7Background information on Nock, Hoon, Arvo,
7Background information on Nock, Hoon, Arvo,
8
8
9−<list dataPath="docs/programming/reference"></list>
9+<list />
docs/programming/reference/runes.md+13−13
@@ -13,72 +13,72 @@ Runes
13
13
14## `$ buc` (molds)
14## `$ buc` (molds)
15
15
16−<list dataPath="docs/system/hoon/runes/bc" dataPreview="true" className="runes" childIsFragment="true"></list>
16+<list src="bc" dataPreview="true" className="runes" childIsFragment="true"></list>
17
17
18---
18---
19
19
20## `| bar` (cores)
20## `| bar` (cores)
21
21
22−<list dataPath="docs/system/hoon/runes/br" dataPreview="true" className="runes" childIsFragment="true"></list>
22+<list src="br" dataPreview="true" className="runes" childIsFragment="true"></list>
23
23
24---
24---
25
25
26## `: col` (tuples)
26## `: col` (tuples)
27
27
28−<list dataPath="docs/system/hoon/runes/cl" dataPreview="true" className="runes" childIsFragment="true"></list>
28+<list src="cl" dataPreview="true" className="runes" childIsFragment="true"></list>
29
29
30---
30---
31
31
32## `% cen` (invocations)
32## `% cen` (invocations)
33
33
34−<list dataPath="docs/system/hoon/runes/cn" dataPreview="true" className="runes" childIsFragment="true"></list>
34+<list src="cn" dataPreview="true" className="runes" childIsFragment="true"></list>
35
35
36---
36---
37
37
38## `. dot` (nock)
38## `. dot` (nock)
39
39
40−<list dataPath="docs/system/hoon/runes/dt" dataPreview="true" className="runes" childIsFragment="true"></list>
40+<list src="dt" dataPreview="true" className="runes" childIsFragment="true"></list>
41
41
42---
42---
43
43
44## `# hax` (printing)
44## `# hax` (printing)
45
45
46−<list dataPath="docs/system/hoon/runes/hx" dataPreview="true" className="runes" childIsFragment="true"></list>
46+<list src="hx" dataPreview="true" className="runes" childIsFragment="true"></list>
47
47
48---
48---
49
49
50## `^ ket` (casting)
50## `^ ket` (casting)
51
51
52−<list dataPath="docs/system/hoon/runes/kt" dataPreview="true" className="runes" childIsFragment="true"></list>
52+<list src="kt" dataPreview="true" className="runes" childIsFragment="true"></list>
53
53
54---
54---
55
55
56## `~ sig` (hints)
56## `~ sig` (hints)
57
57
58−<list dataPath="docs/system/hoon/runes/sg" dataPreview="true" className="runes" childIsFragment="true"></list>
58+<list src="sg" dataPreview="true" className="runes" childIsFragment="true"></list>
59
59
60---
60---
61
61
62## `; sem` (composition)
62## `; sem` (composition)
63
63
64−<list dataPath="docs/system/hoon/runes/sm" dataPreview="true" className="runes" childIsFragment="true"></list>
64+<list src="sm" dataPreview="true" className="runes" childIsFragment="true"></list>
65
65
66---
66---
67
67
68## `= tis` (subject modifiers)
68## `= tis` (subject modifiers)
69
69
70−<list dataPath="docs/system/hoon/runes/ts" dataPreview="true" className="runes" childIsFragment="true"></list>
70+<list src="ts" dataPreview="true" className="runes" childIsFragment="true"></list>
71
71
72---
72---
73
73
74## `? wut` (conditional)
74## `? wut` (conditional)
75
75
76−<list dataPath="docs/system/hoon/runes/wt" dataPreview="true" className="runes" childIsFragment="true"></list>
76+<list src="wt" dataPreview="true" className="runes" childIsFragment="true"></list>
77
77
78---
78---
79
79
80## `! zap` (special)
80## `! zap` (special)
81
81
82−<list dataPath="docs/system/hoon/runes/zp" dataPreview="true" className="runes" childIsFragment="true"></list>
82+<list src="zp" dataPreview="true" className="runes" childIsFragment="true"></list>
83
83
84−</div>
84+</div>
docs/programming/reference/runes/bc.md+2−2
@@ -6,6 +6,6 @@ sort: 2
6
6
7##### Molds are types, but we don't have types.
7##### Molds are types, but we don't have types.
8
8
9−<list dataPath="docs/system/hoon/runes/bc" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/bc" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/reference/runes/br.md+2−2
@@ -6,6 +6,6 @@ sort: 1
6
6
7##### Cores are sort of like objects, but not quite.
7##### Cores are sort of like objects, but not quite.
8
8
9−<list dataPath="docs/system/hoon/runes/br" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/br" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/reference/runes/cl.md+2−2
@@ -6,6 +6,6 @@ sort: 3
6
6
7##### Tuples are easy.
7##### Tuples are easy.
8
8
9−<list dataPath="docs/system/hoon/runes/cl" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/cl" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/reference/runes/cn.md+2−2
@@ -6,6 +6,6 @@ sort: 4
6
6
7##### Calls, but not.
7##### Calls, but not.
8
8
9−<list dataPath="docs/system/hoon/runes/cn" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/cn" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/reference/runes/dt.md+2−2
@@ -6,6 +6,6 @@ sort: 5
6
6
7##### Run some nock.
7##### Run some nock.
8
8
9−<list dataPath="docs/system/hoon/runes/dt" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/dt" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/reference/runes/hx.md+2−2
@@ -6,6 +6,6 @@ sort: 6
6
6
7##### Want to print something? Fine.
7##### Want to print something? Fine.
8
8
9−<list dataPath="docs/system/hoon/runes/hx" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/hx" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/reference/runes/kt.md+2−2
@@ -6,6 +6,6 @@ sort: 7
6
6
7##### Go ahead, recast that.
7##### Go ahead, recast that.
8
8
9−<list dataPath="docs/system/hoon/runes/kt" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/kt" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/reference/runes/sg.md+2−2
@@ -6,6 +6,6 @@ sort: 8
6
6
7##### Give the compiler a little help.
7##### Give the compiler a little help.
8
8
9−<list dataPath="docs/system/hoon/runes/sg" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/sg" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/reference/runes/sm.md+2−2
@@ -6,6 +6,6 @@ sort: 10
6
6
7##### Compose at will.
7##### Compose at will.
8
8
9−<list dataPath="docs/system/hoon/runes/sm" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/sm" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/reference/runes/ts.md+2−2
@@ -6,6 +6,6 @@ sort: 9
6
6
7##### Feel free to change the subject.
7##### Feel free to change the subject.
8
8
9−<list dataPath="docs/system/hoon/runes/ts" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/ts" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/reference/runes/wt.md+2−2
@@ -6,6 +6,6 @@ sort: 11
6
6
7##### If this then what?
7##### If this then what?
8
8
9−<list dataPath="docs/system/hoon/runes/wt" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/wt" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/reference/runes/zp.md+2−2
@@ -6,6 +6,6 @@ sort: 12
6
6
7##### Pow, zap, bam.
7##### Pow, zap, bam.
8
8
9−<list dataPath="docs/system/hoon/runes/zp" dataPreview="true" className="runes" linkToFragments="true"></list>
9+<list dataPreview="true" className="runes" linkToFragments="true"></list>
10
10
11−<kids dataPath="docs/system/hoon/runes/zp" className="runes"></kids>
11+<kids className="runes"></kids>
docs/programming/system/marks.md+2−1
@@ -49,7 +49,8 @@ to `++scot`. Thus, the form of an arm in `++grab` is
49
49
50In `++grow`, we just convert to the `md` mark, which is just a
50In `++grow`, we just convert to the `md` mark, which is just a
51`@t` internally, but it has fancy conversion functions to things
51`@t` internally, but it has fancy conversion functions to things
52+like html. `++md` isn't a function because the "argument" is
52−like html. `++md` isn't a function because the "argument" is already a `@t`, so we can just produce the new value directly.
53+already a `@t`, so we can just produce the new value directly.
53
54
54Let's play around a bit with this mark. First, let's take a
55Let's play around a bit with this mark. First, let's take a
55marked atom and convert it to our new mark.
56marked atom and convert it to our new mark.
docs/programming/system/security-driver.mdnew file+262
@@ -0,0 +1,262 @@
1+---
2+next: false
3+sort: 10
4+title: Security Drivers
5+---
6+
7+A security driver is a file in `/=home=/sec/<tld>/<domain>/hoon`
8+that handles the authentication for all HTTP requests to
9+`https://<domain>.<tld>`. All requests to the domain are
10+filtered through the security driver, which will either decorate
11+the request with the needed credentials if it has them, or else
12+it will guide the user through the process of authenticating
13+Urbit with the service.
14+
15+Each web service needs its own security driver, but most of them
16+are pretty standard. We recommend starting with an existing
17+security driver based on your needed authentication method (e.g.
18+basic auth, OAuth1, OAuth2), and changing whatever is specific to
19+your service.
20+
21+The best strategy for building security drivers is to copy a
22+similar one and tweak it until it works for you. The best
23+representatives are Github for Basic Authentication, Twitter for
24+OAuth1, Slack for OAuth2 when access tokens don't expire, and
25+Google APIs for OAuth2 when access tokens do expire. In most
26+cases you'll need to make very few changes to one of these
27+models.
28+
29+Still, it's worth seeing one or two built from the ground up.
30+Here, we'll build a connector for the Github API v3. The
31+simplest way to interact with the Github API is to just fetch
32+https://api.github.com.
33+
34+ +https://api.github.com
35+
36+Github exposes a few endpoints to the general web, and the root
37+endpoint is one of them. This gives you a textual representation
38+of a JSON object that contains a bunch of urls to other parts of
39+Github's API. This is exactly the same response you would get
40+from just running `curl` on UNIX.
41+
42+If we don't have a security driver for Github yet, many of the
43+endpoints won't be accessible, or they will only have publicly
44+accessible information. Most of what we care about requires us
45+to be authenticated.
46+
47+Here's a simple security driver:
48+
49+```
50+:: Test url +https://api.github.com/user
51+::
52+:::: /hoon/github/com/sec
53+ ::
54+/+ basic-auth
55+!:
56+|_ {bal/(bale keys:basic-auth) $~}
57+++ aut ~(standard basic-auth bal ~)
58+++ filter-request out-adding-header:aut
59+--
60+```
61+
62+Github supports authentication through either Basic
63+Authentication or OAuth2. We'll show the basic auth example
64+first, but in general we'd prefer OAuth2.
65+
66+Since this driver is for Github, put it in
67+`/=home=/sec/com/github/hoon`.
68+
69+To try this out, we first have to initialize our credentials with
70+`|init-auth-basic`, which prompts for the url of the service
71+(api.github.com), username, and password. It stores this
72+information in a manner that `%eyre` knows how to decode and send
73+put into your bale. Note that `|init-auth-basic` is standard for
74+basic auth, but other auth schemes (like OAuth) are initialized
75+in other ways.
76+
77+After you've run `|init-auth-basic`, you should be able to run
78+`+https://api.github.com/user` and get a response indicating who
79+you're logged in as.
80+
81+You can similarly POST:
82+
83+ +https://api.github.com/gists &json _(cork poja need)
84+ '{"files":{"file1.txt":{"content":"can\'t stop the signal"}}}'
85+
86+This creates a gist, go to `https://gist.github.com/<username>` to
87+see it.
88+
89+The `+url` syntax used in "source" position makes a GET request,
90+but if you pass it data it will make a POST request with that
91+data as the body. This request is authenticated seamlessly. You
92+can send data of any mark as long as it has a conversion path to
93+`%mime`.
94+
95+Let's take a look at the code and see if we can figure out what's
96+happening here.
97+
98+First, we load a library called `basic-auth`. This library
99+exposes two items. `keys` is the type of the basic auth key,
100+which is essentially a base64'd username and password.
101+`standard` accepts a bale and produces a core with everything
102+we'll need to implement basic auth.
103+
104+Every security driver needs some amount of state, which is stored
105+in the bale. The bale contains:
106+
107+- `our`, our urbit name
108+- `now`, the current time
109+- `eny`, 256 bits of entropy
110+- `byk`, the urbit, desk, and case which the security driver is
111+ running off
112+- `usr`, the particular identity we're logging in with
113+- `dom`, the site we're accessing
114+- `key`, the secrets required to authenticate requests. The type
115+ for this entry is supplied by the programmer as the argument to
116+ `++bale`. Thus, in our case, `key` in our bale is of type
117+ `keys:basic-auth`.
118+
119+Additionally, a security driver contains at least one "special"
120+arm. Here, we use `++filter-request`, which is a function which
121+takes a hiss (http request) and produces a `sec-move`, which is
122+one of:
123+
124+- `%send` plus a hiss, which sends the new hiss. This is the
125+ case in, for example, basic auth, where all we need to do is
126+ add an extra header to the request.
127+- `%give` plus an httr (http response), which immediately returns
128+ an http response to the sender.
129+- `%show` plus a purl (parsed url), which displays a message
130+ asking the user to visit the given url to continue the
131+ authentication process.
132+
133+Every request to a Github url will be filtered through
134+`++filter-request`, and we want to add the authentication header
135+to it. Our `++aut` core contains a function
136+`++out-addding-header`, which does exactly what we want.
137+
138+Where do the keys come from, though? Remember we ran
139+`|init-auth-basic` to input them. This just prompts you for the
140+service url, username, and password, and it stores them next to
141+the driver. In our case, that's
142+`/=home=/sec/com/gitub/api/atom`. These keys are stored
143+encrypted, and you don't want to edit them directly. `%eyre`
144+loads them directly into your bale.
145+
146+# OAuth2
147+
148+Most services are better accessed through some form of OAuth.
149+Github can be accessed with OAuth2, which is a little more
150+complicated than basic auth, but not hugely so.
151+
152+The basic steps for OAuth2 are these:
153+
154+- create an app and get its client id and client secret (on
155+ Github)
156+- store these in Urbit (with `|init-oauth2`)
157+- try to make a request that requires authentication. The
158+ security driver should prompt you to visit a particular url.
159+- visit the url and click "authorize", which gives the app access
160+ to your account
161+- the security driver will turn the code it receives into an
162+ access token
163+- on every request, include that access token
164+
165+Creating an app is easy and
166+[well-documented](https://github.com/settings/applications/new).
167+If necessary, set the callback url to
168+`/~/ac/github.com/_state/in`, and note its client id and client
169+secret.
170+
171+Run `|init-oauth2`, which will prompt for the hostname
172+(api.github.com), client id, and client secret. This will store
173+the information, encrypted, in `/=home=/sec/com/github.atom`,
174+just as with Basic Authentication.
175+
176+Now we need a security driver. Use this:
177+
178+```
179+:: Test url +https://api.github.com/user
180+::
181+:::: /hoon/github/com/sec
182+ ::
183+/+ oauth2
184+!:
185+::::
186+ ::
187+|_ {bal/(bale keys:oauth2) tok/token:oauth2}
188+++ scopes :: comment out scopes to taste
189+ :~ 'user' 'user:email' 'user:follow' 'public_repo' 'repo'
190+ 'repo_deployment' 'repo:status' 'delete_repo' 'notifications'
191+ 'gist' 'read:repo_hook' 'write:repo_hook' 'admin:repo_hook'
192+ 'admin:org_hook' 'read:org' 'write:org' 'admin:org'
193+ 'read:public_key' 'write:public_key' 'admin:public_key'
194+ ==
195+:: ++aut is a "standard oauth2" core, which implements the
196+:: most common handling of oauth2 semantics. see lib/oauth2 for more details,
197+:: and examples at the bottom of the file.
198+++ aut (~(standard oauth2 bal tok) . |=(tok/token:oauth2 +>(tok tok)))
199+++ filter-request
200+ %^ out-add-query-param:aut 'access_token'
201+ scope=~[%client %admin]
202+ oauth-dialog='https://github.com/login/oauth/authorize'
203+::
204+++ receive-auth-query-string
205+ %- in-code-to-token:aut
206+ url='https://github.com/login/oauth/api/access_token'
207+++ receive-auth-response bak-save-token:aut
208+--
209+```
210+
211+The oauth2 library provides the main "engine" in `standard`, just
212+like in basic auth, except that we also have to specify a
213+function to save the access token when we get it.
214+
215+Running `+http://api.github.com/user` tries to make a request to
216+Github with authentication. This loads into the bale the keys,
217+which are of type `keys:oauth2`, defined in the oauth2 library.
218+We don't have to worry about the specifics of these keys -- the
219+library handles them -- but they include the client id and the
220+client secret.
221+
222+Before the request is sent, `%eyre` calls `++filter-request` to
223+decorate it with authentication headers. Since we don't yet have
224+an access token, we need to prompt the user to visit the "dialog"
225+url. `++out-add-query-param` checks whether we have a token, and
226+if we don't it produces `%show` and a message telling the user to
227+visit the `oauth-dialog` url we provide, with the extra query
228+parameters added (client id, scopes, and state).
229+
230+When the user visits that url, Github will ask them to log in and
231+authorize the application. When they do so, Github will post a
232+request to `/~/ac/github.com/_state/in` with a code in the query
233+string. `%eyre` sends the query string to
234+`++receive-auth-query-string`, which is a function that takes a
235+quay and produces a `sec-move`. `++in-code-to-token` from our
236+`aut` takes the `code` parameter from the quay and uses it to
237+create a request to the given url. This request includes the
238+client id, the client secret, and the code we just got.
239+
240+Github's response to that request includes an access token in its
241+body. This is handled in `++receive-auth-response`.
242+`++bak-save-token` extracts that token and gives it to the
243+function that we passed in the definition of `++aut`. In our
244+case, we just save that token into our state for later usage.
245+
246+Now we have the credentials we need, so `++filter-request` is
247+called with the original request, and `++out-add-query-param`
248+passes the request through with the addition of the query
249+parameter `access_token`.
250+
251+Just like with Basic Authentication, you should be able to run
252+`+https://api.github.com/user` and get a response indicating who
253+you're logged in as.
254+
255+Some drivers a slightly more complicated. For example, Github's
256+access token's don't expire, but that's not the case for all
257+service. The googleapis driver shows the flow when the access
258+token can expire. Twitter uses OAuth1, for which we have another
259+library.
260+
261+Remember, of course, that the best strategy for building security
262+drivers is to copy a similar one and tweak it to taste.
docs/using.md+1−1
@@ -4,4 +4,4 @@ sort: 2
4
4
5# Using
5# Using
6
6
7−<list dataPath="docs/using"></list>
7+<list />
docs/using/install.md+3
@@ -51,6 +51,9 @@ Which can usually be installed with the following one-liners:
51 # FreeBSD
51 # FreeBSD
52 pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
52 pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
53
53
54+ # Arch
55+ pacman -S gcc gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool ncurses
56+
54 # AWS
57 # AWS
55 sudo yum —enablerepo epel install gcc gcc-c++ git gmp-devel openssl-devel ncurses-devel libsigsegv-devel ctags automake autoconf libtool cmake re2c
58 sudo yum —enablerepo epel install gcc gcc-c++ git gmp-devel openssl-devel ncurses-devel libsigsegv-devel ctags automake autoconf libtool cmake re2c
56
59
docs/using/setup.md+2−2
@@ -85,8 +85,8 @@ which indicates the command was processed.
85
85
86We go into much greater detail about using each of these components in our walkthroughs:
86We go into much greater detail about using each of these components in our walkthroughs:
87
87
88−<list dataPath="/docs/walkthroughs"></list>
88+<list src="."></list>
89
89
90With your Urbit up and running you know enough to start learning to program:
90With your Urbit up and running you know enough to start learning to program:
91
91
92−<list dataPath="/docs/deep-dives"></list>
92+<list src="../programming/deep"></list>
docs/using/web.md+7−7
@@ -42,7 +42,7 @@ Now modify `/home/web/test.md` to list the children using the `<list/>` JSX:
42
42
43 This is a simple markdown file.
43 This is a simple markdown file.
44
44
45− <div><list /></div>
45+ <div><list / />
46
46
47To view your file as raw `md`:
47To view your file as raw `md`:
48
48
@@ -148,31 +148,31 @@ For those familiar with React / Flux each JSX tag corresponds to a component in
148
148
149### `<list>`
149### `<list>`
150
150
151−Example: `<list dataPath="/posts" titlesOnly="true"></list>`
151+Example: `<list src="/posts" titlesOnly="true" />`
152
152
153Creates a list of children at a path. Defaults to the current path.
153Creates a list of children at a path. Defaults to the current path.
154
154
155Optional properties:
155Optional properties:
156
156
157−- `dataPath`: Path to load kids from.
157+- `src`: Path to load kids from.
158- `titlesOnly`: Only show the 'title' which is either the filename or the first h1.
158- `titlesOnly`: Only show the 'title' which is either the filename or the first h1.
159- `sortBy`: Can be `date` if items have a `date` YAML.
159- `sortBy`: Can be `date` if items have a `date` YAML.
160- `className`: Class to be assigned to the container.
160- `className`: Class to be assigned to the container.
161
161
162### `<kids>`
162### `<kids>`
163
163
164−Example: `<kids dataPath="/posts"></kids>`
164+Example: `<kids src="/posts" />`
165
165
166Includes all the children at the specified path separated by `<hr>` tags.
166Includes all the children at the specified path separated by `<hr>` tags.
167
167
168Optional properties:
168Optional properties:
169
169
170−- `dataPath`: Path to load kids from.
170+- `src`: Path to load kids from.
171- `className`: Class to be assigned to the container.
171- `className`: Class to be assigned to the container.
172
172
173### `<toc>`
173### `<toc>`
174
174
175−Example: `<toc noHeader="true"></toc>`
175+Example: `<toc noHeader="true" />`
176
176
177Creates a table of contents from the `h1` - `h6` tags on the page.
177Creates a table of contents from the `h1` - `h6` tags on the page.
178
178
@@ -244,7 +244,7 @@ Talk, for example, looks like this:
244 <script src="/~~/~/at/lib/js/urb.js" />
244 <script src="/~~/~/at/lib/js/urb.js" />
245 <script src="/talk/main.js" />
245 <script src="/talk/main.js" />
246 <link href="/talk/main.css" rel="stylesheet" />
246 <link href="/talk/main.css" rel="stylesheet" />
247− <talk></talk>
247+ <talk />
248</module>
248</module>
249```
249```
250
250