api

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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.

func (*DisabledTokenSource) Token added in v0.1.8

func (ts *DisabledTokenSource) Token() (*oauth2.Token, error)

Token issues a mocked bearer token for local testing.

Jump to

Keyboard shortcuts

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