client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2018 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TokenRequestURL = "https://www.googleapis.com/oauth2/v4/token"
	ClaimScope      = "https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/compute.readonly"
	ClaimAUD        = "https://www.googleapis.com/oauth2/v4/token"
	JWTGrantType    = "urn:ietf:params:oauth:grant-type:jwt-bearer"
)

Variables

This section is empty.

Functions

func New

func New(serviceAccountFilePath string) (*http.Client, error)

Types

type GCPServiceAccountTokenSource

type GCPServiceAccountTokenSource struct {
	// contains filtered or unexported fields
}

func NewGCPServiceAccountTokenSource

func NewGCPServiceAccountTokenSource(serviceAccountFilePath string) *GCPServiceAccountTokenSource

func (*GCPServiceAccountTokenSource) Token

type HTTPClientInterface

type HTTPClientInterface interface {
	Do(*http.Request) (*http.Response, error)
}

type HTTPRequestBuilder

type HTTPRequestBuilder struct{}

func (*HTTPRequestBuilder) NewRequest

func (rb *HTTPRequestBuilder) NewRequest(method, url string, body string) (*http.Request, error)

type HTTPRequestBuilderInterface

type HTTPRequestBuilderInterface interface {
	NewRequest(string, string, string) (*http.Request, error)
}

type JWSEncoder

type JWSEncoder struct{}

func (*JWSEncoder) Encode

func (je *JWSEncoder) Encode(header *jws.Header, c *jws.ClaimSet, key *rsa.PrivateKey) (string, error)

type JWSEncoderInterface

type JWSEncoderInterface interface {
	Encode(*jws.Header, *jws.ClaimSet, *rsa.PrivateKey) (string, error)
}

type JWTConfigReader

type JWTConfigReader struct {
	// contains filtered or unexported fields
}

func NewJWTConfigReader

func NewJWTConfigReader(serviceAccountFilePath string) *JWTConfigReader

func (*JWTConfigReader) JWTConfig

func (jcr *JWTConfigReader) JWTConfig() *jwt.Config

func (*JWTConfigReader) Read

func (jcr *JWTConfigReader) Read() error

type JWTConfigReaderInterface

type JWTConfigReaderInterface interface {
	JWTConfig() *jwt.Config
	Read() error
}

type KeyParser

type KeyParser struct {
	// contains filtered or unexported fields
}

func NewKeyParser

func NewKeyParser(encodedKey []byte) *KeyParser

func (*KeyParser) ParseKey

func (kp *KeyParser) ParseKey() error

func (*KeyParser) PrivateKey

func (kp *KeyParser) PrivateKey() *rsa.PrivateKey

type KeyParserInterface

type KeyParserInterface interface {
	PrivateKey() *rsa.PrivateKey
	ParseKey() error
}

type MockHTTPClientInterface

type MockHTTPClientInterface struct {
	mock.Mock
}

MockHTTPClientInterface is an autogenerated mock type for the HTTPClientInterface type

func (*MockHTTPClientInterface) Do

Do provides a mock function with given fields: _a0

type MockHTTPRequestBuilderInterface

type MockHTTPRequestBuilderInterface struct {
	mock.Mock
}

MockHTTPRequestBuilderInterface is an autogenerated mock type for the HTTPRequestBuilderInterface type

func (*MockHTTPRequestBuilderInterface) NewRequest

func (_m *MockHTTPRequestBuilderInterface) NewRequest(_a0 string, _a1 string, _a2 string) (*http.Request, error)

NewRequest provides a mock function with given fields: _a0, _a1, _a2

type MockJWSEncoderInterface

type MockJWSEncoderInterface struct {
	mock.Mock
}

MockJWSEncoderInterface is an autogenerated mock type for the JWSEncoderInterface type

func (*MockJWSEncoderInterface) Encode

func (_m *MockJWSEncoderInterface) Encode(_a0 *jws.Header, _a1 *jws.ClaimSet, _a2 *rsa.PrivateKey) (string, error)

Encode provides a mock function with given fields: _a0, _a1, _a2

type MockJWTConfigReaderInterface

type MockJWTConfigReaderInterface struct {
	mock.Mock
}

MockJWTConfigReaderInterface is an autogenerated mock type for the JWTConfigReaderInterface type

func (*MockJWTConfigReaderInterface) JWTConfig

func (_m *MockJWTConfigReaderInterface) JWTConfig() *jwt.Config

JWTConfig provides a mock function with given fields:

func (*MockJWTConfigReaderInterface) Read

Read provides a mock function with given fields:

type MockKeyParserInterface

type MockKeyParserInterface struct {
	mock.Mock
}

MockKeyParserInterface is an autogenerated mock type for the KeyParserInterface type

func (*MockKeyParserInterface) ParseKey

func (_m *MockKeyParserInterface) ParseKey() error

ParseKey provides a mock function with given fields:

func (*MockKeyParserInterface) PrivateKey

func (_m *MockKeyParserInterface) PrivateKey() *rsa.PrivateKey

PrivateKey provides a mock function with given fields:

type MockTokenRequesterInterface

type MockTokenRequesterInterface struct {
	mock.Mock
}

MockTokenRequesterInterface is an autogenerated mock type for the TokenRequesterInterface type

func (*MockTokenRequesterInterface) RequestToken

func (_m *MockTokenRequesterInterface) RequestToken() error

RequestToken provides a mock function with given fields:

func (*MockTokenRequesterInterface) Token

Token provides a mock function with given fields:

type TokenRequester

type TokenRequester struct {
	// contains filtered or unexported fields
}

func NewTokenRequester

func NewTokenRequester(config *jwt.Config, privateKey *rsa.PrivateKey) *TokenRequester

func (*TokenRequester) RequestToken

func (tr *TokenRequester) RequestToken() error

func (*TokenRequester) Token

func (tr *TokenRequester) Token() *oauth2.Token

type TokenRequesterInterface

type TokenRequesterInterface interface {
	Token() *oauth2.Token
	RequestToken() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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