github.com/cloudfoundry-community/cloudfoundry-cli@v6.44.1-0.20240130060226-cda5ed8e89a5+incompatible/integration/helpers/client_credentials.go (about)

     1  package helpers
     2  
     3  import (
     4  	"os"
     5  
     6  	. "github.com/onsi/ginkgo"
     7  )
     8  
     9  func SkipIfClientCredentialsNotSet() (string, string) {
    10  	privateClientID := os.Getenv("CF_INT_CLIENT_ID")
    11  	privateClientSecret := os.Getenv("CF_INT_CLIENT_SECRET")
    12  
    13  	if privateClientID == "" || privateClientSecret == "" {
    14  		Skip("CF_INT_CLIENT_ID or CF_INT_CLIENT_SECRET is not set")
    15  	}
    16  
    17  	return privateClientID, privateClientSecret
    18  }
    19  
    20  func SkipIfCustomClientCredentialsNotSet() (string, string) {
    21  	customClientID := os.Getenv("CF_INT_CUSTOM_CLIENT_ID")
    22  	customClientSecret := os.Getenv("CF_INT_CUSTOM_CLIENT_SECRET")
    23  
    24  	if customClientID == "" || customClientSecret == "" {
    25  		Skip("CF_INT_CUSTOM_CLIENT_ID or CF_INT_CUSTOM_CLIENT_SECRET is not set")
    26  	}
    27  
    28  	return customClientID, customClientSecret
    29  }