cr

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

README

gcputil/cr

This utility enables service to service calls between Cloud Run services where the target service requires requires authentication. This utility will append default service accounts identity authorization header (Authorization: Bearer ***) to the referenced HTTP request.

Import

import "github.com/mchmarny/gcputil/cr"

Usage

req, err := http.NewRequest("GET", url, nil)
if err != nil {
    log.Fatal(err)
}
err = cr.AuthorizeRequest(req, url)
if err != nil {
    log.Fatal(err)
}
resp, err := http.DefaultClient.Do(req)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizeRequest

func AuthorizeRequest(req *http.Request, audience string) error

AuthorizeRequest appends header authorization using the default service account identity

Types

This section is empty.

Jump to

Keyboard shortcuts

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