Skip to content

Commit c496cd6

Browse files
committed
Initial commit
1 parent a6e5c8b commit c496cd6

34 files changed

+3031
-57
lines changed

Diff for: bundle--6885699.css

+406
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: bundle-716460080.js

+25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: docs.html

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
<div class="grid bg-nearest-white">
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
<head>
4+
<title>Coast on Clojure</title>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<link href="/favicon.png" rel="icon" type="image/png">
8+
<link rel="stylesheet" href="/bundle--6885699.css" />
9+
</head>
10+
<body>
11+
<nav class="dt w-100 border-box pa3 ph5-ns">
12+
<a class="dtc v-mid near-black link dim w-25" href="/" title="Home">
13+
<img alt="Coast on Clojure" class="dib w2 h2 br-100" src="/favicon.png">
14+
<span class="ml2 v-top mt2 dib near-black">Coast</span>
15+
</a>
16+
<div class="dtc v-mid w-75 tr">
17+
<a class="link dim near-black f6 f5-ns dib mr3 mr4-ns" href="/docs" title="Docs">Docs</a>
18+
<a class="link dim near-black f6 f5-ns dib mr3 mr4-ns" href="https://twitter.com/coastonclojure" title="Twitter">Twitter</a>
19+
<a class="link dim near-black f6 f5-ns dib" href="https://github.com/coast-framework/coast" title="Github">Github</a>
20+
</div>
21+
</nav>
22+
<div class="grid bg-nearest-white">
223
<div class="pa4 bg-nearest-white sidebar-container">
324
<div class="fr-l sidebar">
425
<h3 id="user-content-preface">Preface</h3>
@@ -105,3 +126,8 @@ <h3 id="user-content-from-the-repl">From the REPL</h3>
105126
<p>And move your text editor's cursor over any of the letters in <code>-main</code> and press the keyboard shortcut for "sending the text under the cursor" to the REPL server. The http server will start and you can navigate to <code>http://localhost:1337</code></p>
106127
</div>
107128
</div>
129+
130+
<script type="text/javascript" src="/bundle-716460080.js"></script>
131+
<script>hljs.initHighlightingOnLoad();</script>
132+
</body>
133+
</html>

Diff for: docs/about.html

+85-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,81 @@
1-
<h1 id="user-content-about">About</h1>
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
<head>
4+
<title>Coast on Clojure</title>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<link href="/favicon.png" rel="icon" type="image/png">
8+
<link rel="stylesheet" href="/bundle--6885699.css" />
9+
</head>
10+
<body>
11+
<nav class="dt w-100 border-box pa3 ph5-ns">
12+
<a class="dtc v-mid near-black link dim w-25" href="/" title="Home">
13+
<img alt="Coast on Clojure" class="dib w2 h2 br-100" src="/favicon.png">
14+
<span class="ml2 v-top mt2 dib near-black">Coast</span>
15+
</a>
16+
<div class="dtc v-mid w-75 tr">
17+
<a class="link dim near-black f6 f5-ns dib mr3 mr4-ns" href="/docs" title="Docs">Docs</a>
18+
<a class="link dim near-black f6 f5-ns dib mr3 mr4-ns" href="https://twitter.com/coastonclojure" title="Twitter">Twitter</a>
19+
<a class="link dim near-black f6 f5-ns dib" href="https://github.com/coast-framework/coast" title="Github">Github</a>
20+
</div>
21+
</nav>
22+
<div class="grid bg-nearest-white">
23+
<div class="pa4 bg-nearest-white sidebar-container">
24+
<div class="fr-l sidebar">
25+
<h3 id="user-content-preface">Preface</h3>
26+
<ul>
27+
<li><a href="/docs/about">About</a></li>
28+
<li><a href="/docs/credits">Credits</a></li>
29+
<li><a href="/docs/upgrading">Upgrading from eta</a></li>
30+
<li><a href="/docs/contribution">Contribution Guide</a></li>
31+
</ul>
32+
<h3 id="user-content-concept">Concept</h3>
33+
<ul>
34+
<li><a href="/docs/request-lifecycle">Request Lifecycle</a></li>
35+
</ul>
36+
<h3 id="user-content-getting-started">Getting Started</h3>
37+
<ul>
38+
<li><a href="/docs/installation" style="color: rgb(53, 126, 221);">Installation</a></li>
39+
<li><a href="/docs/configuration">Configuration</a></li>
40+
<li><a href="/docs/directory-structure">Directory Structure</a></li>
41+
</ul>
42+
<h3 id="user-content-database">Database</h3>
43+
<ul>
44+
<li><a href="/docs/database-getting-started">Getting Started</a></li>
45+
<li><a href="/docs/queries">Queries</a></li>
46+
<li><a href="/docs/migrations">Migrations</a></li>
47+
<li><a href="/docs/relationships">Relationships</a></li>
48+
<li><a href="/docs/pull">Pull</a></li>
49+
</ul>
50+
<h3 id="user-content-basics">Basics</h3>
51+
<ul>
52+
<li><a href="/docs/routing">Routing</a></li>
53+
<li><a href="/docs/middleware">Middleware</a></li>
54+
<li><a href="/docs/handlers">Handlers</a></li>
55+
<li><a href="/docs/request">Request</a></li>
56+
<li><a href="/docs/response">Response</a></li>
57+
<li><a href="/docs/views">Views</a></li>
58+
<li><a href="/docs/sessions">Sessions</a></li>
59+
<li><a href="/docs/validator">Validator</a></li>
60+
<li><a href="/docs/error-handling">Error Handling</a></li>
61+
<li><a href="/docs/logger">Logger</a></li>
62+
</ul>
63+
<h3 id="user-content-security">Security</h3>
64+
<ul>
65+
<li><a href="/docs/security-intro">Introduction</a></li>
66+
<li><a href="/docs/authentication">Authentication</a></li>
67+
<li><a href="/docs/csrf-protection">CSRF Protection</a></li>
68+
<li><a href="/docs/password-hashing">Password Hashing</a></li>
69+
<li><a href="/docs/security-outro">XSS, Sniffing, XFrame</a></li>
70+
</ul>
71+
<h3 id="user-content-miscellaneous">Miscellaneous</h3>
72+
<ul>
73+
<li><a href="/docs/older-versions">Older Versions</a></li>
74+
</ul>
75+
</div>
76+
</div>
77+
<div class="ph4 bg-white content">
78+
<h1 id="user-content-about">About</h1>
279

