@@ -27,9 +27,9 @@ import (
2727 "strings"
2828 "syscall"
2929
30- "cloud.google.com/go/cloudsqlconn "
31- "github.com/GoogleCloudPlatform/cloudsql- proxy/v2/cloudsql "
32- "github.com/GoogleCloudPlatform/cloudsql- proxy/v2 /internal/proxy"
30+ "cloud.google.com/go/alloydbconn "
31+ "github.com/GoogleCloudPlatform/alloydb-auth- proxy/alloydb "
32+ "github.com/GoogleCloudPlatform/alloydb-auth- proxy/internal/proxy"
3333 "github.com/spf13/cobra"
3434)
3535
4242
4343func init () {
4444 versionString = strings .TrimSpace (versionString )
45- userAgent = "cloud-sql -auth-proxy/" + versionString
45+ userAgent = "alloy-db -auth-proxy/" + versionString
4646}
4747
4848// Execute adds all child commands to the root command and sets flags appropriately.
@@ -57,7 +57,7 @@ func Execute() {
5757 }
5858}
5959
60- // Command represents an invocation of the Cloud SQL Auth Proxy.
60+ // Command represents an invocation of the AlloyDB Auth Proxy.
6161type Command struct {
6262 * cobra.Command
6363 conf * proxy.Config
@@ -67,8 +67,8 @@ type Command struct {
6767type Option func (* proxy.Config )
6868
6969// WithDialer configures the Command to use the provided dialer to connect to
70- // Cloud SQL instances.
71- func WithDialer (d cloudsql .Dialer ) Option {
70+ // AlloyDB instances.
71+ func WithDialer (d alloydb .Dialer ) Option {
7272 return func (c * proxy.Config ) {
7373 c .Dialer = d
7474 }
@@ -84,13 +84,13 @@ func NewCommand(opts ...Option) *Command {
8484 }
8585
8686 cmd := & cobra.Command {
87- Use : "cloud_sql_proxy instance_connection_name..." ,
87+ Use : "alloydb-auth-proxy instance_connection_name..." ,
8888 Version : versionString ,
89- Short : "cloud_sql_proxy provides a secure way to authorize connections to Cloud SQL ." ,
90- Long : `The Cloud SQL Auth proxy provides IAM-based authorization and encryption when
91- connecting to Cloud SQL instances. It listens on a local port and forwards connections
92- to your instance's IP address, providing a secure connection without having to manage
93- any client SSL certificates.` ,
89+ Short : "alloydb-auth-proxy provides a secure way to authorize connections to AlloyDB ." ,
90+ Long : `The AlloyDB Auth proxy provides IAM-based authorization and encryption when
91+ connecting to AlloyDB instances. It listens on a local port and forwards
92+ connections to your instance's IP address, providing a secure connection
93+ without having to manage any client SSL certificates.` ,
9494 Args : func (cmd * cobra.Command , args []string ) error {
9595 err := parseConfig (cmd , c .conf , args )
9696 if err != nil {
@@ -113,8 +113,8 @@ any client SSL certificates.`,
113113
114114 // Global and per instance flags
115115 cmd .PersistentFlags ().StringVarP (& c .conf .Addr , "address" , "a" , "127.0.0.1" ,
116- "Address on which to bind Cloud SQL instance listeners." )
117- cmd .PersistentFlags ().IntVarP (& c .conf .Port , "port" , "p" , 0 ,
116+ "Address on which to bind AlloyDB instance listeners." )
117+ cmd .PersistentFlags ().IntVarP (& c .conf .Port , "port" , "p" , 5432 ,
118118 "Initial port to use for listeners. Subsequent listeners increment from this value." )
119119
120120 c .Command = cmd
@@ -142,7 +142,7 @@ func parseConfig(cmd *cobra.Command, conf *proxy.Config, args []string) error {
142142 case conf .CredentialsFile != "" :
143143 cmd .Printf ("Authorizing with the credentials file at %q\n " , conf .CredentialsFile )
144144 default :
145- cmd .Printf ("Authorizing with Application Default Credentials" )
145+ cmd .Println ("Authorizing with Application Default Credentials" )
146146 }
147147
148148 var ics []proxy.InstanceConnConfig
@@ -227,9 +227,9 @@ func runSignalWrapper(cmd *Command) error {
227227 // Otherwise, initialize a new one.
228228 d := cmd .conf .Dialer
229229 if d == nil {
230- opts := append (cmd .conf .DialerOpts (), cloudsqlconn .WithUserAgent (userAgent ))
230+ opts := append (cmd .conf .DialerOpts (), alloydbconn .WithUserAgent (userAgent ))
231231 var err error
232- d , err = cloudsqlconn .NewDialer (ctx , opts ... )
232+ d , err = alloydbconn .NewDialer (ctx , opts ... )
233233 if err != nil {
234234 shutdownCh <- fmt .Errorf ("error initializing dialer: %v" , err )
235235 return
0 commit comments