-
Notifications
You must be signed in to change notification settings - Fork 102
OIDC Logic Isolation and Backward Compatibility Improvements #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
stderr: 'boom', | ||
}; | ||
(getExecOutput as jest.Mock).mockResolvedValueOnce(mockOutput); | ||
it('should correctly set step outputs for CLI token exchange', async (): Promise<void> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a difference between this test and the one above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we have a test to make sure we export the steps output with CLI exchange or manual exchange.
They have different flow
f9599c1
to
1c2dd3b
Compare
npm run format
for formatting the code before submitting the pull request.🎯 Purpose
This PR introduces a major refactor to the
setup-jfrog-cli
action to improve readability, testability, and backward compatibility around OpenID Connect (OIDC) authentication. The core goal is to isolate OIDC logic from general utility logic, while ensuring older CLI versions continue to work without regressions.💡 Motivation
Previously, we relied on
jf c add
with OIDC parameters. However, this approach does not expose the required step outputs (oidc-user
,oidc-token
) that users depend on for downstream authentication flows (e.g.,docker login
,helm repo add
, etc.).To solve this:
jf eot
internally to exchange the OIDC token and manually set the access token in configuration.Implementing this flow cleanly across CLI versions required isolating the OIDC logic, which led to a broader refactor to reduce complexity and overhead.
✅ What's Included
🧱 Codebase Structure Refactor
oidc-utils.ts
utils.ts
(core reusable logic)jobsummary-utils.ts
(markdown/summary formatting)types.ts
(centralized interfaces)🔐 OIDC Token Exchange Flow
jf eot
if CLI version ≥2.75.0
2.75.0
oidc-user
oidc-token
JFROG_CLI_USAGE_CONFIG_OIDC
JFROG_CLI_USAGE_OIDC_USED
🧪 Improved Test Coverage
utils.spec.ts
oidc-utils.spec.ts
jobsummary-utils.spec.ts
🧬 Integration Workflow Overhaul
oidc-integration-test.yml
ubuntu
,macos
,windows
2.74.1
,2.75.0
,latest
JFROG_PLATFORM_URL
jf rt ping
oidc-user
andoidc-token
outputs.
in CLI versions with-
)🔍 Why This Matters