380
<h2 id="user-content-motivation">Motivation</h2>
481

@@ -29,3 +106,10 @@ <h2 id="user-content-versioning">Versioning</h2>
29106
or if you've moved past the part where you're trying to throw stuff at the wall to see what
30107
sticks, this might not be the framework for you.
31108
</p>
109+
110+
</div>
111+
</div>
112+
<script type="text/javascript" src="/bundle-716460080.js"></script>
113+
<script>hljs.initHighlightingOnLoad();</script>
114+
</body>
115+
</html>

Diff for: docs/authentication.html

+85-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,81 @@
1-
<h1 id="user-content-authentication">Authentication</h1><ul><li><a href='#user-content-libraries'>Libraries</a></li><li><a href='#user-content-setup'>Setup</a></li><li><a href='#user-content-password-hashing'>Password Hashing</a></li><li><a href='#user-content-complete-example'>Complete Example</a></li></ul><p>Coast does not have authentication built in. It's up to you to determine how you want to authenticate people.</p><p>Typically for clojure database-backed web applications, there are a few options:</p><ul><li>Sessions</li><li>JWT Tokens (this guide does not cover this)</li><li>Basic HTTP Auth (also not covered by this guide)</li></ul><h2 id="user-content-libraries">Libraries</h2><p>Let's get into it. In the clojure world, there are two popular web application authentication libraries</p><ul><li><a href='https://github.com/cemerick/friend'>Friend</a></li><li><a href='https://github.com/funcool/buddy'>Buddy</a></li></ul><p>Coast lends itself more to buddy, so that's what this guide covers.</p><p>Buddy is composed of several different libraries:</p><ul><li><code>buddy-core</code></li><li><code>buddy-hashers</code></li><li><code>buddy-sign</code></li><li><code>buddy-auth</code></li></ul><p>Setting up authentication middleware with Coast only really needs <code>buddy-hashers</code>, so that's the library we'll choose</p><h2 id="user-content-setup">Setup</h2><p>Here's how to set up buddy for use with a Coast application</p><p>Install the <code>buddy-hashers</code> dependency in your <code>deps.edn</code> file</p><pre><code class="clojure">; deps.edn
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
<head>
4+
<title>Coast on Clojure</title>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<link href="/favicon.png" rel="icon" type="image/png">
8+
<link rel="stylesheet" href="/bundle--6885699.css" />
9+
</head>
10+
<body>
11+
<nav class="dt w-100 border-box pa3 ph5-ns">
12+
<a class="dtc v-mid near-black link dim w-25" href="/" title="Home">
13+
<img alt="Coast on Clojure" class="dib w2 h2 br-100" src="/favicon.png">
14+
<span class="ml2 v-top mt2 dib near-black">Coast</span>
15+
</a>
16+
<div class="dtc v-mid w-75 tr">
17+
<a class="link dim near-black f6 f5-ns dib mr3 mr4-ns" href="/docs" title="Docs">Docs</a>
18+
<a class="link dim near-black f6 f5-ns dib mr3 mr4-ns" href="https://twitter.com/coastonclojure" title="Twitter">Twitter</a>
19+
<a class="link dim near-black f6 f5-ns dib" href="https://github.com/coast-framework/coast" title="Github">Github</a>
20+
</div>
21+
</nav>
22+
<div class="grid bg-nearest-white">
23+
<div class="pa4 bg-nearest-white sidebar-container">
24+
<div class="fr-l sidebar">
25+
<h3 id="user-content-preface">Preface</h3>
26+
<ul>
27+
<li><a href="/docs/about">About</a></li>
28+
<li><a href="/docs/credits">Credits</a></li>
29+
<li><a href="/docs/upgrading">Upgrading from eta</a></li>
30+
<li><a href="/docs/contribution">Contribution Guide</a></li>
31+
</ul>
32+
<h3 id="user-content-concept">Concept</h3>
33+
<ul>
34+
<li><a href="/docs/request-lifecycle">Request Lifecycle</a></li>
35+
</ul>
36+
<h3 id="user-content-getting-started">Getting Started</h3>
37+
<ul>
38+
<li><a href="/docs/installation" style="color: rgb(53, 126, 221);">Installation</a></li>
39+
<li><a href="/docs/configuration">Configuration</a></li>
40+
<li><a href="/docs/directory-structure">Directory Structure</a></li>
41+
</ul>
42+
<h3 id="user-content-database">Database</h3>
43+
<ul>
44+
<li><a href="/docs/database-getting-started">Getting Started</a></li>
45+
<li><a href="/docs/queries">Queries</a></li>
46+
<li><a href="/docs/migrations">Migrations</a></li>
47+
<li><a href="/docs/relationships">Relationships</a></li>
48+
<li><a href="/docs/pull">Pull</a></li>
49+
</ul>
50+
<h3 id="user-content-basics">Basics</h3>
51+
<ul>
52+
<li><a href="/docs/routing">Routing</a></li>
53+
<li><a href="/docs/middleware">Middleware</a></li>
54+
<li><a href="/docs/handlers">Handlers</a></li>
55+
<li><a href="/docs/request">Request</a></li>
56+
<li><a href="/docs/response">Response</a></li>
57+
<li><a href="/docs/views">Views</a></li>
58+
<li><a href="/docs/sessions">Sessions</a></li>
59+
<li><a href="/docs/validator">Validator</a></li>
60+
<li><a href="/docs/error-handling">Error Handling</a></li>
61+
<li><a href="/docs/logger">Logger</a></li>
62+
</ul>
63+
<h3 id="user-content-security">Security</h3>
64+
<ul>
65+
<li><a href="/docs/security-intro">Introduction</a></li>
66+
<li><a href="/docs/authentication">Authentication</a></li>
67+
<li><a href="/docs/csrf-protection">CSRF Protection</a></li>
68+
<li><a href="/docs/password-hashing">Password Hashing</a></li>
69+
<li><a href="/docs/security-outro">XSS, Sniffing, XFrame</a></li>
70+
</ul>
71+
<h3 id="user-content-miscellaneous">Miscellaneous</h3>
72+
<ul>
73+
<li><a href="/docs/older-versions">Older Versions</a></li>
74+
</ul>
75+
</div>
76+
</div>
77+
<div class="ph4 bg-white content">
78+
<h1 id="user-content-authentication">Authentication</h1><ul><li><a href='#user-content-libraries'>Libraries</a></li><li><a href='#user-content-setup'>Setup</a></li><li><a href='#user-content-password-hashing'>Password Hashing</a></li><li><a href='#user-content-complete-example'>Complete Example</a></li></ul><p>Coast does not have authentication built in. It's up to you to determine how you want to authenticate people.</p><p>Typically for clojure database-backed web applications, there are a few options:</p><ul><li>Sessions</li><li>JWT Tokens (this guide does not cover this)</li><li>Basic HTTP Auth (also not covered by this guide)</li></ul><h2 id="user-content-libraries">Libraries</h2><p>Let's get into it. In the clojure world, there are two popular web application authentication libraries</p><ul><li><a href='https://github.com/cemerick/friend'>Friend</a></li><li><a href='https://github.com/funcool/buddy'>Buddy</a></li></ul><p>Coast lends itself more to buddy, so that's what this guide covers.</p><p>Buddy is composed of several different libraries:</p><ul><li><code>buddy-core</code></li><li><code>buddy-hashers</code></li><li><code>buddy-sign</code></li><li><code>buddy-auth</code></li></ul><p>Setting up authentication middleware with Coast only really needs <code>buddy-hashers</code>, so that's the library we'll choose</p><h2 id="user-content-setup">Setup</h2><p>Here's how to set up buddy for use with a Coast application</p><p>Install the <code>buddy-hashers</code> dependency in your <code>deps.edn</code> file</p><pre><code class="clojure">; deps.edn
279

380
{; other keys not shown
481
:deps
@@ -111,4 +188,10 @@ <h1 id="user-content-authentication">Authentication</h1><ul><li><a href='#user-c
111188
</code></pre><p>Notice the use of <code>hashers/check</code> to check the plaintext password from the form against the password from the existing hashed password in the database.</p><p>...and finally the sign out handler</p><pre><code class="clojure">&#40;defn delete &#91;request&#93;
112189
&#40;-&gt; &#40;coast/redirect-to ::build&#41;
113190
&#40;assoc :session nil&#41;&#41;&#41;
114-
</code></pre><p>This is not the only way to implement authentication in your Coast app, but it is a complete example of one way of doing authentication.</p>
191+
</code></pre><p>This is not the only way to implement authentication in your Coast app, but it is a complete example of one way of doing authentication.</p>
192+
</div>
193+
</div>
194+
<script type="text/javascript" src="/bundle-716460080.js"></script>
195+
<script>hljs.initHighlightingOnLoad();</script>
196+
</body>
197+
</html>

0 commit comments

Comments
 (0)