auth

package
v0.0.0-...-783baa7 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCIPAuthenticator

type GCIPAuthenticator struct {
	UserAuthClient
}

GCIPAuthenticator is a struct that authenticates users using Firebase Auth, which is part of Google Cloud Identity Platform (GCIP). It implements the UserAuthClient interface.

func NewGCIPAuthenticator

func NewGCIPAuthenticator(client UserAuthClient) *GCIPAuthenticator

NewGCIPAuthenticator creates a new GCIPAuthenticator instance.

func (GCIPAuthenticator) Authenticate

func (a GCIPAuthenticator) Authenticate(ctx context.Context, idToken string) (*User, error)

Authenticate authenticates a user using the provided ID token.

type GCPTokenGenerator

type GCPTokenGenerator struct{}

GCPTokenGenerator generates an authentication token for processes running inside GCP.

type User

type User struct {
	ID string
}

User contains the details of an authenticated user.

type UserAuthClient

type UserAuthClient interface {
	VerifyIDToken(context.Context, string) (*firebaseauth.Token, error)
}

UserAuthClient is an interface that defines the methods for interacting with a user authentication provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