pkgsite: golang.org/x/pkgsite/internal/auth Index | Files

package auth

import "golang.org/x/pkgsite/internal/auth"

Package auth authorizes programs to make HTTP requests to the discovery site.

Index

Package Files

auth.go

func Header(jsonCreds []byte) (_ string, err error)

Header returns a header value (typically a Bearer token) to be used in the HTTP 'Authorization' header.

func NewClient Uses

func NewClient(jsonCreds []byte) (_ *http.Client, err error)

NewClient creates an http.Client for accessing go-discovery services. Its argument is the JSON contents of a service account credentials file.

func TokenSource Uses

func TokenSource(json []byte) (_ oauth2.TokenSource, err error)

TokenSource creates an oauth2.TokenSource for accessing go-discovery services. Its argument is the JSON contents of a service account credentials file.

Package auth imports 6 packages (graph) and is imported by 2 packages. Updated 2020-08-05. Refresh now. Tools for package owners.