auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package auth provides Google oauth2 bindings for mantle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoogleClient

func GoogleClient() (*http.Client, error)

GoogleClient provides an http.Client authorized with an oauth2 token that is automatically cached and refreshed from a file named '.mantle-cache-google.json'. This uses interactive oauth2 authorization and requires a user follow to follow a web link and paste in an authorization token.

func GoogleClientFromJSONKey

func GoogleClientFromJSONKey(jsonKey []byte, scope ...string) (*http.Client, error)

GoogleClientFromJSONKey provides an http.Client authorized with an oauth2 token retrieved using a Google Developers service account's private JSON key file.

func GoogleServiceClient

func GoogleServiceClient() *http.Client

GoogleServiceClient fetchs a token from Google Compute Engine's metadata service. This should be used on GCE vms. The Default account is used.

func GoogleServiceTokenSource

func GoogleServiceTokenSource() oauth2.TokenSource

GoogleServiceTokenSource provides an oauth2.TokenSource authorized in the same manner as GoogleServiceClient().

func GoogleTokenSource

func GoogleTokenSource() (oauth2.TokenSource, error)

GoogleTokenSource provides an outh2.TokenSource authorized in the same manner as GoogleClient.

func GoogleTokenSourceFromJSONKey

func GoogleTokenSourceFromJSONKey(jsonKey []byte, scope ...string) (oauth2.TokenSource, error)

GoogleTokenSourceFromJSONKey provides an oauth2.TokenSource authorized in the same manner as GoogleClientFromJSONKey.

Types

This section is empty.

Jump to

Keyboard shortcuts

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