> On July 15, 2015, 8:27 a.m., Bill Farner wrote:
> > src/main/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityModule.java,
> >  lines 143-155
> > <https://reviews.apache.org/r/36490/diff/1/?file=1011891#file1011891line143>
> >
> >     Is the `Subject` -> `Optional<Subject>` layering necessary?  If not, 
> > consider simplifying by skipping the `toProvider` binding and call 
> > `SecurityUtils.getSubject()` in your provider method:
> >     
> >     ```
> >     @Provides
> >     @RequestScoped
> >     Optional<Subject> provideOptionalSubject() {
> >       return Optional.of(SecurityUtils.getSubject());
> >     }
> >     ```

Classes within the package inject Provider<Subject> directly (and get to skip 
the null check). Classes outside the package that attempt to do that should 
(and will) fail. This is the same behavior as Guice 4.0 OptionalBinder.


> On July 15, 2015, 8:27 a.m., Bill Farner wrote:
> > src/main/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityModule.java,
> >  line 147
> > <https://reviews.apache.org/r/36490/diff/1/?file=1011891#file1011891line147>
> >
> >     s/Bindings/Provider/

Fixed.


- Kevin


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


On July 14, 2015, 4:48 p.m., Kevin Sweeney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36490/
> -----------------------------------------------------------
> 
> (Updated July 14, 2015, 4:48 p.m.)
> 
> 
> Review request for Aurora and Bill Farner.
> 
> 
> Bugs: AURORA-1352
>     https://issues.apache.org/jira/browse/AURORA-1352
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Use injection of an optional value instead of optional injection.
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/auth/UnsecureSessionContext.java 
> f547c4485eab97e4fe149eec9fa73af3ce807748 
>   
> src/main/java/org/apache/aurora/scheduler/http/api/security/HttpSecurityModule.java
>  a3b0a6bd573f04ff275a54b16f0ab5ebf139868e 
>   src/test/java/org/apache/aurora/auth/UnsecureSessionContextTest.java 
> 63917363f392e6d970fb7e0cb91b840ca5db173e 
>   src/test/sh/org/apache/aurora/e2e/test_kerberos_end_to_end.sh 
> 6e4a294d6ca7ffd3a733498211e66ad674ef0b39 
> 
> Diff: https://reviews.apache.org/r/36490/diff/
> 
> 
> Testing
> -------
> 
> ./gradlew build
> 
> 
> Thanks,
> 
> Kevin Sweeney
> 
>

Reply via email to