auth

Paddy 2015-01-10 Parent:e45bfa2abc00 Child:3223a8e679db

113:5bd46746b809 Go to Latest

auth/doc.go

Let's test our verifyClient function. C'mon, it'll be fun! Add a function that tests the verifyClient function to our unit test suite. Basically, make sure that all the conceivable types of input have the right logic flow for what a "valid client" is. Also leave a note in client.go that makes it clear that public clients _should not be issued secrets in the first place_, because a public client that is issued a secret and specifies its client ID using the `client_id` POST body format will be told that it is not a valid client. While there are ways around this, the spec clearly states that non-confidential clients are not supposed to be issued secrets, so this seems like a nice way to conform to the spec or break trying.

History
1 /*
2 Package auth provides an authentication service for managing user accounts and an OAuth2 provider.
4 The service is an opinionated implementation of authentication using passphrases and the
5 code.secondbit.org/pass package to implement user credentials and accounts. Additionally, users
6 are permitted to login using their email address on record or their username interchangeably.
7 Care is also taken to be able to mitigate attacks that have already happened and plan ahead for
8 the worst case scenarios.
10 An OAuth2 provider is also built-in and provided, complete with client registration and management,
11 as well as a specification-based set of handlers for managing the issuing of grants and tokens. Token
12 validiity may be asserted through an API, or a proxy service is provided for stripping auth-specific
13 information from requests and replacing it with a trusted header containing information about the user
14 and client that authorized the request.
15 */
16 package auth