Skip to content

Update artifactory-oidc to extract existing settings.xml info - #20

Merged
kostasniktas merged 4 commits into
mainfrom
oidc_support_setupjava
Sep 11, 2026
Merged

Update artifactory-oidc to extract existing settings.xml info#20
kostasniktas merged 4 commits into
mainfrom
oidc_support_setupjava

Conversation

@kostasniktas

@kostasniktas kostasniktas commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Leveraging the setup-java action to set up your Maven Central server/creds causes an important ~/.m2/settings.xml file to be created. The Artifactory-OIDC actions blows away that file.

This PR adds support to Artifactory-OIDC action to pull relevant information from the existing settings.xml before generating its own. It only pulls out the XML children that setup-java, as of today, supports.

Code that generates settings.xml in the setup-java action: https://github.com/actions/setup-java/blob/273229181560643261a71a1544c22304f2a40df8/src/auth.ts#L276-L367

Tried it out over here: https://github.com/twilio/twilio-java/actions/runs/33680358222/job/100415155935

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Missing or failing xmllint can silently erase the configuration this change intends to preserve.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Preserves selected Maven settings when configuring Artifactory OIDC.

Changes:

  • Extracts existing servers, profiles, and active profiles.
  • Reinjects them into the generated Maven settings.
File summaries
File Description
artifactory-oidc/action.yml Extracts and passes existing Maven configuration.
artifactory-oidc/maven-settings.xml.tmpl Adds placeholders for preserved configuration.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread artifactory-oidc/action.yml

def main() -> None:
path, tag = sys.argv[1], sys.argv[2]
root = ET.parse(path).getroot()

@semgrep-code-twilio semgrep-code-twilio Bot Sep 2, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The native Python xml library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service. Do not use this library to parse untrusted input. Instead the Python documentation recommends using defusedxml.

🥳 Removed in commit 2e26cfc 🥳

@kostasniktas
kostasniktas merged commit c94e420 into main Sep 11, 2026
28 checks passed
@kostasniktas
kostasniktas deleted the oidc_support_setupjava branch September 11, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants