Skip to content

Conversation

@brianf
Copy link

@brianf brianf commented Jan 22, 2026

Summary

This PR adds the ability for users to override the default OSS Index URL, enabling support for custom/enterprise OSS Index servers.

Changes Made

  • New helper function: Added get_ossindex_url() with priority-based configuration:

    1. Direct parameter (highest priority)
    2. OSSINDEX_URL environment variable
    3. Url field in ~/.ossindex/.oss-index-config
    4. Default OSS Index URL (fallback)
  • Updated all audit functions to accept optional ossindex_url parameter:

    • audit()
    • audit_installed_r_pkgs()
    • audit_description()
    • audit_renv_lock()
    • audit_req_txt()
    • audit_conda()
    • expect_secure()
  • Updated call_oss_index() to use the configurable URL

  • Comprehensive tests added to tests/testthat/test-get_token.R:

    • Default URL behavior
    • Custom URL via parameter
    • Custom URL via environment variable
    • Parameter precedence over environment variable
  • Documentation updates:

    • Updated README.Rmd with usage examples
    • Added entry to NEWS.md

Usage Examples

Via parameter:

audit_installed_r_pkgs(ossindex_url = "https://custom.ossindex.org/api/v3/component-report")

Via environment variable:

Sys.setenv(OSSINDEX_URL = "https://custom.ossindex.org/api/v3/component-report")
audit_installed_r_pkgs()

Via config file (~/.ossindex/.oss-index-config):

ossi:
   Username: your@email.com
   Token: your-token
   Url: https://custom.ossindex.org/api/v3/component-report

Testing

  • Unit tests added and will be verified by CI
  • Follows the same pattern as the existing token configuration

Related

This implements the same URL override capability that exists in other Sonatype OSS Index tools (e.g., auditjs), ensuring consistency across the ecosystem.

🤖 Generated with Claude Code

- Add get_ossindex_url() helper function with fallback priority:
  1. Parameter (highest priority)
  2. OSSINDEX_URL environment variable
  3. Url field in ~/.ossindex/.oss-index-config
  4. Default https://ossindex.sonatype.org/api/v3/component-report
- Add ossindex_url parameter to all audit functions:
  - audit()
  - audit_installed_r_pkgs()
  - audit_description()
  - audit_renv_lock()
  - audit_req_txt()
  - audit_conda()
  - expect_secure()
- Update call_oss_index() to use configurable URL
- Add comprehensive tests for URL override functionality
- Update README.Rmd with usage examples
- Update NEWS.md with feature announcement

This allows users to point to custom OSS Index servers for
enterprise deployments or testing purposes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@brianf brianf requested a review from a team as a code owner January 22, 2026 20:04
@paul-botsco-2-0 paul-botsco-2-0 bot added the 😧 commits missing verification Some commits are not signed - this must be resolved label Jan 22, 2026
@paul-botsco-2-0
Copy link

Thanks for the contribution. Unfortunately some of your commits don't meet our standards. All commits must be signed and have author information set.

The commits to review are:

See Signed Commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

😧 commits missing verification Some commits are not signed - this must be resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants