Skip to content
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

Use indy-client 3.4.0-SNAPSHOT #2445

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

<!-- commonjava/redhat projects -->
<indyModelVersion>1.5</indyModelVersion>
<indyClientVersion>3.3.3</indyClientVersion>
<indyClientVersion>3.4.0-SNAPSHOT</indyClientVersion>
<atlasVersion>1.1.1</atlasVersion>
<galleyVersion>1.16</galleyVersion>
<weftVersion>1.22</weftVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.commonjava.indy.client.core.auth.IndyClientAuthenticator;
import org.commonjava.indy.client.core.module.IndyStoreQueryClientModule;
import org.commonjava.indy.client.core.module.IndyStoresClientModule;
import org.commonjava.indy.client.core.o11y.trace.ClientTracerConfiguration;
import org.commonjava.indy.model.core.io.IndyObjectMapper;
import org.commonjava.indy.subsys.trace.config.IndyTraceConfiguration;
import org.commonjava.indy.subsys.service.config.RepositoryServiceConfig;
Expand Down Expand Up @@ -69,14 +70,25 @@ public void init()
Collection<IndyClientModule> modules =
Arrays.asList( new IndyStoresClientModule(), new IndyStoreQueryClientModule() );


try
{

final Indy.Builder builder = Indy.builder()
.setLocation( config )
.setObjectMapper( new IndyObjectMapper( Collections.emptySet() ) )
.setExistedTraceConfig( indyTraceConfig )
.setMdcCopyMappings( Collections.emptyMap() )
.setModules( modules.toArray( new IndyClientModule[0] ) );
if ( indyTraceConfig != null && indyTraceConfig.isEnabled() )
{
ClientTracerConfiguration clientTracerConfig = new ClientTracerConfiguration();
clientTracerConfig.setEnabled( true );
clientTracerConfig.setConsoleTransport( indyTraceConfig.isConsoleTransport() );
clientTracerConfig.setGrpcHeaders( indyTraceConfig.getGrpcHeaders() );
clientTracerConfig.setGrpcUri( indyTraceConfig.getGrpcEndpointUri() );
clientTracerConfig.setGrpcResources( indyTraceConfig.getResources() );
builder.setTraceConfiguration( clientTracerConfig );
}
if ( serviceConfig.isAuthEnabled() )
{
IndyClientAuthenticator authenticator =
Expand All @@ -85,13 +97,14 @@ public void init()
serviceConfig.getKeycloakClientId(),
serviceConfig.getKeycloakClientSecret(),
serviceConfig.getRefreshTokenTimeSkew() );
client = builder.setAuthenticator( authenticator ).build();
builder.setAuthenticator( authenticator );
}
else
{
client = builder.setPasswordManager( new MemoryPasswordManager() ).build();
builder.setPasswordManager( new MemoryPasswordManager() );
}

client = builder.build();
}
catch ( IndyClientException e )
{
Expand Down
Loading