Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lutece
lutece-build-plugin-releaser
Commits
f0655d15
Commit
f0655d15
authored
Nov 25, 2020
by
Francois Merlin
Browse files
Modify call to github search api for using token
parent
ae9d43ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/java/fr/paris/lutece/plugins/releaser/util/ConstanteUtils.java
View file @
f0655d15
...
...
@@ -120,7 +120,8 @@ public class ConstanteUtils
/** The Constant PROPERTY_GITHUB_SEARCH_REPO_API. */
public
static
final
String
PROPERTY_GITHUB_SEARCH_REPO_API
=
"releaser.githubSearchRepoApi"
;
/** The Constant PROPERTY_NB_SEARCH_ITEM_PER_PAGE_LOAD. */
public
static
final
String
PROPERTY_GITHUB_SEARCH_REPO_API_TOKEN
=
"releaser.githubSearchRepoApiToken"
;
/** The Constant PROPERTY_MAVEN_LOCAL_REPOSITORY. */
public
static
final
String
PROPERTY_MAVEN_LOCAL_REPOSITORY
=
"releaser.mavenLocalRepository"
;
...
...
@@ -159,6 +160,9 @@ public class ConstanteUtils
/** The Constant PROPERTY_NB_SEARCH_ITEM_PER_PAGE_LOAD. */
public
static
final
String
PROPERTY_NB_SEARCH_ITEM_PER_PAGE_LOAD
=
"releaser.nbSearchItemPerPageLoad"
;
/** The Constant PROPERTY_URL_JIRA_SERVICE. */
public
static
final
String
PROPERTY_URL_JIRA_SERVICE
=
"releaser.urlJiraService"
;
...
...
src/java/fr/paris/lutece/plugins/releaser/util/github/GitUtils.java
View file @
f0655d15
...
...
@@ -7,9 +7,12 @@ import java.net.URLEncoder;
import
java.text.MessageFormat
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.collections.map.HashedMap
;
import
org.apache.commons.lang.StringUtils
;
import
org.eclipse.jgit.api.CloneCommand
;
import
org.eclipse.jgit.api.CreateBranchCommand.SetupUpstreamMode
;
...
...
@@ -444,7 +447,11 @@ public class GitUtils
try
{
strResponse
=
httpAccess
.
doGet
(
strUrl
,
new
BasicAuthorizationAuthenticator
(
strUserName
,
strPassword
),
null
);
String
strApiToken
=
AppPropertiesService
.
getProperty
(
ConstanteUtils
.
PROPERTY_GITHUB_SEARCH_REPO_API_TOKEN
);
Map
<
String
,
String
>
mapHeaderToken
=
new
HashMap
<
String
,
String
>();
mapHeaderToken
.
put
(
"Authorization"
,
"token "
+
strApiToken
);
strResponse
=
httpAccess
.
doGet
(
strUrl
,
null
,
null
,
mapHeaderToken
);
if
(
!
StringUtils
.
isEmpty
(
strResponse
)
)
{
...
...
webapp/WEB-INF/conf/plugins/releaser.properties
View file @
f0655d15
...
...
@@ -39,6 +39,7 @@ releaser.gitlabReleaseAccount.password=
releaser.localComponentBasePath
=
releaser.githubSearchRepoApi
=
https://api.github.com/search/repositories?q={0}+org:{1}
releaser.githubSearchRepoApiToken
=
releaser.nbSearchItemPerPageLoad
=
10
releaser.urlJiraService
=
https://dev.lutece.paris.fr/jira/
releaser.component.jiraSearchQuery
=
project = {0} AND fixVersion in ({1}) AND status in (Open,Reopened,
\"
In Progress
\"
,
\"
To Do
\"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment