aehcl

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 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/emahiro/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 added in v1.1.0

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 added in v1.1.0

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

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

func WithTokenSource added in v1.1.0

func WithTokenSource(ts TokenSource) Option

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

type TokenSource added in v1.1.0

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