Skip to content

Add ability to override OSS Index server URL#1

Open
brianf wants to merge 1 commit intomainfrom
feature/allow-ossindex-url-override
Open

Add ability to override OSS Index server URL#1
brianf wants to merge 1 commit intomainfrom
feature/allow-ossindex-url-override

Conversation

@brianf
Copy link

@brianf brianf commented Jan 22, 2026

Summary

This PR adds the ability for users to override the default OSS Index server URL with a custom URL. Previously, the URL was hardcoded to https://ossindex.sonatype.org with no convenient way to change it.

Changes

  • Added SetOSSIndexURL() method to Configuration struct
  • Added comprehensive test coverage for the new functionality
  • Updated README with usage examples and documentation

Use Cases

This feature enables:

  • Using custom OSS Index instances (e.g., enterprise deployments)
  • Testing against local or staging environments
  • Routing requests through proxies or gateways

Usage Example

configuration := ossindex.NewConfiguration()
configuration.SetOSSIndexURL("https://custom.ossindex.example.com")
apiClient := ossindex.NewAPIClient(configuration)

Test plan

  • All existing tests pass
  • New tests added for SetOSSIndexURL() functionality
  • Tests cover default behavior, custom URLs, localhost, and IP addresses
  • Backward compatibility maintained

🤖 Generated with Claude Code

This change adds the ability for users to override the default OSS Index
server URL (https://ossindex.sonatype.org) with a custom URL. This is
useful for:
- Using custom OSS Index instances
- Testing against local or staging environments
- Routing requests through proxies or gateways

Changes:
- Added SetOSSIndexURL() method to Configuration struct in configuration.go
- Added comprehensive test coverage in test/configuration_test.go
- Updated README.md with usage examples and documentation

All existing tests continue to pass, ensuring backward compatibility.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@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.

1 participant