firebase

package
v0.0.0-...-d3da680 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Overview

Package firebase implements an auth server that allows firebase-tools to use an exposed OAuth2 TokenSource for auth. See firebase auth documentation at https://github.com/firebase/firebase-tools and auth implementation https://github.com/firebase/firebase-tools/blob/9422490bd87e934a097a110f77eddac799d965a4/lib/auth.js

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// Source is used to obtain OAuth2 tokens.
	Source oauth2.TokenSource
	// Port is a local TCP port to bind to or 0 to allow the OS to pick one.
	Port int
	// contains filtered or unexported fields
}

Server runs a local server that handles requests to token_uri.

func (*Server) Start

func (s *Server) Start(ctx context.Context) (string, error)

Start launches background goroutine with the serving loop.

The provided context is used as base context for request handlers and for logging. The server must be eventually stopped with Stop().

Returns the root URL of a local server to use as FIREBASE_TOKEN_URL.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop closes the listening socket, notifies pending requests to abort and stops the internal serving goroutine.

Safe to call multiple times. Once stopped, the server cannot be started again (make a new instance of Server instead).

Uses the given context for the deadline when waiting for the serving loop to stop.

Jump to

Keyboard shortcuts

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