Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,11 @@ type TokenSource struct {
// authentication related utils

func (ts *TokenSource) GenerateTokenV2() (*SecretStruct, error) {
destination := oauthv2.DestinationInfo{
WorkspaceID: ts.WorkspaceID,
DefinitionName: ts.DestinationDefName,
ID: ts.DestinationID,
}
refreshTokenParams := oauthv2.RefreshTokenParams{
WorkspaceID: ts.WorkspaceID,
DestDefName: ts.DestinationDefName,
AccountID: ts.AccountID,
Destination: &destination,
WorkspaceID: ts.WorkspaceID,
DestDefName: ts.DestinationDefName,
AccountID: ts.AccountID,
DestinationID: ts.DestinationID,
}
statusCode, authResponse, err := ts.OauthClientV2.FetchToken(&refreshTokenParams)
if err != nil && authResponse != nil {
Expand Down
10 changes: 5 additions & 5 deletions services/oauth/v2/http/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (t *OAuthTransport) postRoundTrip(rts *roundTripState) *http.Response {
return rts.res
}
rts.refreshTokenParams.Secret = oldSecret
rts.refreshTokenParams.Destination = rts.destination
rts.refreshTokenParams.DestinationID = rts.destination.ID
_, authResponse, refErr := t.oauthHandler.RefreshToken(rts.refreshTokenParams)
if refErr != nil {
interceptorResp.Response = refErr.Error()
Expand Down Expand Up @@ -289,10 +289,10 @@ func (t *OAuthTransport) RoundTrip(req *http.Request) (*http.Response, error) {
return httpResponseCreator(http.StatusInternalServerError, []byte(err.Error())), nil
}
rts.refreshTokenParams = &oauth.RefreshTokenParams{
AccountID: rts.accountID,
WorkspaceID: rts.destination.WorkspaceID,
DestDefName: rts.destination.DefinitionName,
Destination: rts.destination,
AccountID: rts.accountID,
WorkspaceID: rts.destination.WorkspaceID,
DestDefName: rts.destination.DefinitionName,
DestinationID: rts.destination.ID,
}
rts.req = req
preRoundTripStartTime := time.Now()
Expand Down
2 changes: 1 addition & 1 deletion services/oauth/v2/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (h *OAuthHandler) GetTokenInfo(refTokenParams *RefreshTokenParams, logTypeN
log := h.Logger.Withn(
logger.NewStringField("Call Type", logTypeName),
logger.NewStringField("AccountId", refTokenParams.AccountID),
obskit.DestinationID(refTokenParams.Destination.ID),
obskit.DestinationID(refTokenParams.DestinationID),
obskit.WorkspaceID(refTokenParams.WorkspaceID),
obskit.DestinationType(refTokenParams.DestDefName),
)
Expand Down
Loading
Loading