File tree Expand file tree Collapse file tree 4 files changed +59
-5
lines changed
docs/modules/ROOT/pages/includes
runtime/src/main/java/io/quarkiverse/githubapp/runtime Expand file tree Collapse file tree 4 files changed +59
-5
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,40 @@ endif::add-copy-button-to-env-var[]
127127|`https://api.github.com`
128128
129129
130+ a| [[quarkus-github-app_quarkus.github-app.rest-api-endpoint]]`link:#quarkus-github-app_quarkus.github-app.rest-api-endpoint[quarkus.github-app.rest-api-endpoint]`
131+
132+ [.description]
133+ --
134+ The REST API endpoint.
135+ Defaults to the public github.com instance REST API endpoint.
136+
137+ ifdef::add-copy-button-to-env-var[]
138+ Environment variable: env_var_with_copy_button:+++QUARKUS_GITHUB_APP_REST_API_ENDPOINT+++ []
139+ endif::add-copy-button-to-env-var[]
140+ ifndef::add-copy-button-to-env-var[]
141+ Environment variable: `+++QUARKUS_GITHUB_APP_REST_API_ENDPOINT+++`
142+ endif::add-copy-button-to-env-var[]
143+ -- |string
144+ |`${quarkus.github-app.instance-endpoint}`
145+
146+
147+ a| [[quarkus-github-app_quarkus.github-app.graphql-api-endpoint]]`link:#quarkus-github-app_quarkus.github-app.graphql-api-endpoint[quarkus.github-app.graphql-api-endpoint]`
148+
149+ [.description]
150+ --
151+ The GraphQL API endpoint.
152+ Defaults to the public github.com instance GraphQL endpoint.
153+
154+ ifdef::add-copy-button-to-env-var[]
155+ Environment variable: env_var_with_copy_button:+++QUARKUS_GITHUB_APP_GRAPHQL_API_ENDPOINT+++ []
156+ endif::add-copy-button-to-env-var[]
157+ ifndef::add-copy-button-to-env-var[]
158+ Environment variable: `+++QUARKUS_GITHUB_APP_GRAPHQL_API_ENDPOINT+++`
159+ endif::add-copy-button-to-env-var[]
160+ -- |string
161+ |`${quarkus.github-app.instance-endpoint}/graphql`
162+
163+
130164a| [[quarkus-github-app_quarkus.github-app.debug.payload-directory]]`link:#quarkus-github-app_quarkus.github-app.debug.payload-directory[quarkus.github-app.debug.payload-directory]`
131165
132166[.description]
Original file line number Diff line number Diff line change @@ -82,8 +82,12 @@ public Optional<String> webhookProxyUrl() {
8282 return gitHubAppRuntimeConfig .webhookProxyUrl ;
8383 }
8484
85- public String instanceEndpoint () {
86- return gitHubAppRuntimeConfig .instanceEndpoint ;
85+ public String restApiEndpoint () {
86+ return gitHubAppRuntimeConfig .restApiEndpoint ;
87+ }
88+
89+ public String graphqlApiEndpoint () {
90+ return gitHubAppRuntimeConfig .graphqlApiEndpoint ;
8791 }
8892
8993 public Debug debug () {
Original file line number Diff line number Diff line change @@ -64,6 +64,22 @@ public class GitHubAppRuntimeConfig {
6464 @ ConfigItem (defaultValue = "https://api.github.com" )
6565 String instanceEndpoint ;
6666
67+ /**
68+ * The REST API endpoint.
69+ * <p>
70+ * Defaults to the public github.com instance REST API endpoint.
71+ */
72+ @ ConfigItem (defaultValue = "${quarkus.github-app.instance-endpoint}" )
73+ String restApiEndpoint ;
74+
75+ /**
76+ * The GraphQL API endpoint.
77+ * <p>
78+ * Defaults to the public github.com instance GraphQL endpoint.
79+ */
80+ @ ConfigItem (defaultValue = "${quarkus.github-app.instance-endpoint}/graphql" )
81+ String graphqlApiEndpoint ;
82+
6783 /**
6884 * Debug configuration.
6985 */
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ private GitHub createInstallationClient(long installationId) throws IOException
120120
121121 final GitHubBuilder gitHubBuilder = new GitHubBuilder ()
122122 .withAppInstallationToken (installationToken .getToken ())
123- .withEndpoint (checkedConfigProvider .instanceEndpoint ());
123+ .withEndpoint (checkedConfigProvider .restApiEndpoint ());
124124
125125 GitHub gitHub = gitHubBuilder .build ();
126126
@@ -135,7 +135,7 @@ private DynamicGraphQLClient createInstallationGraphQLClient(long installationId
135135 CachedInstallationToken installationToken = installationTokenCache .get (installationId );
136136
137137 DynamicGraphQLClient graphQLClient = DynamicGraphQLClientBuilder .newBuilder ()
138- .url (checkedConfigProvider .instanceEndpoint () + "/graphql" )
138+ .url (checkedConfigProvider .graphqlApiEndpoint () )
139139 .header (AUTHORIZATION_HEADER , String .format (AUTHORIZATION_HEADER_BEARER , installationToken .getToken ()))
140140 .build ();
141141
@@ -187,7 +187,7 @@ private GitHub createApplicationGitHub() {
187187 try {
188188 final GitHubBuilder gitHubBuilder = new GitHubBuilder ()
189189 .withJwtToken (jwtToken )
190- .withEndpoint (checkedConfigProvider .instanceEndpoint ());
190+ .withEndpoint (checkedConfigProvider .restApiEndpoint ());
191191
192192 return gitHubBuilder .build ();
193193 } catch (IOException e ) {
You can’t perform that action at this time.
0 commit comments