PILLUTLAAVINASH / google-enterprise-connector-manager

Automatically exported from code.google.com/p/google-enterprise-connector-manager
0 stars 0 forks source link

Connector instances can be used after being deleted #60

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a connector instance and index content.
2. Search for something that returns results.
3. Delete the connector instance from the Connectors page.
4. Clear the authorization cache from the Access Control page.
5. Perform the same search again.

What is the expected output? What do you see instead?

I expected the search results from the connector to be missing, because the 
authorization should 
have failed after the connector was deleted. But the authorization in step 5 
succeeds, and the 
connector results are shown again.

What version of the product are you using? On what operating system?

GSA 5.0.0.G.14, Connector Manager 1.0.2.

Please provide any additional information below.

I think the problem is in SpringInstantiator. The dropConnector method calls 
instanceMap.dropConnector, which removes the connector from the instance map. 
But all of the 
requests for the connector go through getConnectorInterfaces. The dropConnector 
method does 
not remove the connector from the connectorCache, so getConnectorInterfaces 
succeeds, 
without having to fallback to the instanceMap, where the lookup would fail.

Adding a call to connectorCache.remove(connectorName) to the end of 
dropConnector fixes the 
problem.

As a workaround, if you restart Tomcat or reload the web application after 
deleting the 
connector, then getConnectorInterfaces will throw a ConnectorNotFoundException 
as expected, 
and the authorization will fail, and no results will be shown for the deleted 
connector.

Another workaround is to force the user to be authenticated again. For example, 
if you restart 
your browser between steps 3 and 5, the GSA will not attempt to authenticate or 
authorize the 
user against the deleted connector, and no results will be shown from the 
deleted connector. In 
fact, the GSA might not even prompt for credentials in this case, if no other 
connectors were 
configured and no other secure content is indexed. This suggests that another 
possible 
improvement would be to drop the validated identity for the connector in the 
GSA when the 
connector is deleted.

P1; restarting Tomcat is not completely egregious, but the fix seems 
straightforward.

Original issue reported on code.google.com by jl1615@gmail.com on 20 Oct 2007 at 12:14

GoogleCodeExporter commented 8 years ago

Original comment by donald.z...@gmail.com on 18 Apr 2008 at 10:26

GoogleCodeExporter commented 8 years ago
Calling connectorCache.remove(connectorName) in dropConnector() does indeed fix 
the
problem.

Original comment by Brett.Mi...@gmail.com on 2 May 2008 at 2:50

GoogleCodeExporter commented 8 years ago
Fixed in revision r805 which also addresses issue 35 and issue 63 .

Original comment by Brett.Mi...@gmail.com on 25 May 2008 at 2:13

GoogleCodeExporter commented 8 years ago

Original comment by Brett.Mi...@gmail.com on 25 May 2008 at 2:18

GoogleCodeExporter commented 8 years ago

Original comment by mgron...@gmail.com on 19 Jun 2008 at 6:35