Skip to content

Commit 2cc8707

Browse files
committed
Update the documentation with the new features
1 parent 5344d31 commit 2cc8707

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed

docs/modules/ROOT/pages/developer-reference.adoc

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,41 @@ The injected `DynamicGraphQLClient` instance is authenticated as an installation
343343
`DynamicGraphQLClient` is a dynamic SmallRye GraphQL client.
344344
You can find more information about the SmallRye GraphQL client https://quarkus.io/guides/smallrye-graphql-client[here] and https://github.com/smallrye/smallrye-graphql[here].
345345

346-
== Configuration Reference
346+
== Webhook events
347347

348-
The Quarkus GitHub App extension exposes the following configuration properties:
348+
While Quarkus GitHub App was primarily designed as a tool to develop GitHub Apps,
349+
it is also possible to use it to handle your webhook requests.
349350

350-
include::includes/quarkus-github-app.adoc[]
351+
It will take care of all the ceremony of authenticating the requests and will save you a lot of boilerplate.
352+
353+
There are a few differences though:
354+
355+
- You will have to use `@RawEvent` to listen to the events and get the raw JSON of the payload.
356+
- Webhook requests don't provide an installation id so we can't initialize an installation GitHub client nor a GraphQL client.
357+
358+
The default `GitHub` REST client instance that can be injected is an application client and has so few permissions that it is not really useful.
359+
360+
While it could be a major inconvenience, we present a nice feature dedicated to this use case in the following section.
361+
362+
== Providing a personal access token
363+
364+
When using Quarkus GitHub App, in most cases, the REST and GraphQL clients provided by the installation are what you are looking for:
365+
they have the permissions allowed for this GitHub App and it should be enough to do what your GitHub App has been designed for.
366+
367+
However, there are corner cases where you might need a client with additional permissions,
368+
the most common one is when you deal with webhooks as presented in the previous section.
369+
370+
For this situation, you can define a personal access token by using the `quarkus.github-app.personal-access-token` configuration property.
371+
The personal access token provided in this property will be used to initialize:
372+
373+
- an authenticated `GitHub` REST client
374+
- an authenticated `DynamicGraphQL` GraphQL client
375+
376+
These clients will be automatically injected in your methods when injecting clients *if the payload doesn't provide an installation id*
377+
(if it does provide one, the regular installation clients will be injected).
378+
379+
It is also possible to directly obtain the clients authenticated with the personal access token by injecting the `TokenGitHubClients` CDI bean.
380+
It provides methods to get the authenticated REST and GraphQL clients.
351381

352382
== Credentials provider
353383

@@ -389,6 +419,12 @@ public class MyGitHubCustomizer implements GitHubCustomizer {
389419
}
390420
----
391421

422+
== Configuration Reference
423+
424+
The Quarkus GitHub App extension exposes the following configuration properties:
425+
426+
include::includes/quarkus-github-app.adoc[]
427+
392428
== Architecture Overview
393429

394430
image::architecture.png[Architecture]

docs/modules/ROOT/pages/includes/attributes.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:quarkus-version: 3.13.2
1+
:quarkus-version: 3.13.3
22
:quarkus-github-app-version: 2.6.0
33

44
:github-api-javadoc-root-url: https://github-api.kohsuke.org/apidocs/org/kohsuke/github

0 commit comments

Comments
 (0)