firebaseauth

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 12 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClaims

func GetClaims(ctx context.Context) (map[string]interface{}, bool)

GetClaims ... FirebaseAuthのJWTClaimsの値を取得

func GetUserID

func GetUserID(ctx context.Context) string

GetUserID ... FirebaseAuthのユーザーIDを取得

func NewClient

func NewClient(projectID string) *auth.Client

NewClient ... クライアントを作成

Types

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware ... Firebase認証のミドルウェア

func NewMiddleware

func NewMiddleware(svc Service, optional bool) *Middleware

NewMiddleware ... Middlewareを作成する

func (*Middleware) Handle

func (m *Middleware) Handle(next http.Handler) http.Handler

Handle ... Firebase認証をする

type Provider

type Provider string
const (
	ProviderTwitter  Provider = "twitter.com"
	ProviderFacebook Provider = "facebook.com"
	ProviderGoogle   Provider = "google.com"
)

type Service

type Service interface {
	Authentication(
		ctx context.Context,
		ah string) (string, map[string]interface{}, error)
	SetCustomClaims(
		ctx context.Context,
		userID string,
		claims map[string]interface{}) error
	GetEmail(
		ctx context.Context,
		userID string) (string, error)
	GetTwitterID(
		ctx context.Context,
		userID string) (string, error)
	ExistUser(
		ctx context.Context,
		userID string) (bool, error)
	IsEmailVerified(
		ctx context.Context,
		userID string) (bool, error)
	CreateUser(
		ctx context.Context,
		email string,
		password string,
		displayName string) (string, error)
	UpdateUser(
		ctx context.Context,
		userID string,
		email *string,
		password *string,
		displayName *string) error
	DeleteUser(
		ctx context.Context,
		userID string) error
	GeneratePasswordRemindURL(
		ctx context.Context,
		userID string,
		email string,
		setting *auth.ActionCodeSettings) (string, error)
}

Service ... Firebase認証の機能を提供する

func NewService

func NewService(cli *auth.Client) Service

NewService ... Serviceを作成する

func NewServiceDebug

func NewServiceDebug(cli *auth.Client, dummyClaims map[string]interface{}) Service

NewServiceDebug ... ServiceDebugを作成する

Jump to

Keyboard shortcuts

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