Skip to content

Commit 3678496

Browse files
authored
Merge pull request #1 from yug-elastic/generic_token_url
Add support for user given token URL
2 parents 633e946 + 5300d57 commit 3678496

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
Bayeux Client Protocol implemented in Golang (as specified by Salesforce Realtime API)
33

44
Fork from zph/bayeux:
5+
56
Changes to accept both 'payload' and 'sobject'.
67
All the channels (user-created or generic) should be accepted.
78
Make it so user will pass chan from main function then they can close it anytime.
8-
User can metioned replay mechanism from Channel method.
9+
User can mention replay mechanism from Channel method.
910

1011
# Usage
1112
See `examples/main.go`
@@ -15,7 +16,7 @@ package main
1516
import (
1617
"fmt"
1718

18-
bay "github.com/kush-elastic/bayeux"
19+
bay "github.com/elastic/bayeux"
1920
)
2021

2122
func Example() {

bayeux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,17 +239,17 @@ func (b *Bayeux) connect(out chan TriggerEvent) chan TriggerEvent {
239239
}
240240

241241
func GetSalesforceCredentials() Credentials {
242-
route := "https://login.salesforce.com/services/oauth2/token"
243242
clientID := mustGetEnv("SALESFORCE_CONSUMER_KEY")
244243
clientSecret := mustGetEnv("SALESFORCE_CONSUMER_SECRET")
245244
username := mustGetEnv("SALESFORCE_USER")
246245
password := mustGetEnv("SALESFORCE_PASSWORD")
246+
tokenURL := mustGetEnv("SALESFORCE_TOKEN_URL")
247247
params := url.Values{"grant_type": {"password"},
248248
"client_id": {clientID},
249249
"client_secret": {clientSecret},
250250
"username": {username},
251251
"password": {password}}
252-
res, err := http.PostForm(route, params)
252+
res, err := http.PostForm(tokenURL, params)
253253
if err != nil {
254254
logger.Fatal(err)
255255
}

examples/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
bay "github.com/kush-elastic/bayeux"
6+
bay "github.com/elastic/bayeux"
77
)
88

99
func Example() {

0 commit comments

Comments
 (0)