Skip to content

Commit

Permalink
Merge branch 'trunk' into bug/TKP-9301_filter_function
Browse files Browse the repository at this point in the history
  • Loading branch information
esdagh committed Feb 9, 2024
2 parents 2f88bf0 + 3d51106 commit a6216bf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
2 changes: 2 additions & 0 deletions pkg/sfkafkalib/kafka/kafkaconsumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ func CreateKafkaConsumer(ctx context.Context, conf *configuration.ConsumerConfig
fmt.Println("CONSUMING MESSAGE: " + message.Key__c)
if err := handleFunc(ctx, message); err != nil {
log.Sugar().ErrorwContext(ctx, "error in kafka handler", zap.Error(err))
panic(message)
}
case err := <-errChan:
fmt.Println("ERROR")
log.Sugar().ErrorwContext(ctx, "error in kafka handler", zap.Error(err))
panic(err)
}
}
}(ctx, outChan, errChan)
Expand Down
6 changes: 0 additions & 6 deletions pkg/sfkafkalib/salesforce/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ type Authentication struct {
type ConnectionConfig struct {
LoginURL string // EG: "https://test.salesforce.com/services/oauth2/token"
ApiEndpoint string // EG: "/services/data/v56.0/"; In vault only version is saved, we need to add the rest of the endpoint
Username string // Integration user username
Password string // Integration user pw
Token string // Integration user security token
ClientId string // Connected app ClientID
ClientSecret string // Connected app ClientSecret
}
Expand All @@ -70,9 +67,6 @@ type AuthClient struct {
func CreateAuthClient(ctx context.Context, conf ConnectionConfig) (authClient *AuthClient, err error) {

authParams := url.Values{}
authParams.Set("grant_type", "password")
authParams.Set("username", conf.Username)
authParams.Set("password", fmt.Sprintf("%v%v", conf.Password, conf.Token))
oauth2Conf := &clientcredentials.Config{
ClientID: conf.ClientId,
ClientSecret: conf.ClientSecret,
Expand Down
12 changes: 0 additions & 12 deletions pkg/sfkafkalib/salesforce/connectionconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ func CreateSfConnConf(ctx context.Context, config configuration.ConsumerConfig,
if sfConnConf.ClientSecret == "" {
return nil, errors.New("Missing required connection config ClientSecret")
}
sfConnConf.Username = fmt.Sprint(secretMap["salesforce-username"])
if sfConnConf.Username == "" {
return nil, errors.New("Missing required connection config Username")
}
sfConnConf.Password = fmt.Sprint(secretMap["salesforce-password"])
if sfConnConf.Password == "" {
return nil, errors.New("Missing required connection config Password")
}
sfConnConf.Token = fmt.Sprint(secretMap["salesforce-security-token"])
if sfConnConf.Token == "" {
return nil, errors.New("Missing required connection config Token")
}

return sfConnConf, nil
}

0 comments on commit a6216bf

Please sign in to comment.