@@ -51,11 +51,18 @@ var (
5151 Short : "Configure IAP for a given repository" ,
5252 Run : configureIAP ,
5353 }
54+
55+ checkCmd = & cobra.Command {
56+ Use : "check remote url" ,
57+ Short : "Refresh token for remote url if needed, then exit" ,
58+ Run : check ,
59+ }
5460)
5561
5662func init () {
5763 rootCmd .AddCommand (versionCmd )
5864 rootCmd .AddCommand (installProtocolCmd )
65+ rootCmd .AddCommand (checkCmd )
5966
6067 configureCmd .Flags ().StringVar (& repoURL , "repoURL" , "" , "URL of the git repository to configure (required)" )
6168 configureCmd .MarkFlagRequired ("repoURL" )
@@ -89,6 +96,13 @@ func execute(cmd *cobra.Command, args []string) {
8996 git .PassThruRemoteHTTPSHelper (remote , url )
9097}
9198
99+ func check (cmd * cobra.Command , args []string ) {
100+ remote , url := args [0 ], args [1 ]
101+ log .Debug ().Msgf ("%s check %s %s" , binaryName , remote , url )
102+
103+ handleIAPAuthCookieFor (url )
104+ }
105+
92106func printVersion (cmd * cobra.Command , args []string ) {
93107 fmt .Printf ("%s %s\n " , binaryName , version )
94108}
0 commit comments