Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/admin_cluster_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func init() {
func deployClusters() {
utils.GetAdminUrl()

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_cluster_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func readClusterStatus(req ClusterStatusRequest) (*ClusterStatusDto, error) {
pattern := regexp.MustCompile("%5B([0-9]+)%5D=")
wsURL.RawQuery = pattern.ReplaceAllString(command.Encode(), "[${1}]=")

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_cluster_update_kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func init() {
}

func updateClusterKubeconfig() {
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_demo_get_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var (
os.Exit(0)
}

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_demo_list_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_enable_user_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func enableUserSignup() {
}

// Get access token
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_encrypt_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func encryptSecret() {
}

func callEncryptSecret(organizationId string, secret string) (string, error) {
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
return "", fmt.Errorf("failed to get access token: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_enterprise_connection_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func init() {

func createEnterpriseConnection() {
// Retrieve access token for authorization
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
checkError(err)

// Prepare payload with required fields
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_enterprise_connection_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func init() {

func deleteEnterpriseConnection() {
// Retrieve access token for authorization
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
checkError(err)

// Build URL
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_enterprise_connection_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func init() {

func listEnterpriseConnections() {
// Retrieve access token for authorization
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
checkError(err)

// Build URL
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_jw_qovery_usage_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func init() {
}

func createJwtForQoveryUsage() {
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(0)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_jw_qovery_usage_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func init() {
}

func deleteJwtForQoveryUsage() {
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(0)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_jw_qovery_usage_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func init() {
}

func listJwtsForQoveryUsage() {
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(0)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_jwt_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func init() {
}

func createJwt() {
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(0)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_jwt_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func init() {
}

func deleteJwt() {
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(0)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_jwt_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func init() {
}

func listJwts() {
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(0)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_organization_deployment_restriction.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func manageOrganizationDeploymentRestriction() {
}

// Get access token
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_organization_transfer_ownership.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func transferOrganizationOwnership() {
}

// Get access token
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin_organization_update_billing_external_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func updateOrganizationBillingExternalId() {
os.Exit(1)
}

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
8 changes: 6 additions & 2 deletions cmd/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,12 @@ func runAPI(cmd *cobra.Command, args []string) {
os.Exit(1)
}

// Get auth token
tokenType, token, err := utils.GetAccessToken()
// Get auth token. Creating the very first organization (`qovery api organization
// --method POST ...`, documented above as a first-class example) is the one
// legitimate case where the caller is expected to have zero organizations yet,
// so it skips the usual "you don't have any organization" guard.
isOrgCreation := path == "organization" && method == "POST"
tokenType, token, err := utils.GetAccessToken(isOrgCreation)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_cancel.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var applicationCancelCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var applicationCloneCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_domain_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var applicationDomainCreateCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_domain_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var applicationDomainDeleteCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_domain_edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var applicationDomainEditCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_domain_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var applicationDomainListCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_env_alias_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var applicationEnvAliasCreateCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_env_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var applicationEnvCreateCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_env_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var applicationEnvDeleteCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_env_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var applicationEnvListCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_env_override_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var applicationEnvOverrideCreateCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_env_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var applicationEnvUpdateCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_external_secret_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var applicationExternalSecretCreateCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_external_secret_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var applicationExternalSecretDeleteCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_external_secret_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var applicationExternalSecretUpdateCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var applicationListCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/application_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var applicationUpdateCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/audit_log_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func downloadAuditLogs() {
utils.Println(fmt.Sprintf("Your organization plan provides %.0f days of audit log history", org.OrganizationPlan.GetAuditLogsRetentionInDays()))

// Get access token
tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
checkError(err)

// Create audit log service
Expand Down
2 changes: 1 addition & 1 deletion cmd/auth_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Exit code is 0 when authenticated, 1 otherwise.`,
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(true)
if err != nil {
printAuthStatus(authStatusOutput{
Authenticated: false,
Expand Down
2 changes: 1 addition & 1 deletion cmd/auth_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Examples:
return
}

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
fmt.Fprintln(os.Stderr, "Error: "+err.Error())
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cluster_debug_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var clusterDebugPodCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cluster_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var clusterDeployCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cluster_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var clusterInstallCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
utils.Capture(cmd)

tokenType, token, err := utils.GetAccessToken()
tokenType, token, err := utils.GetAccessToken(false)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
Expand Down
Loading
Loading