Skip to content

Commit f114acf

Browse files
committed
feat(agents auth): add --proxy-id flag to create command
Allows specifying a proxy to use for browser sessions during authentication.
1 parent 84f11a7 commit f114acf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmd/agent_auth.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ type CreateInput struct {
4343
CredentialName string
4444
LoginURL string
4545
AllowedDomains []string
46+
ProxyID string
4647
}
4748

4849
// Create creates a new auth agent.
@@ -63,6 +64,11 @@ func (a AgentAuthCmd) Create(ctx context.Context, in CreateInput) error {
6364
if len(in.AllowedDomains) > 0 {
6465
params.AuthAgentCreateRequest.AllowedDomains = in.AllowedDomains
6566
}
67+
if in.ProxyID != "" {
68+
params.AuthAgentCreateRequest.Proxy = kernel.AuthAgentCreateRequestProxyParam{
69+
ProxyID: kernel.Opt(in.ProxyID),
70+
}
71+
}
6672

6773
agent, err := a.auth.New(ctx, params)
6874
if err != nil {
@@ -511,6 +517,7 @@ func init() {
511517
agentsAuthCreateCmd.Flags().String("credential-name", "", "Optional credential name to link")
512518
agentsAuthCreateCmd.Flags().String("login-url", "", "Optional login URL to skip discovery")
513519
agentsAuthCreateCmd.Flags().StringSlice("allowed-domains", nil, "Additional allowed domains for OAuth redirects")
520+
agentsAuthCreateCmd.Flags().String("proxy-id", "", "Optional proxy ID to use for browser sessions")
514521
agentsAuthCreateCmd.Flags().BoolP("interactive", "i", false, "Interactive mode - select profile and credential from lists")
515522

516523
// invoke flags
@@ -538,6 +545,7 @@ func runAgentsAuthCreate(cmd *cobra.Command, args []string) error {
538545
credentialName, _ := cmd.Flags().GetString("credential-name")
539546
loginURL, _ := cmd.Flags().GetString("login-url")
540547
allowedDomains, _ := cmd.Flags().GetStringSlice("allowed-domains")
548+
proxyID, _ := cmd.Flags().GetString("proxy-id")
541549
interactive, _ := cmd.Flags().GetBool("interactive")
542550

543551
if interactive {
@@ -652,6 +660,7 @@ func runAgentsAuthCreate(cmd *cobra.Command, args []string) error {
652660
CredentialName: credentialName,
653661
LoginURL: loginURL,
654662
AllowedDomains: allowedDomains,
663+
ProxyID: proxyID,
655664
})
656665
}
657666

0 commit comments

Comments
 (0)