Documentation ¶
Index ¶
- Constants
- func New(serviceAccountFilePath string) (*http.Client, error)
- type GCPServiceAccountTokenSource
- type HTTPClientInterface
- type HTTPRequestBuilder
- type HTTPRequestBuilderInterface
- type JWSEncoder
- type JWSEncoderInterface
- type JWTConfigReader
- type JWTConfigReaderInterface
- type KeyParser
- type KeyParserInterface
- type MockHTTPClientInterface
- type MockHTTPRequestBuilderInterface
- type MockJWSEncoderInterface
- type MockJWTConfigReaderInterface
- type MockKeyParserInterface
- type MockTokenRequesterInterface
- type TokenRequester
- type TokenRequesterInterface
Constants ¶
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 ¶
Types ¶
type GCPServiceAccountTokenSource ¶
type GCPServiceAccountTokenSource struct {
// contains filtered or unexported fields
}
func NewGCPServiceAccountTokenSource ¶
func NewGCPServiceAccountTokenSource(serviceAccountFilePath string) *GCPServiceAccountTokenSource
type HTTPClientInterface ¶
type JWSEncoder ¶
type JWSEncoder struct{}
type JWSEncoderInterface ¶
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 KeyParser ¶
type KeyParser struct {
// contains filtered or unexported fields
}
func NewKeyParser ¶
func (*KeyParser) PrivateKey ¶
func (kp *KeyParser) PrivateKey() *rsa.PrivateKey
type KeyParserInterface ¶
type KeyParserInterface interface { PrivateKey() *rsa.PrivateKey ParseKey() error }
type MockHTTPClientInterface ¶
MockHTTPClientInterface is an autogenerated mock type for the HTTPClientInterface type
type MockHTTPRequestBuilderInterface ¶
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 ¶
MockJWSEncoderInterface is an autogenerated mock type for the JWSEncoderInterface type
type MockJWTConfigReaderInterface ¶
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 ¶
func (_m *MockJWTConfigReaderInterface) Read() error
Read provides a mock function with given fields:
type MockKeyParserInterface ¶
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 ¶
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 ¶
func (_m *MockTokenRequesterInterface) Token() *oauth2.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