auth

package
v1.1.2-0...-d77c1f3 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultHTTPClientProvider = getDefaultHTTPClient

DefaultHTTPClientProvider defaultHTTP client

View Source
var DefaultProjectProvider = getDefaultProject

DefaultProjectProvider default projectid provider

View Source
var Scopes = []string{
	"https://www.googleapis.com/auth/userinfo.email",
	"https://www.googleapis.com/auth/bigquery",
	"https://www.googleapis.com/auth/cloud-platform.read-only",
	"https://www.googleapis.com/auth/devstorage.full_control",
	"https://www.googleapis.com/auth/pubsub",
}

Scopes auth scopes

Functions

func SelectProjectID

func SelectProjectID(ctx context.Context, client *http.Client, scopes ...string) (string, error)

SelectProjectID selector project for auth user

Types

type Client

type Client struct {
	ID       string
	Secret   string
	TokenURL string
}

Client represents an oauth client

func ClientFromURL

func ClientFromURL(URL string) (*Client, error)

func (*Client) Init

func (c *Client) Init()

type Service

type Service interface {
	//AuthHTTPClient return oauth http client
	AuthHTTPClient(ctx context.Context, scopes []string) (*http.Client, error)

	ProjectID(ctx context.Context, scopes []string) (string, error)
}

Service auth service

func New

func New(client *Client, useGsUtilAuth bool, projectID string, scopes ...string) Service

New creates a new auth service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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