PILLUTLAAVINASH / google-enterprise-connector-manager

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

ProductionManager should not make assumptions about AuthorizationManager returned from Session #145

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Have a Connector that implements Session.getAuthorizationManager() to
return null.
2. Make an authorization request that calls
ProductionManager.authorizeDocids() for that Connector.

What is the expected output?

Empty results set should be returned from ProductionManager.authorizeDocids().

What do you see instead?

NullPointerException causing an exception to be thrown rather than a well
formed response.  Could lead to unexpected results when called through the
Servlets.

NOTE: This does not currently affect any of the Connectors since all the
Connectors that feed content provide an AuthorizationManager.  The ones
that don't provide an AuthzMgr do not feed content so they won't be
consulted for authz checks.

Original issue reported on code.google.com by mgron...@gmail.com on 29 Apr 2009 at 12:47

GoogleCodeExporter commented 8 years ago
Fixed.

------------------------------------------------------------------------
r1811 | mgronber | 2009-04-29 17:26:29 -0700 (Wed, 29 Apr 2009) | 16 lines

Description:

Fix for Issue 145.  Current code path always assumes an AuthorizationManager is
returned from the Session, however, some Connectors return null.  Adding safety
check to prevent NullPointerException by checking the returned value and if it
is null just returning an empty set.

Tests Passed:

  - All Unit Tests

Change Log:

M java/com/google/enterprise/connector/manager/ProductionManager.java:
  - Added check for null AuthorizationManager.

Original comment by mgron...@gmail.com on 30 Apr 2009 at 12:33

GoogleCodeExporter commented 8 years ago

Original comment by Brett.Mi...@gmail.com on 16 May 2009 at 9:25