Clover icon

sunshower-core

  1. Project Clover database Fri Apr 6 2018 03:27:42 UTC
  2. Package io.sunshower.service.security.jaxrs

File AuthenticationContextProvider.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart0.png
60% of files have more coverage

Code metrics

0
1
1
1
16
12
1
1
1
1
1

Classes

Class Line # Actions
AuthenticationContextProvider 10 1 1
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package io.sunshower.service.security.jaxrs;
2   
3    import io.sunshower.model.core.auth.User;
4    import javax.ws.rs.ext.ContextResolver;
5    import javax.ws.rs.ext.Provider;
6    import org.springframework.security.core.context.SecurityContextHolder;
7   
8    /** Created by haswell on 11/2/16. */
9    @Provider
 
10    public class AuthenticationContextProvider implements ContextResolver<User> {
11   
 
12  0 toggle @Override
13    public User getContext(Class<?> type) {
14  0 return (User) SecurityContextHolder.getContext().getAuthentication();
15    }
16    }