René's URL Explorer Experiment


Title: Question: How to cache installation tokens? · Issue #57 · spotify/github-java-client · GitHub

Open Graph Title: Question: How to cache installation tokens? · Issue #57 · spotify/github-java-client

X Title: Question: How to cache installation tokens? · Issue #57 · spotify/github-java-client

Description: The readme says: The client will manage the generation of JWT tokens, as well as requesting and caching the installation tokens from GitHub. I see that there is a hash map for the installation tokens, but I couldn't figure out how to mak...

Open Graph Description: The readme says: The client will manage the generation of JWT tokens, as well as requesting and caching the installation tokens from GitHub. I see that there is a hash map for the installation toke...

X Description: The readme says: The client will manage the generation of JWT tokens, as well as requesting and caching the installation tokens from GitHub. I see that there is a hash map for the installation toke...

Opengraph URL: https://github.com/spotify/github-java-client/issues/57

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Question: How to cache installation tokens?","articleBody":"The readme says:\r\n\u003e The client will manage the generation of JWT tokens, as well as requesting **and caching the installation tokens** from GitHub.\r\n\r\nI see that there is a [hash map for the installation tokens](https://github.com/spotify/github-java-client/blob/v0.0.25/src/main/java/com/spotify/github/v3/clients/GitHubClient.java#L121), but I couldn't figure out how to make the client object remember more than one token.\r\n\r\nHere is what I tried to do:\r\n1. create a new github client instance with the private key and app id combo\r\n2. periodically (1 minute) Iterate through a list of repositories that are all under the same installation\r\n  2.1. get the installation id for the repository with:\r\n         ```\r\n         client.createRepositoryClient(owner, repo).createGithubAppClient().getInstallation().get().id()\r\n         ```\r\n  2.2 use `GitHubClient.scopeForInstallationId(...)` to authenticate as an installation and this is where the library checks for the installation token and I see the following in the logs `Github token for installation 14XXXXXX is either expired or null. Trying to get a new one.` for every repository in every iteration.\r\n\r\nAfter looking at the code, I'm not sure how the caching should work when the `scopeForInstallationId(...)` returns a new `GitHubClient` instance so I assume the hash map with the installation tokens will be empty.\r\n\r\nI'm not very good with java so my assumption is I'm doing something wrong, can you give me some pointers?","author":{"url":"https://github.com/bbaga","@type":"Person","name":"bbaga"},"datePublished":"2021-04-15T09:17:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/57/github-java-client/issues/57"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:244ef4b1-951a-24aa-7f7b-e7fe48ffeaf6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC6E8:1D9B97:E5DBD0A:12938066:6977101C
html-safe-nonce8deffe1789699eaf71d0f207728b975f8a9b0a755ab1c59b6c675fbb6fff5e35
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkU4OjFEOUI5NzpFNURCRDBBOjEyOTM4MDY2OjY5NzcxMDFDIiwidmlzaXRvcl9pZCI6IjI4NDU2MzUyMTM3MDg5NTU2NzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac41f4a6af1cf8bfa266cbccde27ec9591f078d302d966fac9b5f9c4d692a5706d
hovercard-subject-tagissue:858678719
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/spotify/github-java-client/57/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b5974e2953ee298932508545dc9e9c3c51d7c9e290ae231c8d12293074eade0c/spotify/github-java-client/issues/57
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b5974e2953ee298932508545dc9e9c3c51d7c9e290ae231c8d12293074eade0c/spotify/github-java-client/issues/57
og:image:altThe readme says: The client will manage the generation of JWT tokens, as well as requesting and caching the installation tokens from GitHub. I see that there is a hash map for the installation toke...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebbaga
hostnamegithub.com
expected-hostnamegithub.com
None01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef752335dbbea672610081196a1998e39aec5e14b
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/spotify/github-java-client/issues/57#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%2Fissues%2F57
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%2Fissues%2F57
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=spotify%2Fgithub-java-client
Reloadhttps://patch-diff.githubusercontent.com/spotify/github-java-client/issues/57
Reloadhttps://patch-diff.githubusercontent.com/spotify/github-java-client/issues/57
Reloadhttps://patch-diff.githubusercontent.com/spotify/github-java-client/issues/57
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
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/spotify/github-java-client/issues/57
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/spotify/github-java-client/issues/57
Question: How to cache installation tokens?https://patch-diff.githubusercontent.com/spotify/github-java-client/issues/57#top
https://github.com/bbaga
https://github.com/bbaga
bbagahttps://github.com/bbaga
on Apr 15, 2021https://github.com/spotify/github-java-client/issues/57#issue-858678719
hash map for the installation tokenshttps://github.com/spotify/github-java-client/blob/v0.0.25/src/main/java/com/spotify/github/v3/clients/GitHubClient.java#L121
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.