Auth Provider (#1309)

* auth provider mock interface

* Auth Provider Options

* Implement API Server Auth Package

* Add weh utils

* Add Login URL

* Auth Provider Options

* Add auth provider scope and setting token in cookie

* Remove auth_login_url flag

Co-authored-by: Asim Aslam <asim@aslam.me>
Co-authored-by: Ben Toogood <ben@micro.mu>
This commit is contained in:
ben-toogood
2020-03-07 11:06:57 +00:00
committed by GitHub
parent 8ee5607254
commit 9a7a65f05e
10 changed files with 350 additions and 1 deletions

View File

@@ -44,7 +44,7 @@ type Role struct {
// Account provided by an auth provider
type Account struct {
// ID of the account (UUID or email)
// ID of the account (UUIDV4, email or username)
Id string `json:"id"`
// Token used to authenticate
Token string `json:"token"`
@@ -62,6 +62,9 @@ const (
// MetadataKey is the key used when storing the account
// in metadata
MetadataKey = "auth-account"
// CookieName is the name of the cookie which stores the
// auth token
CookieName = "micro-token"
)
// AccountFromContext gets the account from the context, which