Documentation ¶
Index ¶
Constants ¶
const DisabledCredentialFile = "DISABLED"
DisabledCredentialFile is a special value for the credential file path that we disable oauth authentication this is used for local testing.
Variables ¶
var ErrUnsupportedDatabaseVersion = errors.New("unsupported database version")
ErrUnsupportedDatabaseVersion is returned when a user attempts to use db-auth-gateway with an incompatible database version.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an instance of the cloud database api client for use with Google Cloud.
func NewClientFromCredentialFile ¶
func NewClientFromCredentialFile(ctx context.Context, credentialFile, apiEndpoint string) (*Client, error)
NewClientFromCredentialFile constructs a new Google Cloud API client from the supplied JSON credential file.
func (*Client) CreateClientCertificate ¶
func (c *Client) CreateClientCertificate(instance string, pubKey crypto.PublicKey) (*sqladmin.SslCert, error)
CreateClientCertificate is used to create a new ephemeral client certificate from the supplied key pair. This client certificate is used for mutual TLS authentication with the database.
func (*Client) GetInstance ¶
func (c *Client) GetInstance(instance string) (*sqladmin.DatabaseInstance, error)
GetInstance queries the API for information about a given database instance.
type DisabledTokenSource ¶ added in v0.1.8
type DisabledTokenSource struct{}
DisabledTokenSource is a mocked oauth token source for local testing.