-
Notifications
You must be signed in to change notification settings - Fork 91
Git Gateway support for BitBucket #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
api/bitbucket.go
Outdated
} | ||
|
||
func rewriteLinksInBitBucketResponse(resp *http.Response, endpointAPIURL, proxyAPIURL string) error { | ||
body, err := ioutil.ReadAll(resp.Body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to correctly handle gzipped content - it currently causes an error if you request gzipped content.
api/bitbucket.go
Outdated
switch resp.Header.Get("Content-Encoding") { | ||
case "gzip": | ||
bodyReader, err = gzip.NewReader(resp.Body) | ||
defer bodyReader.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the defer
probably needs to go after checking the error.
api/bitbucket.go
Outdated
if err != nil { | ||
return err | ||
} | ||
w.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should go after w := szip.NewWriter
with a defer
api/bitbucket.go
Outdated
} | ||
|
||
newBody, err := json.Marshal(b) | ||
println(newBody) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this.
@calavera updated with requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
So do we have git gateway support with bitbucket ? |
- Summary
Adds BitBucket support to Git Gateway, including logic to refresh access tokens using a provided refresh token, OAuth client ID, and OAuth client secret.
This PR needs link rewriting added before it's merged.Link rewriting has been added.- Test plan
Tested manually.
- Description for the changelog
Git gateway support for BitBucket