util

package
v0.9.1-0...-c0ca104 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2018 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearCache

func ClearCache() error

func Fetch

func Fetch(settings *sgauth.Settings, format string)

Fetches and prints the token in plain text with the given settings using Google Authenticator.

func Header(settings *sgauth.Settings, format string)

Fetches and prints the token in header format with the given settings using Google Authenticator.

func Info

func Info(token string)

Fetch the information of the given token.

func InsertCache

func InsertCache(settings *sgauth.Settings, token *sgauth.Token) error

func LookupCache

func LookupCache(settings *sgauth.Settings) (*sgauth.Token, error)

func Reset

func Reset()

Reset the cache

func SSOFetch

func SSOFetch(email string, cli string, task string, scope string)

Fetches the access token using SSO CLI.

func Test

func Test(token string)

Test the given token. Returns 0 for valid tokens. Otherwise returns 1.

Types

type CacheKey

type CacheKey struct {
	// The JSON credentials content downloaded from Google Cloud Console.
	CredentialsJSON string
	// If specified, use OAuth. Otherwise, JWT.
	Scope string
	// The audience field for JWT auth
	Audience string
	// The Google API key
	APIKey string
}

The key struct that used to identify an auth token fetch operation.

Jump to

Keyboard shortcuts

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