Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
508 commits
Select commit Hold shift + click to select a range
2e78dc5
Merge pull request #323 from jglick/bad-json
kohsuke Dec 17, 2016
6380cf9
Added a method to retrieve the actual bytes of BLOB
kohsuke Dec 17, 2016
e6ee278
Another version that directly reads BLOB without going through an int…
kohsuke Dec 17, 2016
2d7d4bb
Merge pull request #320 with some additional changes
kohsuke Dec 17, 2016
88d52c4
Recording parent GHRepository
kohsuke Dec 17, 2016
11651da
not always a blob, for example it could be a tree.
kohsuke Dec 17, 2016
b5386a3
Defining better traversal methods for apps that walk trees
kohsuke Dec 17, 2016
a454fb1
Tree traversal from commit & its associated tests
kohsuke Dec 17, 2016
3a66e90
Fixed issue #319
kohsuke Dec 17, 2016
3217728
Fixed issue #317
kohsuke Dec 17, 2016
3dbb516
[maven-release-plugin] prepare release github-api-1.82
kohsuke Dec 17, 2016
a746a31
[maven-release-plugin] prepare for next development iteration
kohsuke Dec 17, 2016
470da06
Cleaning up javadoc warnings
kohsuke Dec 17, 2016
26c20a7
add branch protection attributes
Dec 22, 2016
9d03435
Expose Rate Limit Headers
stephenc Jan 5, 2017
dfea424
Expose the API url used by the GitHub
stephenc Jan 5, 2017
6fcddf4
Some usage patterns require more pro-active rate limit queries
stephenc Jan 5, 2017
1266dcc
Merge pull request #327 from stephenc/expose-rate-limit-headers
kohsuke Jan 9, 2017
1212ae3
Touch up for uniformity
kohsuke Jan 10, 2017
198fede
Merge pull request #325
kohsuke Jan 10, 2017
6bfeb54
Just exposing permission type enum until there's more to this relatio…
kohsuke Jan 10, 2017
d1c900a
Marking the fact that these APIs are still in preview and subject to …
kohsuke Jan 10, 2017
5b69a29
Merge pull request #324
kohsuke Jan 10, 2017
911e8d2
Made the test case runnable, at least for me
kohsuke Jan 10, 2017
13184e7
[maven-release-plugin] prepare release github-api-1.83
kohsuke Jan 10, 2017
17d1994
[maven-release-plugin] prepare for next development iteration
kohsuke Jan 10, 2017
b9b6f4f
INFO level logging is harmful as it's reported to stdout by default
kohsuke Jan 10, 2017
6cad4a3
static import for conciseness
kohsuke Jan 10, 2017
a3a715c
[maven-release-plugin] prepare release github-api-1.84
kohsuke Jan 10, 2017
4ee3086
[maven-release-plugin] prepare for next development iteration
kohsuke Jan 10, 2017
f2e7b40
Correct algebra in #327
stephenc Jan 10, 2017
1f4325e
Merge pull request #329 from stephenc/patch-1
kohsuke Jan 17, 2017
75f0c08
Fix a bug in the Javadocs (due to copy and paste)
sebkur Jan 23, 2017
5b15600
Add 'Preview' support for MergeMethod on GHPullRequest
greggian Jan 28, 2017
fafe6b0
Remove unused imports
sebkur Feb 9, 2017
429b26c
Ignore eclipse files
sebkur Feb 9, 2017
55b00a8
Set 1.6 level. I'm not so old.
KostyaSha Feb 10, 2017
be081ee
Inject responce headers in GHObject and Exceptions.
KostyaSha Feb 10, 2017
166e26d
add latest release
kamontat Feb 19, 2017
fd85981
fixed indent, rename to getLastestRelease
kamontat Feb 20, 2017
1cffea8
add test
kamontat Feb 20, 2017
5554332
add return null if latest release not found
kamontat Feb 20, 2017
2627dc5
Ensure that connections are closed for error responses
stephenc Feb 23, 2017
0374d2d
Merge pull request #346 from stephenc/close-the-connections
kohsuke Feb 27, 2017
3d03659
[maven-release-plugin] prepare release github-api-1.85
kohsuke Mar 1, 2017
e9b59c6
[maven-release-plugin] prepare for next development iteration
kohsuke Mar 1, 2017
64af13f
Add the Commit search API (still in preview)
mdeverdelhan Mar 30, 2017
44d4d0d
Add support for PR reviews preview
stephenc Mar 30, 2017
c9b5074
Fix the wrapping of retrieved commits (owner/repository)
mdeverdelhan May 11, 2017
3a40af8
[JENKINS-36240] /repos/:owner/:repo/collaborators/:username/permissio…
jglick Jun 12, 2017
cb76203
[JENKINS-45142] Retry connections after getting SocketTimeoutException.
jglick Jun 28, 2017
0f21eba
Merge pull request #359 from jglick/SocketTimeoutException-JENKINS-45142
kohsuke Jun 29, 2017
46715ca
[maven-release-plugin] prepare release github-api-1.86
kohsuke Jul 3, 2017
f2fe8ea
[maven-release-plugin] prepare for next development iteration
kohsuke Jul 3, 2017
b537f99
issue #360: Add support for committing multiple files
siordache Jul 7, 2017
8d1b44d
Add ping hook method
KostyaSha Jul 9, 2017
4abe870
Add missing event types used by repository webhooks
PauloMigAlmeida Jul 14, 2017
971ae1f
Merge branch 'master' into pr-merge-method
greggian Jul 18, 2017
e90c86e
Remove Preview status, merge_method is now out of preview
greggian Jul 18, 2017
6dcbace
Added getViews method to GHRepository.
adw1n Aug 1, 2017
8accf07
Changed timestamp (GHRepositoryViews.DayViews.timestamp) field type f…
adw1n Aug 1, 2017
a1819bf
Added getClones method to GHRepository (https://developer.github.com/…
adw1n Aug 1, 2017
7396395
- updated ignore entries for eclipse/moc os
jgangemi Aug 8, 2017
23cd51a
- improved branch protection support
jgangemi Aug 8, 2017
cfe4c0c
Merge remote-tracking branch 'upstream/master' into synchro-api
mmitche Aug 29, 2017
f2a2ad9
Switch to a concurrent hash map
mmitche Aug 29, 2017
9dabec1
Add basic support for tag objects
stephenc Sep 1, 2017
29b5357
Merge pull request #358 from jglick/no-preview-JENKINS-36240
kohsuke Sep 8, 2017
e67fbb4
Merge pull request #362 from KostyaSha/pingHook
kohsuke Sep 8, 2017
4d277cc
Merge pull request #352 from stephenc/pr-reviews
kohsuke Sep 8, 2017
7ceca07
Merge pull request #363 from PauloMigAlmeida/master
kohsuke Sep 8, 2017
2e2813f
Merge pull request #343 from kamontat/feature/latest-release
kohsuke Sep 8, 2017
ee8973c
Merge pull request #338 from sebkur/ignore-eclipse-files
kohsuke Sep 8, 2017
5c9cbee
Merge pull request #332 from sebkur/fix_javadoc
kohsuke Sep 8, 2017
46b89a4
Merge Pull request #369
kohsuke Sep 8, 2017
2f8c399
Restored signature of the previous enableProtection() method
kohsuke Sep 8, 2017
cda27d5
This field should be still final
kohsuke Sep 8, 2017
240bcab
Merge pull request #351
kohsuke Sep 8, 2017
612139f
Merge pull request #375 from stephenc/tag-object-support
kohsuke Sep 8, 2017
8dd6dbf
getRef never returns null
kohsuke Sep 8, 2017
3e295b6
Merge branch 'master' of github.com:kohsuke/github-api
kohsuke Sep 8, 2017
df9faf4
Auto-retry flaky tests
kohsuke Sep 8, 2017
aebbe86
Keeping findbugs happy
kohsuke Sep 9, 2017
ad28ca4
Use string constant like other previews
kohsuke Sep 9, 2017
336924e
[maven-release-plugin] prepare release github-api-1.87
kohsuke Sep 9, 2017
b0c51e0
[maven-release-plugin] prepare for next development iteration
kohsuke Sep 9, 2017
ea8df9b
javadoc fix
kohsuke Sep 9, 2017
5ed8a34
[maven-release-plugin] prepare release github-api-1.88
kohsuke Sep 9, 2017
57c36f4
[maven-release-plugin] prepare for next development iteration
kohsuke Sep 9, 2017
9af8112
Tightening up access control and use primitive type
kohsuke Sep 9, 2017
2c80ef1
Capture commonality between total and daily
kohsuke Sep 9, 2017
fb47067
Naming changes to emphasize that these are just traffic info
kohsuke Sep 9, 2017
be49eb2
Merge pull request #368
kohsuke Sep 9, 2017
bbc2f39
Proper access control modifier
kohsuke Sep 9, 2017
9cf6ee7
Pointless string conversion
kohsuke Sep 9, 2017
f3a3b87
Defined entry points
kohsuke Sep 9, 2017
2b6f37a
Merge pull request #361
kohsuke Sep 9, 2017
8928a8a
Content type should be JSON by default when sending JSON.
kohsuke Sep 9, 2017
b0f2a87
Merge pull request #337
kohsuke Sep 9, 2017
17edd33
Reorganized imports following #337
kohsuke Sep 9, 2017
635350c
Additional naming consistency change
kohsuke Sep 9, 2017
e6ad9fe
Keeping Findbugs happy
kohsuke Sep 9, 2017
f721e05
Added convenience connector for OkHttp3
kohsuke Sep 9, 2017
fe2af19
Unused constant
kohsuke Sep 9, 2017
9012820
Massage the signature a bit.
kohsuke Sep 9, 2017
ccfe3ad
Merge pull request #333
kohsuke Sep 9, 2017
353f9bb
pointless null check since the with method already does it
kohsuke Sep 9, 2017
d8f4bc7
Added updater
kohsuke Sep 9, 2017
2d3557e
Improved the intern logic
kohsuke Sep 9, 2017
20e68d5
Merge pull request #283
kohsuke Sep 9, 2017
40fb38a
Window focus problem
kohsuke Sep 9, 2017
6178d38
connector usage is unsynchronized
kohsuke Sep 9, 2017
92caf98
Reverting java1.6 change which I assume is accidental.
kohsuke Sep 9, 2017
692dccf
Massaging the change a bit
kohsuke Sep 9, 2017
d3ed8ea
Merge pull request #339
kohsuke Sep 9, 2017
60bfea2
Bug fix
kohsuke Sep 9, 2017
47409a9
[maven-release-plugin] prepare release github-api-1.89
kohsuke Sep 9, 2017
d440471
[maven-release-plugin] prepare for next development iteration
kohsuke Sep 9, 2017
b443e86
Added lock/unlock op and additional properties
kohsuke Sep 10, 2017
09c2b39
bridge-method-annotation should be an optional dep.
jglick Sep 13, 2017
ae1ec8b
Roles for team members
amberovsky Sep 20, 2017
0f81d1d
Add support for pr review/review comment events
mattnelson Oct 5, 2017
7735ede
extend id from int to long
Oct 23, 2017
6415785
boyscout: updated dependencies
Oct 23, 2017
40d8f4a
Fixed OAuth connection to enterprise API
Oct 24, 2017
46dce17
Fixed Typo
Oct 24, 2017
569fa06
Labels: add method to update color
batmat Oct 25, 2017
e94ba74
Convention is to call these methods setXyz. Plus doc
kohsuke Oct 28, 2017
9b0ace2
Merge pull request #390
kohsuke Oct 28, 2017
4849619
None of the connectToEnterprise methods are preferrable so document a…
kohsuke Oct 28, 2017
e675435
Merge pull request #389
kohsuke Oct 28, 2017
b6063dd
Restored binary compatibility
kohsuke Oct 28, 2017
ab3d9e8
A little better version of the bridge method
kohsuke Oct 28, 2017
83c2c4e
Fixed the broken design of how GHDeploymentStatus get exposed.
kohsuke Oct 28, 2017
cc2e60c
Merge pull request #388
kohsuke Oct 28, 2017
60c9ba8
Updated tests
kohsuke Oct 28, 2017
0b069df
Pick up the version that fixes int->long adaption
kohsuke Oct 28, 2017
2b7c524
[maven-release-plugin] prepare release github-api-1.90
kohsuke Oct 28, 2017
e25ae27
[maven-release-plugin] prepare for next development iteration
kohsuke Oct 28, 2017
ab24e6e
Add get for all orgs
Oct 30, 2017
35ba267
Revert wildcard usage for imports
Oct 30, 2017
ab6253c
[fix] GHPerson: check if root is null
Rechi Nov 9, 2017
c80b8f6
Add GHIssue#setMilestone
mizoguche Nov 16, 2017
15991fd
PullRequest review state and event do not have same values
sns-seb Nov 30, 2017
fa16261
position of pr comment can be null and original_position is not parsed
sns-seb Nov 30, 2017
892d305
add Requester#with override for long value
sns-seb Jan 8, 2018
6961c46
create review comment reply from GHPullRequest
sns-seb Dec 1, 2017
e74346f
support create PR review in single API call & remove @Preview
sns-seb Dec 4, 2017
df861f5
Adding methods to GHCreateRepositoryBuilder to allow setting the allo…
notanother Jan 10, 2018
6effd4b
Merge pull request #396 from Rechi/fixGHPersonNullPointer
kohsuke Jan 12, 2018
e66f71c
Merge pull request #407 from notsudo/GHCreateRepositoryBuilder_Add_Me…
kohsuke Jan 13, 2018
d0b4652
Replace "new Error" with GHException
bjoernhaeuser Nov 20, 2017
a17ce04
Adjustment to compensate
kohsuke Jan 13, 2018
41c028d
Merge pull request #401
kohsuke Jan 13, 2018
f3a1272
Merge pull request #397 from mizoguche/set-milestone
kohsuke Jan 13, 2018
43075fa
By convention we use "listXyz" method names
kohsuke Jan 13, 2018
5430f3d
Merge pull request #391
kohsuke Jan 13, 2018
7f52031
Merge branch 'master' of github.com:kohsuke/github-api
kohsuke Jan 13, 2018
6599605
Massaged changes to follow the convention
kohsuke Jan 13, 2018
70bd4fa
Merge pull request #379
kohsuke Jan 13, 2018
1e497d2
Merge branch 'master' into bridge-method-annotation
kohsuke Jan 13, 2018
4e31636
Allow the caller to wait for the mergeable state to change.
kohsuke Jan 13, 2018
5113aac
Issue #403: Typo in method name
kohsuke Jan 13, 2018
0f7c160
Based on issue #399, adjusting the behaviour.
kohsuke Jan 13, 2018
acbf286
Massaged the changes
kohsuke Jan 13, 2018
d0a56db
Merge pull request #406
kohsuke Jan 13, 2018
f41da19
Further restoration of the compatibility
kohsuke Jan 13, 2018
f2bb6a0
Merge pull request #384
kohsuke Jan 13, 2018
e10b747
Re-retried the object.
kohsuke Jan 13, 2018
188245f
[maven-release-plugin] prepare release github-api-1.91
kohsuke Jan 13, 2018
cdf6f18
[maven-release-plugin] prepare for next development iteration
kohsuke Jan 13, 2018
0e5ffda
Release failed due to javadoc errors
kohsuke Jan 13, 2018
24e288d
[maven-release-plugin] prepare release github-api-1.92
kohsuke Jan 13, 2018
192e21a
[maven-release-plugin] prepare for next development iteration
kohsuke Jan 13, 2018
3503ff6
Additional methods for issue comment
kohsuke Jan 21, 2018
e7b76bf
Doc improvements
kohsuke Jan 21, 2018
8b38a20
Update commons-lang to 3.7
Jan 23, 2018
75918c5
Add GHRepository.getRelease and GHRepository.getReleaseByTagName
Feb 5, 2018
2497ac6
fix issues
Feb 14, 2018
5874389
Added release payload.
Feb 22, 2018
f0f6a99
OkHttpConnector: Enforce use of TLSv1.2 to match current Github
randomvariable Feb 28, 2018
5dfd621
Merge pull request #420 from randomvariable/fix/tlsv12
kohsuke Mar 1, 2018
e233aee
Merge pull request #410 from Limess/409/update-commons-lang
kohsuke Mar 1, 2018
9cc400a
Fixes #421 - Enum case doesn't match for Pull Request Reviews
ggrell Mar 2, 2018
1b04d47
Added support for previous_filename for file details in PR.
itepikin-smartling Mar 22, 2018
a24ac37
Added request reviewers function within GHPullRequest.
Mar 29, 2018
db89697
[fix] fetch labels with HTTP GET method
Rechi Apr 6, 2018
9d99ee9
Merge pull request #430 from twcurrie/tcurrie/requestReviewer
kohsuke May 1, 2018
363064f
Merge branch 'master' of github.com:kohsuke/github-api
kohsuke May 1, 2018
86f868b
Fixed compilation errors introduced by 8b38a20c1849606103dd4f676d5c27…
kohsuke May 1, 2018
4dce173
Extracted the List<GHUser>->List<String> out to Requester for reuse
kohsuke May 1, 2018
f2ed7c1
Looks like the permission scheme changed on jenkinsci/violations-plugin
kohsuke May 1, 2018
1961836
Merge pull request #427 from itepikin-smartling/master
kohsuke May 1, 2018
d50ae63
Merge pull request #431 from Rechi/fixPRLabels
kohsuke May 1, 2018
bb7302c
Merge branch 'master' of github.com:kohsuke/github-api
kohsuke May 1, 2018
33d9422
Merge pull request #422 from ggrell/fix-421-enum-case-issue
kohsuke May 1, 2018
7d294ee
Looks like release rollback didn't quite complete
kohsuke May 1, 2018
38b77a9
[maven-release-plugin] prepare release github-api-1.93
kohsuke May 1, 2018
d61697a
[maven-release-plugin] prepare for next development iteration
kohsuke May 1, 2018
1145941
- add support for signed commits
jgangemi May 27, 2018
ca6d77c
- remove unthrown IOException
jgangemi May 28, 2018
fe5ea52
[feature] implement Repository Invitations API
Rechi May 29, 2018
eacdd7a
- added overloaded 'uploadAsset' method
jgangemi May 30, 2018
fd37a2c
Add support for repository searching by "topic"
l3ender Jun 6, 2018
943f47d
Add sha1 to updateFiles see
onoguera-ob Mar 15, 2018
f68a850
Update integration test.
onoguera-ob Mar 15, 2018
2fcfb2f
address review comments in supporting updating content with sha
sbabu-salesforce Jun 13, 2018
e368a17
Adds the GHEventPayload.Issue class
Arrow768 Jul 1, 2018
0ffcbdb
Fix pagination for APIs that supported it ad hoc
daniel-beck Jul 17, 2018
c309c2c
Fix for issue #426. Fix null pointer when deleting refs.
martinvanzijl Aug 9, 2018
b2b7dfa
Massaged the change to match the existing API design convention
kohsuke Aug 30, 2018
3fa70ac
doc improvement
kohsuke Aug 30, 2018
ddc27e8
Let's not yet expose this new class because it's not final
kohsuke Aug 30, 2018
29a40d3
TAB -> space
kohsuke Aug 30, 2018
c988df1
Use a short form
kohsuke Aug 30, 2018
5e36377
It appears LOKI preview is done and all those methods are now final
kohsuke Aug 30, 2018
9afd1c5
Merge pull request #435
kohsuke Aug 30, 2018
7bf23ea
Merge pull request #436 from jgangemi/jae/rm-exception
kohsuke Aug 30, 2018
3b2802e
minor doc improvement
kohsuke Aug 30, 2018
92a015c
Clear up import statements
kohsuke Aug 30, 2018
b5086c7
Merge pull request #437
kohsuke Aug 30, 2018
c413fc1
Merge pull request #438 from jgangemi/jae/issue-434
kohsuke Aug 30, 2018
7fc2d9d
Merge remote-tracking branch 'origin/master'
kohsuke Aug 30, 2018
ca55947
Merge pull request #439 from l3ender/master
kohsuke Aug 30, 2018
4b799d2
Merge pull request #443 from Arrow768/GHEventPayload_Issue
kohsuke Aug 30, 2018
53612ad
Merge pull request #446 from daniel-beck/fix-page-size
kohsuke Aug 30, 2018
1ca6535
Merge pull request #449 from martinvanzijl/issue_426_fix_nullptr_when…
kohsuke Aug 30, 2018
3cfcad7
Merge pull request #417 from twcurrie/tcurrie/revisions
kohsuke Aug 30, 2018
4f17d35
Merge pull request #411 from tadfisher/master
kohsuke Aug 30, 2018
cbfe72a
Fixed a broken test
kohsuke Aug 30, 2018
863995c
findbugs warning fix
kohsuke Aug 30, 2018
ee4d514
close an opened stream
kohsuke Aug 30, 2018
c44e5d2
findbugs fix
kohsuke Aug 30, 2018
5194a36
[maven-release-plugin] prepare release github-api-1.94
kohsuke Aug 30, 2018
c8b0584
[maven-release-plugin] prepare for next development iteration
kohsuke Aug 30, 2018
1c4b716
Add methods for adding/removing labels to GHIssue
evenh Oct 1, 2018
9381471
add request reviewers as attribute of GHPullRequest
XericWei Oct 11, 2018
70251ea
Fix memory leak.
KostyaSha Oct 20, 2018
1012dcd
Added archived attribute in GHRepository. Updated the parent POM
recena Oct 25, 2018
8e85bf8
Merge pull request #470 from recena/archived-attr
kohsuke Oct 29, 2018
9345d3b
Follow the convention in this library
kohsuke Nov 6, 2018
a6f3e7d
Merge pull request #464
kohsuke Nov 6, 2018
3ad66f8
Merge pull request #468 from KostyaSha/fixMemLeak
kohsuke Nov 6, 2018
9a1bb09
Massaging the changes.
kohsuke Nov 6, 2018
24b998b
Merge pull request #461
kohsuke Nov 6, 2018
a380059
Merge branch 'master' of github.com:kohsuke/github-api
kohsuke Nov 6, 2018
40f012b
rtyler no longer has 50 people he follows
kohsuke Nov 6, 2018
c1bab63
[maven-release-plugin] prepare release github-api-1.95
kohsuke Nov 6, 2018
fad203a
[maven-release-plugin] prepare for next development iteration
kohsuke Nov 6, 2018
1a8355e
Merge branch 'master' into fix_version
bitwiseman May 17, 2019
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ target
*.iml
*.ipr
*.iws
.classpath
.project
.settings/
.DS_Store
95 changes: 81 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<parent>
<groupId>org.kohsuke</groupId>
<artifactId>pom</artifactId>
<version>14</version>
<version>20</version>
</parent>

<artifactId>github-api</artifactId>
<version>1.67</version>
<version>1.96-SNAPSHOT</version>
<name>GitHub API for Java</name>
<url>http://github-api.kohsuke.org/</url>
<description>GitHub API for Java</description>
Expand All @@ -16,7 +16,7 @@
<connection>scm:git:git@github.com/kohsuke/${project.artifactId}.git</connection>
<developerConnection>scm:git:ssh://git@github.com/kohsuke/${project.artifactId}.git</developerConnection>
<url>http://${project.artifactId}.kohsuke.org/</url>
<tag>github-api-1.67</tag>
<tag>HEAD</tag>
</scm>

<distributionManagement>
Expand All @@ -28,14 +28,44 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<findbugs-maven-plugin.version>3.0.2</findbugs-maven-plugin.version>
<findbugs-maven-plugin.failOnError>true</findbugs-maven-plugin.failOnError>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<rerunFailingTestsCount>2</rerunFailingTestsCount>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.15</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java15</artifactId>
<version>1.0</version>
</signature>
</configuration>
<executions>
<execution>
<id>ensure-java-1.5-class-library</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.infradna.tool</groupId>
<artifactId>bridge-method-injector</artifactId>
<version>1.14</version>
<version>1.18</version>
<executions>
<execution>
<goals>
Expand All @@ -44,14 +74,32 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>${findbugs-maven-plugin.version}</version>
<configuration>
<xmlOutput>true</xmlOutput>
<failOnError>${findbugs-maven-plugin.failOnError}</failOnError>
</configuration>
<executions>
<execution>
<id>run-findbugs</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
Expand All @@ -61,13 +109,19 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.3</version>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand All @@ -77,7 +131,8 @@
<dependency>
<groupId>com.infradna.tool</groupId>
<artifactId>bridge-method-annotation</artifactId>
<version>1.14</version>
<version>1.17</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.kohsuke.stapler</groupId>
Expand All @@ -88,27 +143,39 @@
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>3.1.0.201310021548-r</version>
<version>4.9.0.201710071750-r</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>okhttp-urlconnection</artifactId>
<version>2.0.0</version>
<version>2.7.5</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-urlconnection</artifactId>
<version>3.9.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>wordnet-random-name</artifactId>
<version>1.2</version>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
Expand Down
63 changes: 63 additions & 0 deletions src/main/java/org/kohsuke/github/AbuseLimitHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package org.kohsuke.github;

import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.HttpURLConnection;

/**
* Pluggable strategy to determine what to do when the API abuse limit is hit.
*
* @author Kohsuke Kawaguchi
* @see GitHubBuilder#withAbuseLimitHandler(AbuseLimitHandler)
* @see <a href="https://developer.github.com/v3/#abuse-rate-limits">documentation</a>
* @see RateLimitHandler
*/
public abstract class AbuseLimitHandler {
/**
* Called when the library encounters HTTP error indicating that the API abuse limit is reached.
*
* <p>
* Any exception thrown from this method will cause the request to fail, and the caller of github-api
* will receive an exception. If this method returns normally, another request will be attempted.
* For that to make sense, the implementation needs to wait for some time.
*
* @see <a href="https://developer.github.com/v3/#abuse-rate-limits">API documentation from GitHub</a>
* @param e
* Exception from Java I/O layer. If you decide to fail the processing, you can throw
* this exception (or wrap this exception into another exception and throw it.)
* @param uc
* Connection that resulted in an error. Useful for accessing other response headers.
*/
public abstract void onError(IOException e, HttpURLConnection uc) throws IOException;

/**
* Wait until the API abuse "wait time" is passed.
*/
public static final AbuseLimitHandler WAIT = new AbuseLimitHandler() {
@Override
public void onError(IOException e, HttpURLConnection uc) throws IOException {
try {
Thread.sleep(parseWaitTime(uc));
} catch (InterruptedException _) {
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
}
}

private long parseWaitTime(HttpURLConnection uc) {
String v = uc.getHeaderField("Retry-After");
if (v==null) return 60 * 1000; // can't tell, return 1 min

return Math.max(1000, Long.parseLong(v)*1000);
}
};

/**
* Fail immediately.
*/
public static final AbuseLimitHandler FAIL = new AbuseLimitHandler() {
@Override
public void onError(IOException e, HttpURLConnection uc) throws IOException {
throw (IOException)new IOException("Abust limit reached").initCause(e);
}
};
}
4 changes: 4 additions & 0 deletions src/main/java/org/kohsuke/github/DeleteToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@
*/
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

/**
* @author Kohsuke Kawaguchi
*/
@SuppressFBWarnings(value = "UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD",
justification = "Being constructed by JSON deserialization")
class DeleteToken {
public String delete_token;
}
17 changes: 17 additions & 0 deletions src/main/java/org/kohsuke/github/EnforcementLevel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.kohsuke.github;

import java.util.Locale;

/**
* This was added during preview API period but it has changed since then.
*
* @author Kohsuke Kawaguchi
*/
@Deprecated
public enum EnforcementLevel {
OFF, NON_ADMINS, EVERYONE;

public String toString() {
return name().toLowerCase(Locale.ENGLISH);
}
}
26 changes: 24 additions & 2 deletions src/main/java/org/kohsuke/github/GHAuthorization.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.net.URL;
import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
Expand Down Expand Up @@ -35,9 +36,14 @@ public class GHAuthorization extends GHObject {
private GitHub root;
private List<String> scopes;
private String token;
private String token_last_eight;
private String hashed_token;
private App app;
private String note;
private String note_url;
private String fingerprint;
//TODO add some user class for https://developer.github.com/v3/oauth_authorizations/#check-an-authorization ?
//private GHUser user;

public GitHub getRoot() {
return root;
Expand All @@ -51,6 +57,14 @@ public String getToken() {
return token;
}

public String getTokenLastEight() {
return token_last_eight;
}

public String getHashedToken() {
return hashed_token;
}

public URL getAppUrl() {
return GitHub.parseURL(app.url);
}
Expand All @@ -59,6 +73,8 @@ public String getAppName() {
return app.name;
}

@SuppressFBWarnings(value = "NM_CONFUSING",
justification = "It's a part of the library API, cannot be changed")
public URL getApiURL() {
return GitHub.parseURL(url);
}
Expand All @@ -79,14 +95,20 @@ public URL getNoteUrl() {
return GitHub.parseURL(note_url);
}

public String getFingerprint() {
return fingerprint;
}

/*package*/ GHAuthorization wrap(GitHub root) {
this.root = root;
return this;
}


@SuppressFBWarnings(value = {"UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD"},
justification = "JSON API")
private static class App {
private String url;
private String name;
// private String client_id; not yet used
}
}
Loading