Skip to content

Commit

Permalink
Bugfix: Update experiment engine Google client initialisation (#68)
Browse files Browse the repository at this point in the history
* Update experiment engine google client init

* Remove unused scope
  • Loading branch information
deadlycoconuts authored Mar 30, 2023
1 parent 0c31d9a commit 5a2f14c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions plugins/turing/manager/experiment_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
"github.com/caraml-dev/turing/engines/experiment/log"
"github.com/caraml-dev/turing/engines/experiment/manager"
inproc "github.com/caraml-dev/turing/engines/experiment/plugin/inproc/manager"
"github.com/gojek/mlp/api/pkg/auth"

xpclient "github.com/caraml-dev/xp/clients/management"
"github.com/caraml-dev/xp/common/api/schema"
common_mq_config "github.com/caraml-dev/xp/common/messagequeue"
_config "github.com/caraml-dev/xp/plugins/turing/config"
"github.com/caraml-dev/xp/treatment-service/config"
"github.com/go-playground/validator/v10"
"golang.org/x/oauth2/google"
)

func init() {
Expand Down Expand Up @@ -54,9 +54,6 @@ const xpExperimentConfigSchema = `[
]
]`

// Default scope for the Google Auth token used for the XP APIs
var googleOAuthScope = "https://www.googleapis.com/auth/userinfo.email"

// experimentManager implements manager.CustomExperimentManager interface
type experimentManager struct {
validate *validator.Validate
Expand Down Expand Up @@ -188,7 +185,7 @@ func NewExperimentManager(configData json.RawMessage) (manager.CustomExperimentM
}

// Create Google Client
googleClient, err := google.DefaultClient(context.Background(), googleOAuthScope)
googleClient, err := auth.InitGoogleClient(context.Background())
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 5a2f14c

Please sign in to comment.