master
1<!DOCTYPE html>
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
6 <title>proxyauth - The Go Programming Language</title>
7
8<link type="text/css" rel="stylesheet" href=".godoc/style.css">
9
10<link rel="stylesheet" href=".godoc/jquery.treeview.css">
11<script type="text/javascript">window.initFuncs = [];</script>
12</head>
13<body>
14
15<div id='lowframe' style="position: fixed; bottom: 0; left: 0; height: 0; width: 100%; border-top: thin solid grey; background-color: white; overflow: auto;">
16...
17</div><!-- #lowframe -->
18
19<div id="topbar" class="wide"><div class="container">
20
21<form method="GET" action="/search">
22<div id="menu">
23<a href="/doc/">Documents</a>
24<a href="/pkg/">Packages</a>
25<a href="/project/">The Project</a>
26<a href="/help/">Help</a>
27<a href="/blog/">Blog</a>
28
29<input type="text" id="search" name="q" class="inactive" value="Search" placeholder="Search">
30</div>
31<div id="heading"><a href="/">The Go Programming Language</a></div>
32</form>
33
34</div></div>
35
36
37
38<div id="page" class="wide">
39<div class="container">
40
41
42 <div id="plusone"><g:plusone size="small" annotation="none"></g:plusone></div>
43 <h1>Package proxyauth</h1>
44
45
46
47
48<div id="nav"></div>
49
50
51<!--
52 Copyright 2009 The Go Authors. All rights reserved.
53 Use of this source code is governed by a BSD-style
54 license that can be found in the LICENSE file.
55-->
56<!--
57 Note: Static (i.e., not template-generated) href and id
58 attributes start with "pkg-" to make it impossible for
59 them to conflict with generated attributes (some of which
60 correspond to Go identifiers).
61-->
62
63 <script type='text/javascript'>
64 document.ANALYSIS_DATA = null;
65 document.CALLGRAPH = null;
66 </script>
67
68
69
70 <div id="short-nav">
71 <dl>
72 <dd><code>import "bryfry_swas/proxyauth"</code></dd>
73 </dl>
74 <dl>
75 <dd><a href="#pkg-overview" class="overviewLink">Overview</a></dd>
76 <dd><a href="#pkg-index" class="indexLink">Index</a></dd>
77
78
79 </dl>
80 </div>
81 <!-- The package's Name is printed as title by the top-level template -->
82 <div id="pkg-overview" class="toggleVisible">
83 <div class="collapsed">
84 <h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
85 </div>
86 <div class="expanded">
87 <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
88 <p>
89proxyauth package provides data models and associated functions required to
90facilitate a proxy authentication server as specified in SPEC.md
91</p>
92
93 </div>
94 </div>
95
96
97 <div id="pkg-index" class="toggleVisible">
98 <div class="collapsed">
99 <h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
100 </div>
101 <div class="expanded">
102 <h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>
103
104 <!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
105 <div id="manual-nav">
106 <dl>
107
108
109
110
111
112 <dd><a href="#Domain">type Domain</a></dd>
113
114
115
116
117 <dd><a href="#Proxy">type Proxy</a></dd>
118
119
120 <dd> <a href="#NewProxy">func NewProxy(filePath string) (*Proxy, error)</a></dd>
121
122
123
124 <dd> <a href="#Proxy.Authenticate">func (p *Proxy) Authenticate() http.Handler</a></dd>
125
126
127
128 <dd><a href="#Response">type Response</a></dd>
129
130
131
132
133 <dd><a href="#User">type User</a></dd>
134
135
136
137
138 </dl>
139 </div><!-- #manual-nav -->
140
141
142
143
144 <h4>Package files</h4>
145 <p>
146 <span style="font-size:90%">
147
148 <a href="./proxyauth/proxyauth.go">proxyauth.go</a>
149
150 </span>
151 </p>
152
153 </div><!-- .expanded -->
154 </div><!-- #pkg-index -->
155
156 <div id="pkg-callgraph" class="toggle" style="display: none">
157 <div class="collapsed">
158 <h2 class="toggleButton" title="Click to show Internal Call Graph section">Internal call graph ▹</h2>
159 </div> <!-- .expanded -->
160 <div class="expanded">
161 <h2 class="toggleButton" title="Click to hide Internal Call Graph section">Internal call graph ▾</h2>
162 <p>
163 In the call graph viewer below, each node
164 is a function belonging to this package
165 and its children are the functions it
166 calls—perhaps dynamically.
167 </p>
168 <p>
169 The root nodes are the entry points of the
170 package: functions that may be called from
171 outside the package.
172 There may be non-exported or anonymous
173 functions among them if they are called
174 dynamically from another package.
175 </p>
176 <p>
177 Click a node to visit that function's source code.
178 From there you can visit its callers by
179 clicking its declaring <code>func</code>
180 token.
181 </p>
182 <p>
183 Functions may be omitted if they were
184 determined to be unreachable in the
185 particular programs or tests that were
186 analyzed.
187 </p>
188 <!-- Zero means show all package entry points. -->
189 <ul style="margin-left: 0.5in" id="callgraph-0" class="treeview"></ul>
190 </script>
191 </div>
192 </div> <!-- #pkg-callgraph -->
193
194
195
196
197
198
199
200 <h2 id="Domain">type <a href="/src/pkg/bryfry_swas/proxyauth/proxyauth.go?s=660:745#L15">Domain</a></h2>
201 <pre>type Domain struct {
202 Address <a href="/pkg/builtin/#string">string</a> `json:"domain"`
203 Users []<a href="#User">User</a> `json:"users"`
204}</pre>
205 <p>
206Domains are identified by their Address (unique) and contain a slice of all the
207registered Users for that domain
208</p>
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225 <h2 id="Proxy">type <a href="/src/pkg/bryfry_swas/proxyauth/proxyauth.go?s=500:539#L9">Proxy</a></h2>
226 <pre>type Proxy struct {
227 Domains []<a href="#Domain">Domain</a>
228}</pre>
229 <p>
230Proxy data model of a slice of Domains searched when authentication request is made.
231Proxy is the highest level data model in proxyauth, the golang type analogous to users.json
232</p>
233
234
235
236
237
238
239
240
241
242
243
244
245 <h3 id="NewProxy">func <a href="/src/pkg/bryfry_swas/proxyauth/proxyauth.go?s=1513:1559#L41">NewProxy</a></h3>
246 <pre>func NewProxy(filePath <a href="/pkg/builtin/#string">string</a>) (*<a href="#Proxy">Proxy</a>, <a href="/pkg/builtin/#error">error</a>)</pre>
247 <p>
248Parse the json users file (filePath) and return the proxy data type.
249</p>
250
251
252
253
254
255
256
257 <h3 id="Proxy.Authenticate">func (*Proxy) <a href="/src/pkg/bryfry_swas/proxyauth/proxyauth.go?s=3769:3812#L131">Authenticate</a></h3>
258 <pre>func (p *<a href="#Proxy">Proxy</a>) Authenticate() <a href="/pkg/net/http/">http</a>.<a href="/pkg/net/http/#Handler">Handler</a></pre>
259 <p>
260Proxy Authentication handler expects: domain (mux url variable) username and password
261(query parameters). HTTP response returns the appropriate json response and Status
262Code as specified in SPEC.md
263</p>
264
265
266
267
268
269
270
271
272 <h2 id="Response">type <a href="/src/pkg/bryfry_swas/proxyauth/proxyauth.go?s=1107:1213#L28">Response</a></h2>
273 <pre>type Response struct {
274 Success <a href="/pkg/builtin/#bool">bool</a> `json:"access_granted"`
275 Reason <a href="/pkg/builtin/#string">string</a> `json:"reason,omitempty"`
276}</pre>
277 <p>
278Response is used for communicating the result from an attempted authentication
279</p>
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296 <h2 id="User">type <a href="/src/pkg/bryfry_swas/proxyauth/proxyauth.go?s=933:1023#L22">User</a></h2>
297 <pre>type User struct {
298 Username <a href="/pkg/builtin/#string">string</a> `json:"username"`
299 Password <a href="/pkg/builtin/#string">string</a> `json:"password"`
300}</pre>
301 <p>
302Users are identified by their Username (unique) and each has a Base 64 encoded, SHA 256 digest
303of the users password. See SPEC.md or b64sha256 for specific implementation details
304</p>
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329<div id="footer">
330Build version go1.3.1.<br>
331Except as <a href="https://developers.google.com/site-policies#restrictions">noted</a>,
332the content of this page is licensed under the
333Creative Commons Attribution 3.0 License,
334and code is licensed under a <a href="/LICENSE">BSD license</a>.<br>
335<a href="/doc/tos.html">Terms of Service</a> |
336<a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
337</div>
338
339</div><!-- .container -->
340</div><!-- #page -->
341
342<!-- TODO(adonovan): load these from <head> using "defer" attribute? -->
343<script type="text/javascript" src=".godoc/jquery.js"></script>
344<script type="text/javascript" src=".godoc/jquery.treeview.js"></script>
345<script type="text/javascript" src=".godoc/jquery.treeview.edit.js"></script>
346
347
348<script type="text/javascript" src=".godoc/godocs.js"></script>
349
350</body>
351</html>
352