mirror of
https://github.com/turbot/steampipe.git
synced 2026-01-25 03:01:19 -05:00
28 lines
754 B
Go
28 lines
754 B
Go
package cloud
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/spf13/viper"
|
|
steampipecloud "github.com/turbot/steampipe-cloud-sdk-go"
|
|
"github.com/turbot/steampipe/pkg/constants"
|
|
)
|
|
|
|
func newSteampipeCloudClient(token string) *steampipecloud.APIClient {
|
|
// Create a default configuration
|
|
configuration := steampipecloud.NewConfiguration()
|
|
configuration.Host = viper.GetString(constants.ArgCloudHost)
|
|
|
|
// Add your Steampipe Cloud user token as an auth header
|
|
if token != "" {
|
|
configuration.AddDefaultHeader("Authorization", fmt.Sprintf("Bearer %s", token))
|
|
}
|
|
|
|
// Create a client
|
|
return steampipecloud.NewAPIClient(configuration)
|
|
}
|
|
|
|
func getLoginTokenConfirmUIUrl() string {
|
|
return fmt.Sprintf("https://%s/login/token", viper.GetString(constants.ArgCloudHost))
|
|
|
|
}
|