aehcl

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: MIT Imports: 3 Imported by: 0

README

App Engine Http Client

GoDoc Go Report Card

Description

App Engine HTTP Client provides HTTP RoundTripper for authentication service-to-service in Google App Engine.
This package is inspired by Authentication Service-to-Service

Installation

go get github.com/DeNA/aehcl

Usage


client := &http.Client {
    Transport: aehcl.Transport(nil)
}

License

MIT

Documentation

Overview

Package aehcl provides service-to-service authentication in Google App Engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchIDToken

func FetchIDToken() (string, error)

FetchIDToken returns identity token from metadata API.

func Transport

func Transport(base http.RoundTripper, opts ...Option) http.RoundTripper

Transport is an implementation of http.RoundTripper for service-to-service authentication. When required service-to-service authentication, create http.Client using this transport.

Default RoundTripper is http.DefaultTransport, and FetchIDToken is assigned as default option.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is interface that sets transport option required service-to-service authentication.

func WithTokenSource

func WithTokenSource(ts TokenSource) Option

WithTokenSource sets token source required service-to-service authentication to transport option.

type TokenSource

type TokenSource func() (string, error)

TokenSource is function that returns token required service-to-service authentication in App Engine.

Jump to

Keyboard shortcuts

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