8000 MavenClient's "WithoutRegistries" method removes authentication data from client · Issue #815 · google/osv-scalibr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
MavenClient's "WithoutRegistries" method removes authentication data from client #815
Closed
@shuaiscott

Description

@shuaiscott

// WithoutRegistries makes MavenRegistryAPIClient including its cache but not registries.
func (m *MavenRegistryAPIClient) WithoutRegistries() *MavenRegistryAPIClient {
return &MavenRegistryAPIClient{
defaultRegistry: m.defaultRegistry,
localRegistry: m.localRegistry,
mu: m.mu,
cacheTimestamp: m.cacheTimestamp,
responses: m.responses,
}

Adding registryAuths to the WithoutRegistries() method fixes this:

// WithoutRegistries makes MavenRegistryAPIClient including its cache but not registries.
func (m *MavenRegistryAPIClient) WithoutRegistries() *MavenRegistryAPIClient {
	return &MavenRegistryAPIClient{
		defaultRegistry: m.defaultRegistry,
		localRegistry:   m.localRegistry,
		mu:              m.mu,
		cacheTimestamp:  m.cacheTimestamp,
		responses:       m.responses,
		registryAuths:   m.registryAuths,
	}
}

This is being used in OSV-Scanner for resolving parent dependencies and causes failures when using private maven repositories that require authentication.

Resolves other repo issue: google/osv-scanner#1930

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0