private OkHttpClient clientWithOpenShiftOAuthInterceptor(OkHttpClient httpClient) { httpClient = httpClient.newBuilder().authenticator(Authenticator.NONE).build(); OkHttpClient.Builder builder = httpClient.newBuilder(); builder.interceptors().clear(); return builder.addInterceptor(new OpenShiftOAuthInterceptor(httpClient, OpenShiftConfig.wrap(getConfiguration()))) .addInterceptor(new ImpersonatorInterceptor(getConfiguration())) .addInterceptor(new BackwardsCompatibilityInterceptor()) .build(); }
}).addInterceptor(new ImpersonatorInterceptor(config)) .addInterceptor(new BackwardsCompatibilityInterceptor());
private OkHttpClient clientWithOpenShiftOAuthInterceptor(OkHttpClient httpClient) { httpClient = httpClient.newBuilder().authenticator(Authenticator.NONE).build(); OkHttpClient.Builder builder = httpClient.newBuilder(); builder.interceptors().clear(); return builder.addInterceptor(new OpenShiftOAuthInterceptor(httpClient, OpenShiftConfig.wrap(getConfiguration()))) .addInterceptor(new ImpersonatorInterceptor(getConfiguration())) .addInterceptor(new BackwardsCompatibilityInterceptor()) .build(); }
private OpenShiftClient createOC(Config config) { OkHttpClient clientHttpClient = getHttpClient().newBuilder().authenticator(Authenticator.NONE).build(); OkHttpClient.Builder builder = clientHttpClient.newBuilder(); builder.interceptors().clear(); clientHttpClient = builder .addInterceptor( new OpenShiftOAuthInterceptor(clientHttpClient, OpenShiftConfig.wrap(config))) .addInterceptor(new ImpersonatorInterceptor(config)) .build(); return new UnclosableOpenShiftClient(clientHttpClient, config); }