auth
auth/config.go
Add authd. Start adding our server implementation. Right now, it's very proof-of-concept stage and will almost certainly be entirely rewritten, but it gets a server up and running.
| paddy@96 | 1 package auth |
| paddy@96 | 2 |
| paddy@96 | 3 import ( |
| paddy@96 | 4 "errors" |
| paddy@96 | 5 "html/template" |
| paddy@96 | 6 ) |
| paddy@96 | 7 |
| paddy@96 | 8 var ( |
| paddy@96 | 9 // ErrInvalidLoginURI is returned when a Context is instantiated with a Config object that specifies a LoginURI that can't be parsed as a URL. |
| paddy@96 | 10 ErrInvalidLoginURI = errors.New("invalid login URI") |
| paddy@96 | 11 ) |
| paddy@96 | 12 |
| paddy@96 | 13 // Config holds the configuration values necessary to run a server. A Config |
| paddy@96 | 14 // instance is the only way to instantiate a Context variable. |
| paddy@96 | 15 type Config struct { |
| paddy@96 | 16 ClientStore clientStore |
| paddy@96 | 17 AuthCodeStore authorizationCodeStore |
| paddy@96 | 18 ProfileStore profileStore |
| paddy@96 | 19 TokenStore tokenStore |
| paddy@96 | 20 SessionStore sessionStore |
| paddy@96 | 21 Template *template.Template |
| paddy@96 | 22 LoginURI string |
| paddy@96 | 23 iterations int |
| paddy@96 | 24 } |