René's URL Explorer Experiment


Title: feat: Add repository-scoped token support to GithubAppClient by PhoebeMay · Pull Request #258 · spotify/github-java-client · GitHub

Open Graph Title: feat: Add repository-scoped token support to GithubAppClient by PhoebeMay · Pull Request #258 · spotify/github-java-client

X Title: feat: Add repository-scoped token support to GithubAppClient by PhoebeMay · Pull Request #258 · spotify/github-java-client

Description: Summary Adds support for creating repository-scoped installation access tokens via the GitHub Apps API. This allows tokens to be restricted to specific repositories instead of granting access to all repositories in an installation. This is an implementation of https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app API Usage // Create a scoped token for specific repositories AccessTokenRequest request = ImmutableAccessTokenRequest.builder() .repositoryIds(List.of(313604, 314195)) .build(); AccessToken token = appClient.getAccessToken(installationId, request).join(); // Or scope by repository name AccessTokenRequest request = ImmutableAccessTokenRequest.builder() .repositories(List.of("my-repo")) .build(); Testing Unit Tests All existing tests pass, plus 3 new test cases: ✅ getAccessTokenWithoutScoping - Verifies backward compatibility (empty body) ✅ getAccessTokenWithRepositoryScoping - Verifies scoped token creation with both repositories and repository_ids ✅ getAccessTokenWithEmptyRequest - Verifies empty request serializes to {} Manual Testing Verified end-to-end with GitHub Enterprise Server: Test 1: Unscoped Token (`Old Behavior) Created token using existing getAccessToken(installationId) method GithubAppClient appClient = client.createGithubAppClient(); AccessToken unscopedToken = appClient.getAccessToken(installationId).join(); Verification via GitHub API: curl -H 'Authorization: Bearer ' \ https://ghe.spotify.net/api/v3/installation/repositories Result: { "total_count": 9, "repository_count": 9, "repository_names": [ "genai-migration/honk", "genai-migration/migration-prompts", "genai-migration/update-metadata-shift", "genai-migration/ai-migrations", "genai-migration/trigger-agent", "genai-migration/goosebump", "genai-migration/honk-log-classifier", "genai-migration/demo-library", "genai-migration/honk-system" ] } ✅ Token granted access to all 9 repositories in the installation Test 2: Repository-Scoped Token (New Functionality) Created token using new getAccessToken(installationId, AccessTokenRequest) method: AccessTokenRequest request = ImmutableAccessTokenRequest.builder() .repositoryIds(List.of(313604)) .build(); Verification via GitHub API: curl -H 'Authorization: Bearer ' \ https://ghe.spotify.net/api/v3/installation/repositories Result: { "total_count": 1, "repository_count": 1, "repository_names": [ "genai-migration/honk" ], "repository_ids": [ 313604 ] } ✅ Token granted access to only 1 repository (the scoped repository)

Open Graph Description: Summary Adds support for creating repository-scoped installation access tokens via the GitHub Apps API. This allows tokens to be restricted to specific repositories instead of granting access to al...

X Description: Summary Adds support for creating repository-scoped installation access tokens via the GitHub Apps API. This allows tokens to be restricted to specific repositories instead of granting access to al...

