> On Feb. 14, 2015, 1:12 a.m., Rishi Pidva wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java,
> >  line 1446
> > <https://reviews.apache.org/r/31035/diff/1/?file=864036#file864036line1446>
> >
> >     How about using ErrorCodes instead of searching for text startsWith()? 
> > Something like:
> >     
> >     ERR-11001: Invalid KDC administrator credentials......

Yeah, I was really just taking the easy route here trying to get this in 
quickly so I left the exception handling as it was in KerberosHelper when I 
extracted the new validate method.
I agree that using string comparison on the error message is dangerous and 
fragile.
I will change the new validate method in KerberosHelper to throw distinct 
kerberos exceptions.


- John


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/31035/#review72468
-----------------------------------------------------------


On Feb. 14, 2015, 1 a.m., John Speidel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31035/
> -----------------------------------------------------------
> 
> (Updated Feb. 14, 2015, 1 a.m.)
> 
> 
> Review request for Ambari, Robert Levas, Tom Beerbower, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-9640
>     https://issues.apache.org/jira/browse/AMBARI-9640
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Add the following properties to the Kerberos service resource which provide 
> the results of the validation of the KDC admin credentials stored in session: 
> "Services/attributes/kdc_validation_result" and 
> "Services/attributes/kdc_validation_failure_details".
> 
> See the associated Jira for more details including full api responses.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
>  2e68c7d 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  40921f5 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
>  210c6a4 
> 
> Diff: https://reviews.apache.org/r/31035/diff/
> 
> 
> Testing
> -------
> 
> Manual Functional Testing:
> - Tested all possible results of the validation
> - Tested when no kerberos service existed
> 
> Unit Tests:
> - Added new unit tests
> - Running entire unit test suite now and will post results prior to merging
> 
> 
> Thanks,
> 
> John Speidel
> 
>

Reply via email to