auth

package
v0.0.0-...-c783a93 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package auth implements helpers for securing routes

Package auth implements helpers for securing routes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CredentialsPath

func CredentialsPath() string

CredentialsPath returns a canonical path to the credentials.json file

Types

type RequireAdmin

type RequireAdmin struct {
	H http.Handler
}

RequireAdmin is an http.Handler which wraps another handler, requiring users to be admins before accessing this handler.

func (RequireAdmin) ServeHTTP

func (ra RequireAdmin) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Status

type Status struct {
	User    github.User
	Valid   bool
	Onboard bool
}

Status consists of the fields that will be returned on successful authentication

func VerifyAuthToken

func VerifyAuthToken(r *http.Request) (Status, bool)

VerifyAuthToken checks if the request contains a valid Firebase Auth token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL