Documentation ¶
Overview ¶
Package jwtclient facilitates creation of HTTP clients that use JSON web tokens for two-legged OAuth2 authentication with Google's service APIs.
Index ¶
- func New(ctx context.Context, keydata []byte, scope ...string) (*http.Client, error)
- func NewFromKeyfile(ctx context.Context, keyfile string, scope ...string) (*http.Client, error)
- func NewFromKeyfileWithSubject(ctx context.Context, keyfile, subject string, scope ...string) (*http.Client, error)
- func NewWithSubject(ctx context.Context, keydata []byte, subject string, scope ...string) (*http.Client, error)
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns an OAuth2 authenticating HTTP client for the given key data and scope(s).
The key data must be in JSON format.
The client will only be valid as long as the given context is valid.
func NewFromKeyfile ¶
NewFromKeyfile returns an OAuth2 authenticating HTTP client for the given key file and scope(s).
The key data contained within the key file must be in JSON format.
The client will only be valid as long as the given context is valid.
func NewFromKeyfileWithSubject ¶
func NewFromKeyfileWithSubject(ctx context.Context, keyfile, subject string, scope ...string) (*http.Client, error)
NewFromKeyfileWithSubject returns an OAuth2 authenticating HTTP client for the given key file, subject and scope(s).
The key data contained within the key file must be in JSON format.
The client will only be valid as long as the given context is valid.
func NewWithSubject ¶
func NewWithSubject(ctx context.Context, keydata []byte, subject string, scope ...string) (*http.Client, error)
NewWithSubject returns an OAuth2 authenticating HTTP client for the given key data, subject and scope(s).
The key data must be in JSON format.
The client will only be valid as long as the given context is valid.
Types ¶
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a source of JWT HTTP clients that share a common configuration but can differ in impersonation subjects.
func NewSource ¶
NewSource returns a new source of OAuth2 authenticating HTTP clients. The clients returned by the source will use the given key data and scope(s).
The key data must be in JSON format.
func NewSourceFromKeyfile ¶
NewSourceFromKeyfile returns a source of OAuth2 authenticating HTTP clients. The clients returned by the source will use the key data contained in the given key file and will use given scope(s).
The key data contained within the key file must be in JSON format.
func (*Source) Client ¶
Client returns a new HTTP client with the key data and scope(s) defined by the source.
The client will only be valid as long as the given context is valid.
func (*Source) ClientWithSubject ¶
ClientWithSubject returns a new HTTP client for the given subject with the key data and scope(s) defined by the source.
The client will only be valid as long as the given context is valid.