-
Notifications
You must be signed in to change notification settings - Fork 155
Extended URI Schemes #685
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
Extended URI Schemes #685
Conversation
eee2fe3
to
7951281
Compare
440e7c6
to
5fe36c1
Compare
if ( isRoutingScheme( scheme ) ) | ||
{ | ||
return createRoutingDriver( securityPlan, address, connectionPool, eventExecutorGroup, routingSettings, retryLogic, metricsProvider, config ); | ||
} | ||
else if ( !isRoutingScheme( scheme ) ) | ||
{ | ||
case BOLT_URI_SCHEME: | ||
assertNoRoutingContext( uri, routingSettings ); | ||
return createDirectDriver( securityPlan, address, connectionPool, retryLogic, metricsProvider, config ); | ||
case BOLT_ROUTING_URI_SCHEME: | ||
return createRoutingDriver( securityPlan, address, connectionPool, eventExecutorGroup, routingSettings, retryLogic, metricsProvider, config ); | ||
default: | ||
throw new ClientException( format( "Unsupported URI scheme: %s", scheme ) ); | ||
} | ||
throw new ClientException( format( "Unsupported URI scheme: %s", scheme ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha. I am not fooled by these lines :D
If-else should be good enough here as we've validated the scheme Scheme.validateScheme( uri.getScheme() );
.
if( isRoutingScheme(scheme) ){...}
else {...}
b93ed99
to
351168a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good. Just a suggestion to simplify the code.
} | ||
} | ||
|
||
private SecurityPlan createSecurityPlanFromScheme( String scheme ) throws GeneralSecurityException, IOException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify this method as:
if ( isHighTrustScheme(scheme) )
{
return SecurityPlanImpl.forSystemCASignedCertificates( trustStrategy.isHostnameVerificationEnabled() );
}
else
{
return SecurityPlanImpl.forAllCertificates( trustStrategy.isHostnameVerificationEnabled() );
}
We've already checked isSecurityScheme
and assertSecuritySettingsNotUserConfigured
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of course! I will update this now
…" and "neo4j+ssc" to allow encryption and trust settings to be configurable using the URI.
351168a
to
5f13b09
Compare
This PR makes encryption and trust settings configurable using the URI.
We introduce 4 additional schemes:
bolt+s
andneo4j+s
which enables encryption and configures the trust settings to use the local system's certificate storebolt+ssc
andneo4j+ssc
which configures trust to use all certificates