auth
57:e45bfa2abc00
Go to Latest
auth/doc.go
The great documentation and exported interface cleanup.
Modify all our *Store interfaces to be unexported, as there's no real good
reason they need to be exported, especially as they can be implemented without
being exported. The interfaces shouldn't matter to 99% of users of the package,
so let's not pollute our package API.
Further, all methods of the interfaces are now unexported, for pretty much the
same reasoning.
Add a doc.go file with documentation explaining the choices the package is
making and what it provides.
Implement documentation on all our exported types and methods and functions,
which makes golint happy. The only remaining golint warning is about
NewMemstore, which will stay the way it is. The memstore type is useful outside
tests for things like standing up a server quickly when we don't care about the
storage, and because the type is unexported, we _need_ a New function to create
an instance that can be passed to the Context.
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.