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(ctx context.Context, jsonCreds []byte, useExp bool) (_ 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(ctx context.Context, jsonCreds []byte, useExp bool) (_ *http.Client, err error)

NewClient creates an http.Client for accessing go-discovery services. Its first argument is the JSON contents of a service account credentials file. If nil, default credentials are used. Its second argument determines which client ID to use.

Package auth imports 5 packages (graph) and is imported by 2 packages. Updated 2020-10-28. Refresh now. Tools for package owners.