• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kcl-lang / kpm / 33355443416
47%
main: 47%

Build:
Build:
LAST BUILD BRANCH: fix/login-plaintext-put-769
DEFAULT BRANCH: main
Ran 31 Aug 2026 04:00AM UTC
Jobs 1
Files 78
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

31 Aug 2026 03:56AM UTC coverage: 46.794% (+0.2%) from 46.569%
33355443416

Pull #768

github

Peefy
feat(auth): refresh provider-minted OCI credentials on pull

`kpm login --provider=gcp` (PR #766) writes a short-lived OAuth
token to the ORAS credential store. On subsequent pulls, ORAS sees
that cached token directly and has no idea it came from GCP — so it
fails silently after ~1h when the token expires.

This PR wires the OCI client through a dynamic
[remoteauth.CredentialFunc] that ORAS re-enters on every 401. A new
sidecar `providers.json` maps `host -> provider` so a follow-up
`kpm pull` knows to mint a fresh credential via the matching
`auth.Provider` instead of reading the stale ORAS-stored token.

Changes:
- pkg/auth/store.go — small JSON sidecar store with atomic writes,
  lazy load, and sync.RWMutex concurrency.
- pkg/auth/resolve.go — Resolver that consults ProviderStore first
  and falls back to the ORAS credentials.Store.
- pkg/oci/oci.go — new WithCredentialFunc option; WithCredential
  preserved for backwards compatibility (CredentialFunc wins if
  both are passed).
- pkg/downloader/credential.go — CredStore.Resolver() exposes the
  sidecar+fallback chain as an auth.CredentialFunc.
- pkg/downloader/downloader.go — both OCI client call sites now use
  credentialOptionFor(...) which returns the right option based on
  whether credsStore is set, and rejects empty hostName (matching
  the previous behaviour of CredStore.Credential).
- pkg/checker/checker.go — SumChecker.GetCredentialFunc() so the
  manifest fetch uses dynamic resolution.
- pkg/client/{client,push}.go — KpmClient.CredentialFunc() so push
  uses dynamic resolution too.
- pkg/cmd/cmd_login.go — after a non-basic login, record
  host -> providerName in the sidecar so subsequent pulls know
  which provider to invoke.
- pkg/cmd/cmd_logout.go — best-effort: also drop the host from the
  sidecar so post-logout pulls fall back to anonymous / static.

Why a sidecar instead of extending config.json: ORAS owns
config.json and would happily overwrite any extra fields it does
not under... (continued)
Pull Request #768: feat(auth): refresh provider-minted OCI credentials on pull

131 of 222 new or added lines in 10 files covered. (59.01%)

16 existing lines in 4 files now uncovered.

5175 of 11059 relevant lines covered (46.79%)

0.53 hits per line

Uncovered Changes

Lines Coverage ∆ File
25
65.89
-15.84% pkg/cmd/cmd_login.go
14
84.44
pkg/auth/store.go
13
0.0
0.0% pkg/cmd/cmd_logout.go
12
38.85
0.65% pkg/downloader/downloader.go
9
71.88
pkg/auth/resolve.go
9
0.0
0.0% pkg/downloader/credential.go
5
32.52
0.6% pkg/oci/oci.go
2
67.08
-3.89% pkg/checker/checker.go
2
80.71
-0.63% pkg/client/client.go

Coverage Regressions

Lines Coverage ∆ File
7
59.81
-3.27% pkg/settings/settings.go
6
67.08
-3.89% pkg/checker/checker.go
2
38.85
0.65% pkg/downloader/downloader.go
1
0.0
0.0% pkg/downloader/credential.go
Jobs
ID Job ID Ran Files Coverage
1 33355443416.1 31 Aug 2026 04:00AM UTC 78
46.79
GitHub Action Run
Source Files on build 33355443416
  • Tree
  • List 78
  • Changed 10
  • Source Changed 0
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #768
  • PR Base - main (#33316638711)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc