Skip to content

Commit

Permalink
Add review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
martinalbert committed Aug 25, 2023
1 parent 8fbfb3e commit ee1b2e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmd/baton-demisto/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ func validateConfig(ctx context.Context, cfg *config) error {
return fmt.Errorf("an access token must be provided")
}

if cfg.Domain == "" {
return fmt.Errorf("a domain of the Cortex XSOAR instance must be provided")
}

return nil
}

// cmdFlags sets the cmdFlags required for the connector.
func cmdFlags(cmd *cobra.Command) {
cmd.PersistentFlags().String("token", "", "Access token used to connect to the Cortex XSOAR API. ($BATON_TOKEN)")
cmd.PersistentFlags().Bool("unsafe", false, "Allow insecure TLS connections to Cortex XSOAR instance. ($BATON_UNSAFE)")
cmd.PersistentFlags().String("domain", "localhost", "Domain of the Cortex XSOAR instance. ($BATON_DOMAIN)")
cmd.PersistentFlags().String("domain", "", "Domain of the Cortex XSOAR instance. ($BATON_DOMAIN)")
}
2 changes: 1 addition & 1 deletion pkg/demisto/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"google.golang.org/grpc/status"
)

const BaseURL = "https://%s:8443"
const BaseURL = "https://%s"
const CurrentUserBaseURL = BaseURL + "/user"
const UsersBaseURL = BaseURL + "/users"
const RolesBaseURL = BaseURL + "/roles"
Expand Down

0 comments on commit ee1b2e2

Please sign in to comment.