Opengraph URL: https://github.com/spotify/github-java-client/pull/258

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:3508ca56-1027-ac28-e5bc-29383b18d8e0
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9BDE:10BDCB:12519AB:195F87F:69777316
html-safe-nonce374de95a1ed2cd2593379876ffad7a857adac0bc2dca806e08b91a0a2e793aea
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkRFOjEwQkRDQjoxMjUxOUFCOjE5NUY4N0Y6Njk3NzczMTYiLCJ2aXNpdG9yX2lkIjoiMTUxMTA1MDU1OTcxNDk4MDYzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9ecbe3b8ef89dfa70a1f322f5c6e8a1bb099390297e6303b5027b91ca800831f
hovercard-subject-tagpull_request:3068591226
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/spotify/github-java-client/pull/258/files
twitter:imagehttps://avatars.githubusercontent.com/u/13728765?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/13728765?s=400&v=4
og:image:altSummary Adds support for creating repository-scoped installation access tokens via the GitHub Apps API. This allows tokens to be restricted to specific repositories instead of granting access to al...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9fea6af76c6e24ca5c5728a18d4220d768790d04abe1ba6aafa18526daff96e7
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/spotify/github-java-client git https://github.com/spotify/github-java-client.git
octolytics-dimension-user_id251374
octolytics-dimension-user_loginspotify
octolytics-dimension-repository_id254401089
octolytics-dimension-repository_nwospotify/github-java-client
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id254401089
octolytics-dimension-repository_network_root_nwospotify/github-java-client
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release6c4a3fa336c0d96309887d0be819777cadd37121
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fspotify%2Fgithub-java-client%2Fpull%2F258%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fspotify%2Fgithub-java-client%2Fpull%2F258%2Ffiles
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=spotify%2Fgithub-java-client
Reloadhttps://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files
Reloadhttps://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files
Reloadhttps://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files
spotify https://patch-diff.githubusercontent.com/spotify
github-java-clienthttps://patch-diff.githubusercontent.com/spotify/github-java-client
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fspotify%2Fgithub-java-client
Fork 97 https://patch-diff.githubusercontent.com/login?return_to=%2Fspotify%2Fgithub-java-client
Star 148 https://patch-diff.githubusercontent.com/login?return_to=%2Fspotify%2Fgithub-java-client
Code https://patch-diff.githubusercontent.com/spotify/github-java-client
Issues 11 https://patch-diff.githubusercontent.com/spotify/github-java-client/issues
Pull requests 7 https://patch-diff.githubusercontent.com/spotify/github-java-client/pulls
Actions https://patch-diff.githubusercontent.com/spotify/github-java-client/actions
Security 0 https://patch-diff.githubusercontent.com/spotify/github-java-client/security
Insights https://patch-diff.githubusercontent.com/spotify/github-java-client/pulse
Code https://patch-diff.githubusercontent.com/spotify/github-java-client
Issues https://patch-diff.githubusercontent.com/spotify/github-java-client/issues
Pull requests https://patch-diff.githubusercontent.com/spotify/github-java-client/pulls
Actions https://patch-diff.githubusercontent.com/spotify/github-java-client/actions
Security https://patch-diff.githubusercontent.com/spotify/github-java-client/security
Insights https://patch-diff.githubusercontent.com/spotify/github-java-client/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2Fspotify%2Fgithub-java-client%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2Fspotify%2Fgithub-java-client%2Fissues%2Fnew%2Fchoose
dennisgranathhttps://patch-diff.githubusercontent.com/dennisgranath
masterhttps://patch-diff.githubusercontent.com/spotify/github-java-client/tree/master
repo-scoped-tokenhttps://patch-diff.githubusercontent.com/spotify/github-java-client/tree/repo-scoped-token
Conversation 3 https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258
Commits 1 https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/commits
Checks 5 https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/checks
Files changed https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files
Please reload this pagehttps://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files
feat: Add repository-scoped token support to GithubAppClient https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#top
Show all changes 1 commit https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files
0c37e52 Add repository-scoped token support to GithubAppClient PhoebeMay Dec 3, 2025 https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/commits/0c37e526652a48b0a18400ed79865d26579761f6
Clear filters https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files
Please reload this pagehttps://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files
Please reload this pagehttps://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files
AccessTokenRequest.java https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-3122057feed5e7f1377ede49f93e5cdade623c78fc99da23f739a39cd92edc02
GithubAppClient.java https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-ad7dc6ca15a4f4ce20c395fd53098fb983a3a4884b0f87981328cfc397665ec8
GithubAppClientTest.java https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-5b62c0c9a36c1a02d2cec6850b09a487a836fd282f74113041bbda53e7457648
access-token.json https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-23ff14b0b2a0af415ce52e091ed70ad0af01a74b132a03b5cec3355bbd675bc6
src/main/java/com/spotify/github/v3/apps/requests/AccessTokenRequest.javahttps://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-3122057feed5e7f1377ede49f93e5cdade623c78fc99da23f739a39cd92edc02
View file https://patch-diff.githubusercontent.com/spotify/github-java-client/blob/0c37e526652a48b0a18400ed79865d26579761f6/src/main/java/com/spotify/github/v3/apps/requests/AccessTokenRequest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/{{ revealButtonHref }}
src/main/java/com/spotify/github/v3/clients/GithubAppClient.javahttps://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-ad7dc6ca15a4f4ce20c395fd53098fb983a3a4884b0f87981328cfc397665ec8
View file https://patch-diff.githubusercontent.com/spotify/github-java-client/blob/0c37e526652a48b0a18400ed79865d26579761f6/src/main/java/com/spotify/github/v3/clients/GithubAppClient.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-ad7dc6ca15a4f4ce20c395fd53098fb983a3a4884b0f87981328cfc397665ec8
https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-ad7dc6ca15a4f4ce20c395fd53098fb983a3a4884b0f87981328cfc397665ec8
https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-ad7dc6ca15a4f4ce20c395fd53098fb983a3a4884b0f87981328cfc397665ec8
https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-ad7dc6ca15a4f4ce20c395fd53098fb983a3a4884b0f87981328cfc397665ec8
src/test/java/com/spotify/github/v3/clients/GithubAppClientTest.javahttps://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-5b62c0c9a36c1a02d2cec6850b09a487a836fd282f74113041bbda53e7457648
View file https://patch-diff.githubusercontent.com/spotify/github-java-client/blob/0c37e526652a48b0a18400ed79865d26579761f6/src/test/java/com/spotify/github/v3/clients/GithubAppClientTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-5b62c0c9a36c1a02d2cec6850b09a487a836fd282f74113041bbda53e7457648
https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-5b62c0c9a36c1a02d2cec6850b09a487a836fd282f74113041bbda53e7457648
https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-5b62c0c9a36c1a02d2cec6850b09a487a836fd282f74113041bbda53e7457648
src/test/resources/com/spotify/github/v3/githubapp/access-token.jsonhttps://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/files#diff-23ff14b0b2a0af415ce52e091ed70ad0af01a74b132a03b5cec3355bbd675bc6
View file https://patch-diff.githubusercontent.com/spotify/github-java-client/blob/0c37e526652a48b0a18400ed79865d26579761f6/src/test/resources/com/spotify/github/v3/githubapp/access-token.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/spotify/github-java-client/pull/258/{{ revealButtonHref }}
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.