I hereby claim:
- I am genie137 on github.
- I am genie137 (https://keybase.io/genie137) on keybase.
- I have a public key ASAfNxj3lI-ac_63XRbLZSOVjeRJ-eTcYYS6CUqs6NTGXQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/// base package name is replaced by **** | |
package ****.app.configuration; | |
import ****.app.models.ErrorResponse; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.security.access.AccessDeniedException; | |
import org.springframework.web.bind.annotation.ControllerAdvice; | |
import org.springframework.web.bind.annotation.ExceptionHandler; |
@Component | |
public class JwtRequestFilter extends BasicAuthenticationFilter { | |
private final UserDetailsService userDetailsService; | |
private final JWTHelper jwtHelper; | |
private final HandlerExceptionResolver handlerExceptionResolver; | |
public JwtRequestFilter(AuthenticationManager authenticationManager, UserDetailsService userDetailsService, JWTHelper jwtHelper, HandlerExceptionResolver handlerExceptionResolver) { | |
super(authenticationManager); | |
this.userDetailsService = userDetailsService; |
@Override | |
protected void configure(HttpSecurity http) throws Exception { | |
//Disabling Cross-Origin-Resource-Sharing and Cross-Site-Request-Forgery checks. | |
http.cors().and().csrf().disable(); | |
//Setting request security settings | |
http.authorizeRequests().antMatchers("/auth/**").permitAll() | |
.anyRequest().authenticated(); | |
//Disabling session management |
@Configuration | |
@EnableWebSecurity() | |
@EnableGlobalMethodSecurity(securedEnabled = true) | |
public class SecurityConfig extends WebSecurityConfigurerAdapter { | |
private final UserDetailsService userDetailsService; | |
private final HandlerExceptionResolver handlerExceptionResolver; | |
public SecurityConfig(UserDetailsService userDetailsService, HandlerExceptionResolver handlerExceptionResolver) { | |
this.userDetailsService = userDetailsService; | |
this.handlerExceptionResolver = handlerExceptionResolver; |
I hereby claim:
To claim this, I am signing this object:
class Employee: | |
def __init__(self, name, role, department, salary, istemporary=None): | |
self.name = name | |
self.role = role | |
self.department = department | |
self.salary = salary | |
if istemporary is None: | |
self.istemporary = False | |
else: | |
self.istemporary = istemporary |
def main(file): | |
packets_str = file.read() | |
print() | |
while True: | |
if len(packets_str) != 0: | |
packets_str = get_package_info(packets_str) | |
else: | |
break |
price_list = (0.1, 0.25, 0.5, 0.8, 1.05, 1.5, 2.0, 2.5, 3.1, 3.7) | |
def cm_to_inch(input_cm): | |
output_inch = round((input_cm / 2.54)) | |
return output_inch | |
def calc_cost_pipe(inch_length, inch_diameter): | |
pipe_cost = inch_length * (price_list[(inch_diameter - 1)]) |