auth
99:5bccbed6631b
Go to Latest
auth/doc.go
Add an endpoint to validate and register profiles.
Add a newProfileRequest object that defines the user-specified properties of a
new Profile.
Add a helper that validates a newProfileRequest and modifies it for
sanitization, mostly just removing leading and trailing whitespace.
Add MaxNameLength, MaxUsernameLength, and MaxEmailLength constants to hold the
maximum length for those properties.
Add errors to be returned when a users attempts to log in with a profile that is
compromised or locked.
Add the bare bones of a CreateProfileHandler that validates a profile
registration request adn uses it to create a Profile and at least one Login.
Create a requestError struct that is used for returning API errors, along with
constants for the slugs we'll use to signal those errors.
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.