Skip to content

Conversation

jonathancoueraud
Copy link

No description provided.

Copy link
Owner

@kakawait kakawait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet finished but a starting

*/
public class CasClientProperties {

private String proxyTicketQueryKey = "ticket";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thus I think this class could be removed

* @author Jonathan Coueraud
*/
@Qualifier("casClientHttpRequestInterceptor")
public class CasStatefulInterceptor implements ClientHttpRequestInterceptor {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will be moreStatefulCasInterceptor rather than CasStatefulInterceptor to keep logic from most specific to less specific, I mean Stateful vs Stateless then is about Cas and then is about Interceptor

/**
* @author Jonathan Coueraud
*/
public interface AuthenticatedPrincipal {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really fan of that name because it look like that interface hold the AuthenticatedPrincipal where is just an interface that abstract how to retrieve the Principal.

For now I don't have other name but I would think about but the idea will be more around PrincipalExtractor (but I don't like that name too)

import java.lang.annotation.*;

/**
* @author Jonathan Coueraud
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that you want to become famous but I think only one @author comment is enough 🤣

@Bean
@ConditionalOnMissingBean
public AuthenticatedPrincipal authenticatedPrincipal() {
return () -> (Principal) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can throw NPE, maybe do better check of null and RuntimeException

/**
* @author Jonathan Coueraud
*/
public interface CookieWrapper {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need CookieWrapper than using existing HttpCookie class?


private static final CurrentTimeMillisAdapter CURRENT_TIME_MILLIS_ADAPTER = new CurrentTimeMillisAdapter(){};

private final ConcurrentHashMap<HttpContextId, Map<String, CookieWrapper>> contextIdToCookies =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't be mapped to Map<HttpContextId, Map<String, CookieWrapper>>?

private final ConcurrentHashMap<HttpContextId, Map<String, CookieWrapper>> contextIdToCookies =
new ConcurrentHashMap<>();

private final ConcurrentHashMap<Principal, Set<URI>> principalToUris =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't be mapped to Map<Principal, Set<URI>>?


private final DelayQueue<CookieExpiry> expiryQueue = new DelayQueue<>();

private final ConcurrentHashMap<String, CookieExpiry> expiryMap = new ConcurrentHashMap<>();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't be mapped to Map<String, CookieExpiry>?

/**
* @author Jonathan Coueraud
*/
public class ProxyTicket implements Ticket {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Lombok for getter, equals & hashcode

@kakawait kakawait mentioned this pull request Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants